Samra icon indicating copy to clipboard operation
Samra copied to clipboard

Crash when opening .car files built with Xcode 26 (macOS 26 beta)

Open aumChauhan opened this issue 4 months ago • 3 comments

I’m running macOS 26 beta and I’ve noticed that Samra crashes whenever I try to open an Assets.car file that was built with Xcode 26.

  • Files built with Xcode 15 or earlier open fine.
  • Files built with Xcode 26 (even small/simple ones) cause the app to crash immediately upon loading.

CrashReport.txt

aumChauhan avatar Aug 13 '25 06:08 aumChauhan

The issue is at CoreUI+[CUINamedIconLayerStack _createLayers:fromTheme:baseRendition:withBlock:]:` which is called from package at https://github.com/NSAntoine/PrivateKits

There is a new Rendition type _CUILayerStackRendition but the crash happens even before the enumerate block is called https://github.com/NSAntoine/PrivateKits/blob/e64e411eb83e73e00c6faae8711c5b01c13985a1/Sources/AssetCatalogWrapper/AssetCatalogWrapper.swift#L423

(lldb) po $x0
<__NSArrayM 0xaeb0104e0>(
<CUIRenditionLayerReference 0xaeb1b4fc0> layerName='(null)',
<CUIRenditionLayerReference 0xaeb1b50a0> layerName='(null)',
<CUIRenditionLayerReference 0xaeb1b5180> layerName='(null)'
)

Only manually setting highlighted value to 0 using debugger can avoid the crash.

Image

xhruso00 avatar Sep 18 '25 17:09 xhruso00

Thank you for looking into this @xhruso00! I'm on to fix it now that I'm done w my internship @ Apple that prevented me from updating this. What do you mean by "Only manually setting highlighted value to 0 using debugger can avoid the crash"?

NSAntoine avatar Oct 03 '25 05:10 NSAntoine

@NSAntoine The currently used API https://github.com/NSAntoine/PrivateKits/blob/e64e411eb83e73e00c6faae8711c5b01c13985a1/Sources/CFrameworks/CoreUI/CUICatalog.h#L22 is crashing either due to not being compatible with new types or the calling block has wrong signature (less likely). I was able to avoid the crash under macOS26 with this API if I set a breakpoint in lldb at _createLayers... and change the given hardcoded value to 0 (e.g. $d0 = 0) when the new type is present. I haven't verified if the block signature has changed nor explored alternative API. But the terminal command assetutil -I under macOS26 can output the new types.

xhruso00 avatar Oct 03 '25 08:10 xhruso00