SceneKit app randomly crashes with EXC_BAD_ACCESS in jet_context::set_fragment_texture

Every now and then my SceneKit game app crashes and I have no idea why. The SCNView has a overlaySKScene, so it might also be SpriteKit's fault.

The stack trace is

#0	0x0000000241c1470c in jet_context::set_fragment_texture(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, jet_texture*) ()
#27	0x000000010572fd40 in _pthread_wqthread ()

Does anyone have an idea where I could start debugging this, without being able to consistently reproduce it?

Hello @Nickkk,

It could be helpful if you posted the fully symbolicated crash log.

Additionally, you may want to read over Investigating memory access crashes.

Best regards,

Greg

Where can I find the full (symbolicated) crash log? I don't have any relevant crash reports in the Console app. The crash is happening while debugging the app in Xcode. Here's a screenshot of all the expanded threads:

random crashes, imo, often mean threading issues, and indeed what you shared shows a crash in thread 2 with several other threads running as well. FWIW, early in my SceneKit days, I experienced similar crashes, and solved it by refactoring my code to add and remove SCNNodes only in main thread. fwiw.

Hello @Nickkk,

Where can I find the full (symbolicated) crash log? I don't have any relevant crash reports in the Console app. The crash is happening while debugging the app in Xcode.

Acquiring crash reports and diagnostic logs can help you retrieve the crash report, and Adding identifiable symbol names to a crash report can help you symbolicate it.

Acquiring crash reports and diagnostic logs can help you retrieve the crash report

Thanks. Here's the symbolicated crash report. It seems that it is indeed caused by the overlay SpriteKit scene.

FWIW, early in my SceneKit days, I experienced similar crashes, and solved it by refactoring my code to add and remove SCNNodes only in main thread.

Thanks for the suggestion, but I already solved these kind of crashes a long time ago. I'm already doing scene changes on the main thread.

Thanks for the log, it looks like it is truncated, and in this case it would be helpful to see the registers at the bottom.

That's the complete contents of the .ips file I found in the Console app. I have no idea why it is truncated. How can I find out why it's truncated and how to produce a full report?

Thanks, I filed FB15081598.

Were you able to fix it? I have the exact same problem. I have an overlay scene on top of a SKScene. crashes only started happening when I started cloning SKLabelNodes and adding them to the overlay scene.

Unfortunately I wasn't able to fix it, though I also noticed that when removing all SKLabelNode from my overlay scene the crash didn't happen anymore.

Hi @DTS Engineer ,

do you have any information about what is causing this crash so that we can look for a workaround? I'm close to publishing my game on the App Store, but this is one of two bugs that prevents me from doing so. Should I open a TSI? Thanks in advance for your help.

SceneKit app randomly crashes with EXC_BAD_ACCESS in jet_context::set_fragment_texture
 
 
Q