Crash on iOS 15.5 using XCode 14.1

Hey, after upgrading XCode to version 14.1, I'm getting instantly crash after starting my ReactNative application on iOS 15.6.1 in release build. Everything is fine either in debug build or downgrading XCode to 13.4 or upgrading iOS to 16.

It's also reproducible if you start release build on iOS 15.5 simulator.

Do you have any idea what might be the issue? Here's crash log:


Incident Identifier: 1A1DEC14-CB76-413B-9D9A-1E1D2C410012
CrashReporter Key:   f4bedf3edfd5eba605f533a1eb38fef421d97aa5
Hardware Model:      iPad12,1
Process:             ******** Staging [41464]
Path:                /private/var/containers/Bundle/Application/D76D2FFC-8807-4C2A-9FCA-153993E2D486/****** Staging.app/****** Staging
Identifier:          com.*******.******.dev
Version:             1.2 (104)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.*******.*******.dev [1061]

Date/Time:           2022-11-22 16:18:51.8468 +0100
Launch Time:         2022-11-22 16:18:51.7535 +0100
OS Version:          iPhone OS 15.6.1 (19G82)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: DYLD 4 Symbol missing
missing symbol called
(terminated at launch; ignore backtrace)

Triggered by Thread:  0

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   dyld                                   0x1035b4b14 __abort_with_payload + 8
1   dyld                                   0x1035ba6cc abort_with_payload_wrapper_internal + 104
2   dyld                                   0x1035ba700 abort_with_payload + 16
3   dyld                                   0x10358aa00 dyld4::halt(char const*) + 580
4   dyld                                   0x10359bd84 dyld4::APIs::_dyld_missing_symbol_abort() + 44
5   ********** Staging                         0x102528920 __RCTRegisterModule_block_invoke + 36
6   libdispatch.dylib                      0x180a4da30 _dispatch_client_callout + 20
7   libdispatch.dylib                      0x180a4f2b0 _dispatch_once_callout + 32
8   ********** Staging                         0x1025288f8 RCTRegisterModule + 136
9   libobjc.A.dylib                        0x199b0faec load_images + 824
10  dyld                                   0x103571f1c dyld4::RuntimeState::notifyObjCInit(dyld4::Loader const*) + 164
11  dyld                                   0x1035764b8 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 204
12  dyld                                   0x10357c7ac dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 124
13  dyld                                   0x10359c764 dyld4::APIs::runAllInitializersForMain() + 312
14  dyld                                   0x10358782c dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3060
15  dyld                                   0x103585d84 start + 488


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000004   x2: 0x000000016d9c6ec8   x3: 0x0000000000000014
    x4: 0x000000016d9c6ac8   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000600
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x0000000000000000  x11: 0x0000000000000000
   x12: 0x0000000000000000  x13: 0x0000000000000034  x14: 0x0000000029c00000  x15: 0x0000000216474000
   x16: 0x0000000000000209  x17: 0x00000001035af1c8  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016d9c6ac8  x21: 0x0000000000000014  x22: 0x000000016d9c6ec8  x23: 0x0000000000000004
   x24: 0x0000000000000006  x25: 0x000000016d9c6ac8  x26: 0x0000000000000400  x27: 0x0000000000000400
   x28: 0x0000000000000000   fp: 0x000000016d9c6a90   lr: 0x00000001035ba6cc
    sp: 0x000000016d9c6a50   pc: 0x00000001035b4b14 cpsr: 0x00000000
   far: 0x00000001027e9d28  esr: 0x56000080  Address size fault

Binary Images:
       0x10356c000 -        0x1035c3fff dyld arm64e  <66e1fb2668f8379ba052eb8b8291b5e1> /usr/lib/dyld
       0x102434000 -        0x102927fff ********* Staging arm64  <3b3b8585ee3531dba238e7640b1f1db7> /private/var/containers/Bundle/Application/D76D2FFC-8807-4C2A-9FCA-153993E2D486/********** Staging.app/********* Staging
       0x180a4a000 -        0x180a8ffff libdispatch.dylib arm64e  <e3ea4f635d11342aaf199f58dbc8e259> /usr/lib/system/libdispatch.dylib
       0x199b00000 -        0x199b3cfff libobjc.A.dylib arm64e  <f6368be9109b3405b282624040529afd> /usr/lib/libobjc.A.dylib

EOF

I have similar issue. My app was built with Xcode 13.4.1. I updated to build with Xcode 14.1 (sdk 16.1) and now the application is running only on iPad OS 16. It is crashing with iPad OS 15 which is not expected (min deployment target is set to 15).

The trace I have:

dyld[8624]: Symbol not found: _objc_release_x19
  Referenced from: /private/var/containers/Bundle/Application/F3B8E263-FFDF-49CF-AFE0-422BBDC42ACF/terminal_chart_card_test.app/terminal_chart_card_test
  Expected in: /usr/lib/libobjc.A.dylib
Symbol not found: _objc_release_x19
  Referenced from: /private/var/containers/Bundle/Application/F3B8E263-FFDF-49CF-AFE0-422BBDC42ACF/terminal_chart_card_test.app/terminal_chart_card_test
  Expected in: /usr/lib/libobjc.A.dylib
Program ended with exit code: 9

Thread 1#0 0x0000000107ede9b4 in __abort_with_payload ()
#1 0x0000000107ee3dec in abort_with_payload_wrapper_internal ()
#2 0x0000000107ee3e1c in abort_with_payload ()
#3 0x0000000107eb83c0 in dyld4::halt(char const*) ()
#4 0x0000000107eb5a7c in dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) ()
#5 0x0000000107eb4170 in start ()

It seems a system dylib or framework fails to load on iPad OS 15 but I don't know which one. Since I have some auto tests running I am trying to isolate the culprit...

By chance did you progress on the issue ?

JD

I also precise that the crash happens only in release mode (like in the first post).

I was able to remove the crashes by changing all objective C release calls by autorelease.

[myObj release] --> [myObj autorelease]

I am not very satisfied with this as release should work with iOS 15 release mode. What is strange is that I tried a very simple program which just allocs and releases a NSString and it does not crash. So there is a surrounding context for the issue to happen. I am using Qt (5.14.2), the issue maybe comes from it.

I keep posted if I find a solution.

I isolated the issue with a simple HelloWorld. The crash is systematic in release mode if the release method is called from a static library (with arc off).

I can't attach a zip file here... but here below the code that is crashing if embedded in a static library:

#import "HelloStatLib.h"

@implementation HelloStatLib

- (void)echoStatLibInfo {
    NSString *myObj;
    myObj = [[NSString alloc] initWithString:@"hello from static lib"];

    NSLog(@"obj says %@ from static lib", myObj);

    [myObj release];

    NSLog(@"obj is released from static lib!");
}
@end
Crash on iOS 15.5 using XCode 14.1
 
 
Q