Hello,
We are experiencing a weird crash on iPad when the game starts and we don't know what's causing it.
We narrowed down it happen for os versions >= 13.x
On my iPad 12.2 the installed app was working and after updating to the latest 14.1 it started crashing on start.
Is possible to reproduce the crash in debug too however only when not debugging the executable.
The crash happens very early so that even an NSLog as first command in the main function doesn't get printed.
All the logs on device are similar and despite many searches we haven't found anything that is applicable to our case.
We tried different version of Xcode (11.7 and 12.1) but we get the same issue.
Is there anyone who can give us any clue or ideas to where we could dig further?
Thanks in advance for any suggestions!
Here's an example of the log we get:
We are experiencing a weird crash on iPad when the game starts and we don't know what's causing it.
We narrowed down it happen for os versions >= 13.x
On my iPad 12.2 the installed app was working and after updating to the latest 14.1 it started crashing on start.
Is possible to reproduce the crash in debug too however only when not debugging the executable.
The crash happens very early so that even an NSLog as first command in the main function doesn't get printed.
All the logs on device are similar and despite many searches we haven't found anything that is applicable to our case.
We tried different version of Xcode (11.7 and 12.1) but we get the same issue.
Is there anyone who can give us any clue or ideas to where we could dig further?
Thanks in advance for any suggestions!
Here's an example of the log we get:
Code Block language OS Version: iPhone OS 14.1 (18A8395) Release Type: User Baseband Version: n/a Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x000000016fa5a860 Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [1641] Highlighted by Thread: 0 Backtrace not available Unknown thread crashed with ARM Thread State (64-bit): x0: 0x00000001002a0000 x1: 0x000000016fb5e8d8 x2: 0x000000016fb46040 x3: 0x000000016fb45fc0 x4: 0x000000018d9b0000 x5: 0x000000016fb45d60 x6: 0x7366657272657075 x7: 0x0000000000000930 x8: 0x000000016fb46080 x9: 0x000000011b5df2d8 x10: 0x6ae100016fb45fc0 x11: 0x0000000000000003 x12: 0x0000000000ff0006 x13: 0x0000000010a64000 x14: 0x0000000000000005 x15: 0x0000000000000000 x16: 0x000000011b5aaa88 x17: 0x000000011b59d374 x18: 0x0000000000000000 x19: 0x000000016fb45ed0 x20: 0x000000016fb46510 x21: 0x00000001002a0000 x22: 0x000000011b3b0000 x23: 0x000000016fb5e878 x24: 0x000000016fb5e8d8 x25: 0x000000016fa5a8c0 x26: 0x000000016fb45ed0 x27: 0x0000000000000295 x28: 0x0000000000010c88 fp: 0x000000016fb46500 lr: 0x916c0a811b5a9f38 sp: 0x000000016fa5a6f0 pc: 0x000000011b59e8b0 cpsr: 0x60000000 esr: 0x00000000 Address size fault Binary images description not available Error Formulating Crash Report: Failed to create CSSymbolicatorRef - corpse still valid ¯_(ツ)_/¯
We eventually solved the problem so I'm updating here as it may be helpful for others.
The actual crash was in dyld3:
So we realised it could have been something to do with static variables.
After narrowing down the set of changes who went in we changed a long list of 'inline const' constant into 'extern' and defined them into a cpp file.
This fixed the problem.
However we also realised that this crash happened after we passed the threshold of 128, maybe it's random maybe not, difficult to say.
For some reason from iOS 13.x (not sure about the version) the launcher seems to have this threshold.
Maybe someone can correct me.
For sure the same code works on iOS version < 13
The actual crash was in dyld3:
Code Block language Thread 1#0 0x00000001371e3d08 in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, bool, void (unsigned int) block_pointer, void const*) const () #1 0x00000001371ecca4 in dyld3::closure::ClosureBuilder::buildImage(dyld3::closure::ImageWriter&, dyld3::closure::ClosureBuilder::BuilderLoadedImage&) () #2 0x00000001371f5b20 in dyld3::closure::ClosureBuilder::makeLaunchClosure(dyld3::closure::LoadedFileInfo const&, bool) () #3 0x00000001371bfc0c in dyld::buildLaunchClosure(unsigned char const*, dyld3::closure::LoadedFileInfo const&, char const**) () #4 0x00000001371be88c in dyld::_main(macho_header const*, unsigned long, int, char const, char const, char const**, unsigned long*) () #5 0x00000001371b9208 in dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) () #6 0x00000001371b9038 in _dyld_start ()
So we realised it could have been something to do with static variables.
After narrowing down the set of changes who went in we changed a long list of 'inline const' constant into 'extern' and defined them into a cpp file.
This fixed the problem.
However we also realised that this crash happened after we passed the threshold of 128, maybe it's random maybe not, difficult to say.
For some reason from iOS 13.x (not sure about the version) the launcher seems to have this threshold.
Maybe someone can correct me.
For sure the same code works on iOS version < 13