IOS13 iPad Settings crashing for already paid app - ipad

Our apps on the AppStore have been running for years without any issues. However, since the release of iOS 13, although apps still working fine, but going into
iPad Settings -> MyApp
Crashes and the settings app would end, no issues with previous iOS releases whatsoever.
I looked on the Device Logs from the XCODE Organiser, and can see the following in the logs:
Incident Identifier: DC00F244-958C-407F-BDC9-CFD7D6C3D8C8
CrashReporter Key: e5b2979fc92fb936e83ef8fdab74fbd1c0707ce3
Hardware Model: iPad6,4
Process: Preferences [530]
Path: /Applications/Preferences.app/Preferences
Identifier: com.apple.Preferences
Version: 161.2 (1)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.apple.Preferences [634]
Date/Time: 2019-10-05 06:18:38.6274 +0100
Launch Time: 2019-10-05 06:18:17.3730 +0100
OS Version: iPhone OS 13.1.2 (17A860)
Release Type: User
Baseband Version: 7.00.01
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001a581fefc
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [530]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswiftCore.dylib 0x00000001a581fefc specialized _assertionFailure+ 2154236 (_:_:file:line:flags:) + 440
1 libswiftCore.dylib 0x00000001a581fefc specialized _assertionFailure+ 2154236 (_:_:file:line:flags:) + 440
2 libswiftCore.dylib 0x00000001a563b64c _assertionFailure+ 169548 (_:_:file:line:flags:) + 32
3 SettingsUIKitPrivate 0x00000001bfce0c24 0x1bfcda000 + 27684
4 SettingsUIKitPrivate 0x00000001bfce0fd4 0x1bfcda000 + 28628
5 SwiftUI 0x00000001cd28d86c Binding.init+ 6629484 (get:set:) + 144
6 SettingsUIKitPrivate 0x00000001bfcdf654 0x1bfcda000 + 22100
7 SettingsUIKitPrivate 0x00000001bfcdca54 0x1bfcda000 + 10836
8 SettingsUIKitPrivate 0x00000001bfcdc44c 0x1bfcda000 + 9292
9 SwiftUI 0x00000001cccf88e4 DynamicPropertyBody.update+ 776420 (context:) + 1768
10 SwiftUI 0x00000001cccf9070 protocol witness for static UntypedAttribute._update+ 778352 (_:graph:attribute:) in conformance DynamicPropertyBody<A> + 36
11 AttributeGraph 0x00000001c248e458 partial apply + 28
12 AttributeGraph 0x00000001c2476a60 AG::Graph::UpdateStack::update+ 14944 () + 984
13 AttributeGraph 0x00000001c2476d24 AG::Graph::update_attribute+ 15652 (unsigned int, bool) + 372
14 AttributeGraph 0x00000001c2479e9c AG::Graph::value_ref+ 28316 (AG::attribute_t, AGTypeID, bool*) + 116
15 AttributeGraph 0x00000001c24815ac AG::Graph::EntryExit::update_entry+ 58796 () const + 64
16 AttributeGraph 0x00000001c2476a60 AG::Graph::UpdateStack::update+ 14944 () + 984
17 AttributeGraph 0x00000001c2476d24 AG::Graph::update_attribute+ 15652 (unsigned int, bool) + 372
18 AttributeGraph 0x00000001c2479e9c AG::Graph::value_ref+ 28316 (AG::attribute_t, AGTypeID, bool*) + 116
19 AttributeGraph 0x00000001c24879e4 AGGraphGetValue + 48
20 SwiftUI 0x00000001cce25c20 ViewGraph.sizeThatFits+ 2010144 (_:) + 100
21 SwiftUI 0x00000001cd2e0520 specialized ListItemHost<>.hostSizeThatFits+ 6968608 (width:) + 120
22 SwiftUI 0x00000001ccefb250 #objc ListCoreCellHost.sizeThatFits+ 2884176 (_:) + 48
23 UIKitCore 0x000000019c666b98 -[UITableViewCell systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 592
24 UIKitCore 0x000000019c6dce38 -[UITableView _heightForCell:atIndexPath:] + 436
25 UIKitCore 0x000000019c6c544c __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 2568
26 UIKitCore 0x000000019c971d08 +[UIView+ 15129864 (Animation) performWithoutAnimation:] + 96
27 UIKitCore 0x000000019c6c495c -[UITableView _configureCellForDisplay:forIndexPath:] + 248
28 UIKitCore 0x000000019c6d5a04 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 796
29 UIKitCore 0x000000019c6a338c -[UITableView _updateVisibleCellsNow:] + 2608
30 UIKitCore 0x000000019c6c04b0 -[UITableView layoutSubviews] + 160
31 SwiftUI 0x00000001ccef4438 UpdateCoalescingTableView.layoutSubviews+ 2855992 () + 56
32 SwiftUI 0x00000001ccef45e4 #objc UpdateCoalescingTableView.layoutSubviews+ 2856420 () + 28
33 UIKitCore 0x000000019c97f270 -[UIView+ 15184496 (CALayerDelegate) layoutSublayersOfLayer:] + 2140
34 QuartzCore 0x000000019ee6b5f8 -[CALayer layoutSublayers] + 284
35 QuartzCore 0x000000019ee6fe28 CA::Layer::layout_if_needed+ 1396264 (CA::Transaction*) + 480
36 QuartzCore 0x000000019ee7b894 CA::Layer::layout_and_display_if_needed+ 1443988 (CA::Transaction*) + 136
37 QuartzCore 0x000000019edc49f0 CA::Context::commit_transaction+ 694768 (CA::Transaction*, double) + 304
38 QuartzCore 0x000000019edee890 CA::Transaction::commit+ 866448 () + 676
39 QuartzCore 0x000000019edef284 CA::Transaction::observer_callback+ 868996 (__CFRunLoopObserver*, unsigned long, void*) + 92
40 CoreFoundation 0x0000000198463c48 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
41 CoreFoundation 0x000000019845eb34 __CFRunLoopDoObservers + 416
42 CoreFoundation 0x000000019845f100 __CFRunLoopRun + 1308
43 CoreFoundation 0x000000019845e8bc CFRunLoopRunSpecific + 464
44 GraphicsServices 0x00000001a22ca328 GSEventRunModal + 104
45 UIKitCore 0x000000019c4f46d4 UIApplicationMain + 1936
46 Preferences 0x0000000104869974 0x104860000 + 39284
47 libdyld.dylib 0x00000001982e9460 start + 4
Thread 1:
0 libsystem_pthread.dylib 0x0000000198206ad8 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x0000000198206ad8 start_wqthread + 0
Thread 3 name: com.apple.uikit.eventfetch-thread
Thread 3:
0 libsystem_kernel.dylib 0x00000001982bd5f4 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001982bca60 mach_msg + 72
2 CoreFoundation 0x0000000198464068 __CFRunLoopServiceMachPort + 216
3 CoreFoundation 0x000000019845f188 __CFRunLoopRun + 1444
4 CoreFoundation 0x000000019845e8bc CFRunLoopRunSpecific + 464
5 Foundation 0x000000019879e994 -[NSRunLoop+ 31124 (NSRunLoop) runMode:beforeDate:] + 228
6 Foundation 0x000000019879e874 -[NSRunLoop+ 30836 (NSRunLoop) runUntilDate:] + 88
7 UIKitCore 0x000000019c58c49c -[UIEventFetcher threadMain] + 152
8 Foundation 0x00000001988cf0b0 __NSThread__start__ + 848
9 libsystem_pthread.dylib 0x00000001982031ec _pthread_start + 124
10 libsystem_pthread.dylib 0x0000000198206aec thread_start + 8
Thread 4:
0 libsystem_pthread.dylib 0x0000000198206ad8 start_wqthread + 0
Thread 5:
0 libsystem_pthread.dylib 0x0000000198206ad8 start_wqthread + 0
Thread 6 name: com.apple.NSURLConnectionLoader
Thread 6:
0 libsystem_kernel.dylib 0x00000001982bd5f4 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001982bca60 mach_msg + 72
2 CoreFoundation 0x0000000198464068 __CFRunLoopServiceMachPort + 216
3 CoreFoundation 0x000000019845f188 __CFRunLoopRun + 1444
4 CoreFoundation 0x000000019845e8bc CFRunLoopRunSpecific + 464
5 CFNetwork 0x000000019b6d9e68 0x19b6d8000 + 7784
6 Foundation 0x00000001988cf0b0 __NSThread__start__ + 848
7 libsystem_pthread.dylib 0x00000001982031ec _pthread_start + 124
8 libsystem_pthread.dylib 0x0000000198206aec thread_start + 8
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0xe000000000000000 x1: 0x0000000280915800 x2: 0x0000000000000007 x3: 0x00000001981ce0dc
x4: 0x0000000000000000 x5: 0x000000016b59a5f0 x6: 0x0000000000000072 x7: 0x0000000000000c70
x8: 0x00000000dfc24834 x9: 0x000000000000007f x10: 0x0000000000000031 x11: 0x00000000000007fb
x12: 0x00000000000007fd x13: 0x0000000000000000 x14: 0x00000000dfe25000 x15: 0x000000000000004a
x16: 0x0000000080000000 x17: 0x000000005fe00000 x18: 0x0000000000000000 x19: 0x00000001bfcfd020
x20: 0x0000000000000002 x21: 0x0000000000000000 x22: 0x00000000000000a8 x23: 0x0000000000000000
x24: 0xe000000000000000 x25: 0x000000000000000b x26: 0x0000000000000000 x27: 0x0000000000000095
x28: 0x00000001bfce0fbc fp: 0x000000016b59a790 lr: 0x00000001a581fefc
sp: 0x000000016b59a710 pc: 0x00000001a581fefc cpsr: 0x60000000
esr: 0xf2000001 Address size fault
I'm scratching my head on this one, the app works fine, just the settings having this issue.
I have a plan about how to diagnose and fix and hopefully should resolve soon but wondered if anyone has seen this yet?
Thanks

Finally, after few hours of going through the settings, code, etc, I finally fixed it.
The approach was to:
1) Edit my APP setting's info.plist file (as text) and take out all sections into text editor, the file almost becomes blank.
2) Re-compile and run on the iPad -> STOP APP -> Go to Settings -> Click on the APP, it now works fine without my settings, so, I thought something must have caused all this.
3) Started pasting back part-by-part into the info.plist file until I finally got the offending section, which was below:
<dict>
<key>AutocapitalizationType</key>
<string>None</string>
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string>8101</string>
<key>IsSecure</key>
<string>No</string>
<key>Key</key>
<string>Admin_iTaxi Server Port</string>
<key>KeyboardType</key>
<string>NumberPad</string>
<key>Title</key>
<string>Server Port </string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
4) Looked very strange and bizarre, ... I mean what could possibly be wrong with the above chunk?!... and why was this working on all iOSes until the latest iOS13!?...
5) Checked all spelling, re-ordered the list to make it similar to another one that does work, changed the keyboard type, other items,... started-Stopped, checked settings, same thing,... still crashing!...
6) Finally, I changed the variable name from "Admin_iTaxi Server Port" to "Admin_iTaxi Server XXXPort", re-compiled, and it worked... hmmm... why!?...
7) Went back into the startup code, and noticed that I am setting the variables (if they don't exists) with the following:
if (!IsConfigKeyExist(#"Admin_iTaxi Server Port"))
{
TempServerPortAdmin = 8102;
[[NSUserDefaults standardUserDefaults] setInteger:TempServerPortAdmin forKey:#"Admin_iTaxi Server Port"];
}
8) I then thought, the info.plist file has KEYs and TYPEs, all are set as , can't remember setting any or etc, therefore.
9) Changed the code above into:
if (!IsConfigKeyExist(#"Admin_iTaxi Server Port"))
{
TempServerPortAdmin = 8102;
[[NSUserDefaults standardUserDefaults] setValue:[NSString stringWithFormat:#"%li", TempServerPortAdmin] forKey:#"Admin_iTaxi Server Port"];
}
10) Restored the original variable name on the info.plist, start-stop-check, ... Eureeka,.. it now works...
Conclusion: somehow down the line Apple in their wisdom decided to crash the settings app when they read an Integer into a String variable... why!?... I have no idea, but the fix (as mentioned above), is NOT to store your settings as "Integer" and infect only store as "String" especially if you are going to use these settings in your info.plist file.
This solves the problem of the app's settings crashing with EXC_BREAKPOINT (SIGTRAP)
I hope this helps.
Good luck!

Related

Unable to find the cause of crash-Exception Type: EXC_BREAKPOINT (SIGTRAP)

I would be so appreciated if anybody could spend their time to help me!!!
What I am facing now
I was trying to present an view controller from extension and the app crashed without leading me the line of error code.
What I tried:
I Added many breakpoints, found that if I don't present the table view controller to show the correct info, no crash. But after the presentation, after the info is loaded rightly in the table, seconds later, crash happens.
What I can provide:
I can provide the full crash report:
Incident Identifier: 03B53A6D-E069-4C4B-98C0-CB61C8C1A688
CrashReporter Key: 1dd64f8867f0eda63dfc5248be178fbebdd71653
Hardware Model: iPhone9,2
Process: EverykeyAutofillExtension [98811]
Path: /private/var/containers/Bundle/Application/63F02B78-71D9-405B-AC3F-314868CA262D/Privacy.app/PlugIns/PrivacyExtension.appex/EverykeyAutofillExtension
Identifier: comPrivacy.ios.PrivacyAutofillExtension
Version: 12 (2.4.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.Privacy.ios.PrivacyAutofillExtension [24965]
Date/Time: 2020-08-26 14:20:40.7959 -0400
Launch Time: 2020-08-26 14:20:03.4675 -0400
OS Version: iPhone OS 13.5.1 (17F80)
Release Type: User
Baseband Version: 7.60.01
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000019819e9d0
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [98811]
Triggered by Thread: 1
Last Exception Backtrace:
0 CoreFoundation 0x19853d794 __exceptionPreprocess + 224
1 libobjc.A.dylib 0x19825fbcc objc_exception_throw + 55
2 Foundation 0x198a151fc _AssertAutolayoutOnAllowedThreadsOnly + 419
3 Foundation 0x19882207c -[NSISEngine _optimizeWithoutRebuilding] + 67
4 Foundation 0x198821f98 -[NSISEngine optimize] + 111
5 Foundation 0x198821c0c -[NSISEngine performPendingChangeNotifications] + 111
6 UIKitCore 0x19ca97e88 -[UIView+ 15605384 (CALayerDelegate) _wantsReapplicationOfAutoLayoutWithLayoutDirtyOnEntry:] + 171
7 UIKitCore 0x19ca988c4 -[UIView+ 15608004 (CALayerDelegate) layoutSublayersOfLayer:] + 2247
8 QuartzCore 0x19f02b724 -[CALayer layoutSublayers] + 283
9 QuartzCore 0x19f03187c CA::Layer::layout_if_needed+ 1407100 (CA::Transaction*) + 467
10 QuartzCore 0x19f03c3c0 CA::Layer::layout_and_display_if_needed+ 1450944 (CA::Transaction*) + 139
11 QuartzCore 0x19ef84f1c CA::Context::commit_transaction+ 700188 (CA::Transaction*, double) + 295
12 QuartzCore 0x19efae8bc CA::Transaction::commit+ 870588 () + 675
13 QuartzCore 0x19efaf85c CA::Transaction::release_thread+ 874588 (void*) + 227
14 libsystem_pthread.dylib 0x198256f8c _pthread_tsd_cleanup + 579
15 libsystem_pthread.dylib 0x198253df4 _pthread_exit + 79
16 libsystem_pthread.dylib 0x198254e64 _pthread_wqthread_exit + 95
17 libsystem_pthread.dylib 0x198254c04 _pthread_wqthread + 415
18 libsystem_pthread.dylib 0x198257740 start_wqthread + 7
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x0000000198311198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000019831060c mach_msg + 72
2 CoreFoundation 0x00000001984bb468 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x00000001984b649c __CFRunLoopRun + 1160
4 CoreFoundation 0x00000001984b5ce8 CFRunLoopRunSpecific + 424
5 GraphicsServices 0x00000001a260038c GSEventRunModal + 160
6 UIKitCore 0x000000019c5e4444 UIApplicationMain + 1932
7 libxpc.dylib 0x00000001981218fc _xpc_objc_main.cold.3 + 208
8 libxpc.dylib 0x000000019810d4f0 _xpc_objc_main + 212
9 libxpc.dylib 0x000000019810fb4c xpc_main + 148
10 Foundation 0x0000000198834534 +[NSXPCListener serviceListener] + 0
11 PlugInKit 0x00000001a599fd50 0x1a5989000 + 93520
12 PlugInKit 0x00000001a599fa68 0x1a5989000 + 92776
13 PlugInKit 0x00000001a59a015c 0x1a5989000 + 94556
14 Foundation 0x0000000198a0d2c0 NSExtensionMain + 64
15 libdyld.dylib 0x000000019833d8f0 start + 4
Thread 1 Crashed:
0 libsystem_c.dylib 0x000000019819e9d0 __abort + 144
1 libsystem_c.dylib 0x000000019819e9d0 __abort + 144
2 libsystem_c.dylib 0x000000019819e940 __abort + 0
3 libc++abi.dylib 0x0000000198306cc0 __cxxabiv1::__aligned_malloc_with_fallback+ 76992 (unsigned long) + 0
4 libc++abi.dylib 0x00000001982f8e10 demangling_unexpected_handler+ 19984 () + 0
5 libobjc.A.dylib 0x000000019825fe80 _objc_terminate+ 24192 () + 124
6 libc++abi.dylib 0x000000019830614c std::__terminate(void (*)+ 74060 ()) + 16
7 libc++abi.dylib 0x0000000198308bd8 __cxa_get_exception_ptr + 0
8 libc++abi.dylib 0x0000000198308b98 __cxxabiv1::exception_cleanup_func+ 84888 (_Unwind_Reason_Code, _Unwind_Exception*) + 0
9 libobjc.A.dylib 0x000000019825fcf8 _objc_exception_destructor+ 23800 (void*) + 0
10 Foundation 0x0000000198a151fc -[NSISEngine tryToOptimizeReturningMutuallyExclusiveConstraints] + 0
11 Foundation 0x000000019882207c -[NSISEngine _optimizeWithoutRebuilding] + 68
12 Foundation 0x0000000198821f98 -[NSISEngine optimize] + 112
13 Foundation 0x0000000198821c0c -[NSISEngine performPendingChangeNotifications] + 112
14 UIKitCore 0x000000019ca97e88 -[UIView+ 15605384 (CALayerDelegate) _wantsReapplicationOfAutoLayoutWithLayoutDirtyOnEntry:] + 172
15 UIKitCore 0x000000019ca988c4 -[UIView+ 15608004 (CALayerDelegate) layoutSublayersOfLayer:] + 2248
16 QuartzCore 0x000000019f02b724 -[CALayer layoutSublayers] + 284
17 QuartzCore 0x000000019f03187c CA::Layer::layout_if_needed+ 1407100 (CA::Transaction*) + 468
18 QuartzCore 0x000000019f03c3c0 CA::Layer::layout_and_display_if_needed+ 1450944 (CA::Transaction*) + 140
19 QuartzCore 0x000000019ef84f1c CA::Context::commit_transaction+ 700188 (CA::Transaction*, double) + 296
20 QuartzCore 0x000000019efae8bc CA::Transaction::commit+ 870588 () + 676
21 QuartzCore 0x000000019efaf85c CA::Transaction::release_thread+ 874588 (void*) + 228
22 libsystem_pthread.dylib 0x0000000198256f8c _pthread_tsd_cleanup + 580
23 libsystem_pthread.dylib 0x0000000198253df4 _pthread_exit + 80
24 libsystem_pthread.dylib 0x0000000198254e64 _pthread_wqthread_legacy_worker_wrap + 0
25 libsystem_pthread.dylib 0x0000000198254c04 _pthread_wqthread + 416
26 libsystem_pthread.dylib 0x0000000198257740 start_wqthread + 8
Thread 2 name: com.apple.uikit.eventfetch-thread
Thread 2:
0 libsystem_kernel.dylib 0x0000000198311198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000019831060c mach_msg + 72
2 CoreFoundation 0x00000001984bb468 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x00000001984b649c __CFRunLoopRun + 1160
4 CoreFoundation 0x00000001984b5ce8 CFRunLoopRunSpecific + 424
5 Foundation 0x00000001987f901c -[NSRunLoop+ 32796 (NSRunLoop) runMode:beforeDate:] + 228
6 Foundation 0x00000001987f8efc -[NSRunLoop+ 32508 (NSRunLoop) runUntilDate:] + 88
7 UIKitCore 0x000000019c6875dc -[UIEventFetcher threadMain] + 152
8 Foundation 0x0000000198927e20 __NSThread__start__ + 848
9 libsystem_pthread.dylib 0x0000000198253d98 _pthread_start + 156
10 libsystem_pthread.dylib 0x000000019825774c thread_start + 8
Thread 3:
0 libsystem_pthread.dylib 0x0000000198257738 start_wqthread + 0
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x0000000198311198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000019831060c mach_msg + 72
2 CoreFoundation 0x00000001984bb468 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x00000001984b649c __CFRunLoopRun + 1160
4 CoreFoundation 0x00000001984b5ce8 CFRunLoopRunSpecific + 424
5 CFNetwork 0x000000019b776894 0x19b775000 + 6292
6 Foundation 0x0000000198927e20 __NSThread__start__ + 848
7 libsystem_pthread.dylib 0x0000000198253d98 _pthread_start + 156
8 libsystem_pthread.dylib 0x000000019825774c thread_start + 8
Thread 5:
0 libsystem_pthread.dylib 0x0000000198257738 start_wqthread + 0
Thread 6:
0 libsystem_pthread.dylib 0x0000000198257738 start_wqthread + 0
Thread 7:
0 libsystem_pthread.dylib 0x0000000198257738 start_wqthread + 0
Thread 1 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000001
x4: 0x0000000000000000 x5: 0x0000000000989680 x6: 0x000000000000006e x7: 0xffffffffffffffec
x8: 0x00000000ffffffe7 x9: 0x00000001e565b228 x10: 0x00000000000003e8 x11: 0x000000000000000b
x12: 0x00000001d388d080 x13: 0x0000000000000001 x14: 0x0000000000000010 x15: 0x0000000000000007
x16: 0x0000000000000030 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x000000016fa62b58
x20: 0x00000001e2581810 x21: 0x000000016fa62c10 x22: 0x0000000281b4ce40 x23: 0x00000001d3b33000
x24: 0x0000000000000001 x25: 0x0000000000000068 x26: 0x000000000000009c x27: 0x0000000000000068
x28: 0x000000002b310019 fp: 0x000000016fa62b70 lr: 0x000000019819e9d0
sp: 0x000000016fa62b40 pc: 0x000000019819e9d0 cpsr: 0x40000000
esr: 0xf2000001 Address size fault
Look, Your app crashed at:
Triggered by Thread: 1
and use
[CALayer layoutSublayers]
looks like, You're updating UI not in main thread somewhere
Whenever you see something like this
1 libobjc.A.dylib 0x19825fbcc objc_exception_throw + 55
You should go to the breakpoints tab in Xcode, click the + button, then Exception Breakpoint...
This will create a breakpoint called "All Objective-C exceptions". This will pause the debugger at the moment the exception is thrown, letting you see the exact misuse of Apple's API that is causing the exception.

ARKit App Crashes on launch with appstore review, not on device

The appstore review team told me that the app was crashing on launch.
I believe the app was crashing at didFinishLaunching:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
guard ARWorldTrackingConfiguration.isSupported else {
fatalError("""
ARKit is not available on this device. For apps that require ARKit
for core functionality, use the `arkit` key in the key in the
`UIRequiredDeviceCapabilities` section of the Info.plist to prevent
the app from installing. (If the app can't be installed, this error
can't be triggered in a production scenario.)
In apps where AR is an additive feature, use `isSupported` to
determine whether to show UI for launching AR experiences.
""") // For details, see https://developer.apple.com/documentation/arkit
}
return true
}
However, the app can only be installed on a device which supports ARKit, so I am not sure how apple was able to replicate this on a iOS13 device, as the UIRequiredDeviceCapability includes an ARKit entry in the .plist. Is it possible they are running the app on a device without this capability? Is the app actually crashing because of the fatalerror call?
Here is the crashlog that I was only partially able to symbolicate:
Date/Time: 2019-10-06 13:10:04.9570 -0700
Launch Time: 2019-10-06 13:10:04.7508 -0700
OS Version: iPhone OS 13.1.2 (17A860)
Release Type: User
Baseband Version: 9.00.01
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001a62abefc
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [561]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswiftCore.dylib 0x00000001a62abefc 0x1a609e000 + 2154236
1 libswiftCore.dylib 0x00000001a62abefc 0x1a609e000 + 2154236
2 libswiftCore.dylib 0x00000001a60c764c 0x1a609e000 + 169548
3 ARC2500A 0x0000000100fcc6c8 #objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 83656 (AppDelegate.swift:0)
4 UIKitCore 0x000000019cf76ebc 0x19c590000 + 10383036
5 UIKitCore 0x000000019cf78c8c 0x19c590000 + 10390668
6 UIKitCore 0x000000019cf7e4c0 0x19c590000 + 10413248
7 UIKitCore 0x000000019c75a810 0x19c590000 + 1878032
8 UIKitCore 0x000000019cbeb3ec 0x19c590000 + 6665196
9 UIKitCore 0x000000019c75b2f8 0x19c590000 + 1880824
10 UIKitCore 0x000000019c75ae04 0x19c590000 + 1879556
11 UIKitCore 0x000000019c75b124 0x19c590000 + 1880356
12 UIKitCore 0x000000019c75a9e0 0x19c590000 + 1878496
13 UIKitCore 0x000000019c75eefc 0x19c590000 + 1896188
14 UIKitCore 0x000000019cb1e028 0x19c590000 + 5824552
15 UIKitCore 0x000000019cc045ac 0x19c590000 + 6768044
16 UIKitCore 0x000000019c75ec34 0x19c590000 + 1895476
17 UIKitCore 0x000000019cc044a8 0x19c590000 + 6767784
18 UIKitCore 0x000000019c75eaa0 0x19c590000 + 1895072
19 UIKitCore 0x000000019c5d3efc 0x19c590000 + 278268
20 UIKitCore 0x000000019c5d2a64 0x19c590000 + 272996
21 UIKitCore 0x000000019c5d3c34 0x19c590000 + 277556
22 UIKitCore 0x000000019cf7c840 0x19c590000 + 10405952
23 UIKitCore 0x000000019cb3ea0c 0x19c590000 + 5958156
24 FrontBoardServices 0x000000019e00b994 0x19dfff000 + 51604
25 FrontBoardServices 0x000000019e030960 0x19dfff000 + 203104
26 FrontBoardServices 0x000000019e0160f8 0x19dfff000 + 94456
27 FrontBoardServices 0x000000019e03061c 0x19dfff000 + 202268
28 libdispatch.dylib 0x0000000198c40184 0x198be4000 + 377220
29 libdispatch.dylib 0x0000000198be9038 0x198be4000 + 20536
30 FrontBoardServices 0x000000019e055540 0x19dfff000 + 353600
31 FrontBoardServices 0x000000019e05520c 0x19dfff000 + 352780
32 FrontBoardServices 0x000000019e055734 0x19dfff000 + 354100
33 CoreFoundation 0x0000000198ef07e0 0x198e47000 + 694240
34 CoreFoundation 0x0000000198ef0738 0x198e47000 + 694072
35 CoreFoundation 0x0000000198eefed0 0x198e47000 + 691920
36 CoreFoundation 0x0000000198eeb01c 0x198e47000 + 671772
37 CoreFoundation 0x0000000198eea8bc 0x198e47000 + 669884
38 GraphicsServices 0x00000001a2d56328 0x1a2d53000 + 13096
39 UIKitCore 0x000000019cf806d4 0x19c590000 + 10421972
40 ARC2500A 0x0000000100fc3010 main + 45072 (TableVC.swift:13)
41 libdyld.dylib 0x0000000198d75460 0x198d74000 + 5216
Thread 1 name: Dispatch queue: com.apple.root.background-qos
Thread 1:
0 libsystem_kernel.dylib 0x0000000198d6acb4 0x198d46000 + 150708
1 libsystem_pthread.dylib 0x0000000198c88d8c 0x198c84000 + 19852
2 libsystem_pthread.dylib 0x0000000198c88d5c 0x198c84000 + 19804
3 CoreFoundation 0x0000000198ecc2f4 0x198e47000 + 545524
4 CoreFoundation 0x0000000198ecb4dc 0x198e47000 + 541916
5 libdispatch.dylib 0x0000000198c3f610 0x198be4000 + 374288
6 libdispatch.dylib 0x0000000198c40184 0x198be4000 + 377220
7 libdispatch.dylib 0x0000000198bf5104 0x198be4000 + 69892
8 libdispatch.dylib 0x0000000198bf579c 0x198be4000 + 71580
9 libsystem_pthread.dylib 0x0000000198c8ff64 0x198c84000 + 48996
10 libsystem_pthread.dylib 0x0000000198c92ae0 0x198c84000 + 60128
Thread 2:
0 libsystem_pthread.dylib 0x0000000198c92ad8 0x198c84000 + 60120
Thread 3:
0 libsystem_pthread.dylib 0x0000000198c92ad8 0x198c84000 + 60120
Thread 4:
0 libsystem_pthread.dylib 0x0000000198c92ad8 0x198c84000 + 60120
Thread 5 name: com.apple.uikit.eventfetch-thread
Thread 5:
0 libsystem_kernel.dylib 0x0000000198d495f4 0x198d46000 + 13812
1 libsystem_kernel.dylib 0x0000000198d48a60 0x198d46000 + 10848
2 CoreFoundation 0x0000000198ef0068 0x198e47000 + 692328
3 CoreFoundation 0x0000000198eeb188 0x198e47000 + 672136
4 CoreFoundation 0x0000000198eea8bc 0x198e47000 + 669884
5 Foundation 0x000000019922a994 0x199223000 + 31124
6 Foundation 0x000000019922a874 0x199223000 + 30836
7 UIKitCore 0x000000019d01849c 0x19c590000 + 11043996
8 Foundation 0x000000019935b0b0 0x199223000 + 1278128
9 libsystem_pthread.dylib 0x0000000198c8f1ec 0x198c84000 + 45548
10 libsystem_pthread.dylib 0x0000000198c92aec 0x198c84000 + 60140
Thread 6:
0 libsystem_pthread.dylib 0x0000000198c92ad8 0x198c84000 + 60120
Thread 7:
0 libsystem_pthread.dylib 0x0000000198c92ad8 0x198c84000 + 60120
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x8000000100fd0130 x1: 0x0000000000000407 x2: 0x0000000000000407 x3: 0x000000000000002b
x4: 0x0000000107f05230 x5: 0x0000000000000026 x6: 0x0000000000000000 x7: 0x0000000000000c70
x8: 0x0000000000000000 x9: 0x00000000000295b0 x10: 0x00000000000d29d0 x11: 0x0000000000179f41
x12: 0x0000000107f04000 x13: 0x0000000000003fff x14: 0x00000000b71ada31 x15: 0x000000000000080c
x16: 0x0000000198c7e040 x17: 0x000000000000080c x18: 0x0000000000000000 x19: 0x0000000100fd0142
x20: 0x0000000000000002 x21: 0x0000000000000000 x22: 0x0000000000000014 x23: 0x0000000000000000
x24: 0x8000000100fd0130 x25: 0x000000000000000b x26: 0xd0000000000001cb x27: 0x0000000000000051
x28: 0x00000001dc5d1000 fp: 0x000000016ee455d0 lr: 0x00000001a62abefc
sp: 0x000000016ee45550 pc: 0x00000001a62abefc cpsr: 0x60000000
esr: 0xf2000001 Address size fault
Here is an important note from the Apple docs for the isSupported property.
Discussion
Different types of AR experiences (which you configure using concrete
ARConfiguration subclasses) can have different hardware requirements.
Before attempting to create an AR configuration, verify that the
user’s device supports the configuration you plan to use by checking
the isSupported property of the corresponding configuration class. If
this property’s value is false, the current device does not support
the requested configuration.
Important
All ARKit configurations require an iOS device with an A9 or later
processor. If your app otherwise supports other devices and offers
augmented reality as a secondary feature, use this property to
determine whether to offer AR-based features to the user.
If your app requires ARKit for its core functionality, use the arkit
key in the UIRequiredDeviceCapabilities section of your app's
Info.plist to make your app available only on devices that support
ARKit.
Conclusively, this means that the test device used by Apple Store Review does not support ARWorldTrackingConfiguration subclass of ARConfiguration. Probably they use a device with below an A9 processor or they used an iOS version older than 11.0 to test the app.
Otherwise,
In the Info.plist, make sure in your UIRequiredDeviceCapability, you have the arkit entry all in small caps.

Can't determine cause from this crash log

I had an app in the App Store with lots of crashes, but I can't reproduce it myself.
I have lots of crash logs but they don't contain a backtrace making it difficult to diagnose the issue.
The crash logs show CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER which possibly could be caused by a notification being sent to a deallocated observer according to other questions on SO.
However the app only runs on iOS 10+, and according to Apple its not necessary to de-register observers from iOS 9 onwards unless they are block observers. Which my app doesn't use so that can't be the cause as far as my own apps notifications are concerned.
Incident Identifier: 77AB1312-9C1F-4BC1-957E-B742856DC635
CrashReporter Key: 6ad59ac64c53d2fc92208e8df23d4ddc8fed39fd
Hardware Model: iPhone10,3
Process: My App [378]
Path: /private/var/containers/Bundle/Application/99C2E2C8-9655-4D07-9608-870B5DD17C21/My app.app/My app
Identifier: com.myapp
OS Version: iPhone OS 10.3.2 (14F89)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.myapp[498]
Date/Time: 2018-06-06 00:18:34.2085 -0700
Launch Time: 2018-06-06 00:17:39.1406 -0700
Baseband Version: 2.03.00
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018ec4d014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018ed17264 pthread_kill + 112 (pthread.c:1366)
2 libsystem_c.dylib 0x000000018ebc19c4 abort + 140 (abort.c:91)
3 libswiftCore.dylib 0x0000000100ad976c 0x1007ec000 + 3069804
4 libswiftCore.dylib 0x0000000100b0614c 0x1007ec000 + 3252556
5 CoreFoundation 0x000000018fc56f54 ___forwarding___ + 916 (NSForwarding.m:3126)
6 CoreFoundation 0x000000018fb52d4c _CF_forwarding_prep_0 + 92
7 CoreFoundation 0x000000018fbed5f4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:650)
8 CoreFoundation 0x000000018fbecd08 _CFXRegistrationPost + 400 (CFNotificationCenter.c:164)
9 CoreFoundation 0x000000018fbeca84 ___CFXNotificationPost_block_invoke + 60 (CFNotificationCenter.c:1031)
10 CoreFoundation 0x000000018fc5b7a8 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1412 (CFXNotificationRegistrar.m:163)
11 CoreFoundation 0x000000018fb3095c _CFXNotificationPost + 376 (CFNotificationCenter.c:1028)
12 Foundation 0x0000000190642930 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 (NSNotification.m:482)
13 UIKit 0x0000000195e07ea8 -[UIApplication _stopDeactivatingForReason:] + 1124 (UIApplication.m:1534)
14 UIKit 0x0000000196005b4c __62-[UIApplication _sceneSettingsPostLifecycleEventDiffInspector]_block_invoke.1259 + 124 (UIApplication.m:3247)
15 FrontBoardServices 0x00000001917e4be8 __52-[FBSSettingsDiffInspector inspectDiff:withContext:]_block_invoke.27 + 204 (FBSSettingsDiffInspector.m:46)
16 Foundation 0x00000001906fc7fc __NSIndexSetEnumerate + 724 (NSIndexSet.m:1347)
17 BaseBoard 0x0000000191757510 -[BSSettingsDiff inspectChangesWithBlock:] + 104 (BSSettingsDiff.m:187)
18 FrontBoardServices 0x00000001917dece4 -[FBSSettingsDiff inspectOtherChangesWithBlock:] + 88 (FBSSettingsDiff.m:65)
19 FrontBoardServices 0x00000001917e49bc -[FBSSettingsDiffInspector inspectDiff:withContext:] + 280 (FBSSettingsDiffInspector.m:44)
20 UIKit 0x00000001960064d4 __70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 196 (UIApplication.m:3346)
21 UIKit 0x0000000196006124 -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 892 (UIApplication.m:3357)
22 UIKit 0x00000001963407c8 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464 (UIApplicationSceneClientAgent.m:74)
23 FrontBoardServices 0x00000001917ce22c __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.376 + 208 (FBSSceneImpl.m:598)
24 FrontBoardServices 0x00000001917fb884 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36 (FBSSerialQueue.m:158)
25 FrontBoardServices 0x00000001917fb6f0 -[FBSSerialQueue _performNext] + 176 (FBSSerialQueue.m:177)
26 FrontBoardServices 0x00000001917fbaa0 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 (FBSSerialQueue.m:206)
27 CoreFoundation 0x000000018fc0142c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1943)
28 CoreFoundation 0x000000018fc00d9c __CFRunLoopDoSources0 + 540 (CFRunLoop.c:1989)
29 CoreFoundation 0x000000018fbfe9a8 __CFRunLoopRun + 744 (CFRunLoop.c:2821)
30 CoreFoundation 0x000000018fb2eda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
31 GraphicsServices 0x0000000191598074 GSEventRunModal + 100 (GSEvent.c:2245)
32 UIKit 0x0000000195de9058 UIApplicationMain + 208 (UIApplication.m:4089)
33 My App 0x00000001000be2e4 main + 56 (MyFile.swift:17)
34 libdyld.dylib 0x000000018eb3d59c start + 4
hread 1:
0 libsystem_pthread.dylib 0x0000000220f92064 start_wqthread + 0
Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x0000000220ef6ac8 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000220ef6940 mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000022131d2f0 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3 CoreFoundation 0x000000022131af80 __CFRunLoopRun + 1404 (CFRunLoop.c:2971)
4 CoreFoundation 0x0000000221254abc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5 Foundation 0x0000000221cd0544 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300 (NSRunLoop.m:367)
6 Foundation 0x0000000221cd03f0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 148 (NSRunLoop.m:411)
7 UIKitCore 0x000000024c433a7c -[UIEventFetcher threadMain] + 136 (UIEventFetcher.m:524)
8 Foundation 0x0000000221de0a94 __NSThread__start__ + 1040 (NSThread.m:1175)
9 libsystem_pthread.dylib 0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
10 libsystem_pthread.dylib 0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
11 libsystem_pthread.dylib 0x0000000220f92070 thread_start + 4
Thread 3 name:
Thread 3:
0 libsystem_kernel.dylib 0x0000000220ef6ac8 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000220ef6940 mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000022131d2f0 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3 CoreFoundation 0x000000022131af80 __CFRunLoopRun + 1404 (CFRunLoop.c:2971)
4 CoreFoundation 0x0000000221254abc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5 CFNetwork 0x0000000221b5fc8c -[__CoreSchedulingSetRunnable runForever] + 212 (CoreSchedulingSet.mm:1365)
6 Foundation 0x0000000221de0a94 __NSThread__start__ + 1040 (NSThread.m:1175)
7 libsystem_pthread.dylib 0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
8 libsystem_pthread.dylib 0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
9 libsystem_pthread.dylib 0x0000000220f92070 thread_start + 4
Thread 4 name:
Thread 4:
0 libsystem_kernel.dylib 0x0000000220f184ac __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x0000000220f9a638 _pthread_cond_wait$VARIANT$armv81 + 620 (pthread_cond.c:578)
2 libc++.1.dylib 0x00000002205b2e28 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24 (__threading_support:278)
3 JavaScriptCore 0x0000000228f44524 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 104 (condition_variable:204)
4 JavaScriptCore 0x0000000228f48300 bmalloc::Scavenger::threadRunLoop() + 172 (condition_variable:213)
5 JavaScriptCore 0x0000000228f47ac4 bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger*) + 12 (Scavenger.cpp:352)
6 JavaScriptCore 0x0000000228f494b8 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::Scavenger*), bmalloc::Scavenger*> >(void*) + 44 (type_traits:4428)
7 libsystem_pthread.dylib 0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
8 libsystem_pthread.dylib 0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
9 libsystem_pthread.dylib 0x0000000220f92070 thread_start + 4
Thread 5 name:
Thread 5:
0 libsystem_kernel.dylib 0x0000000220efb088 kevent + 8
1 Realm 0x00000001025f112c realm::_impl::ExternalCommitHelper::listen() + 212 (external_commit_helper.cpp:202)
2 Realm 0x00000001025f1d20 std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0>::operator()() + 28 (external_commit_helper.cpp:159)
3 Realm 0x00000001025f1ca8 std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >::__execute() + 28 (future:1039)
4 Realm 0x00000001025f1e58 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >::*)(), std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >*> >(void*, void*) + 64 (type_traits:4232)
5 libsystem_pthread.dylib 0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
6 libsystem_pthread.dylib 0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
7 libsystem_pthread.dylib 0x0000000220f92070 thread_start + 4
Thread 6 name:
Thread 6:
0 libsystem_kernel.dylib 0x0000000220ef6ac8 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000220ef6940 mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000022131d2f0 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3 CoreFoundation 0x000000022131af80 __CFRunLoopRun + 1404 (CFRunLoop.c:2971)
4 CoreFoundation 0x0000000221254abc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5 AVFAudio 0x0000000227a31cd0 GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:92)
6 AVFAudio 0x0000000227a5ce94 CAPThread::Entry(CAPThread*) + 88
7 libsystem_pthread.dylib 0x0000000220f931e4 _pthread_body + 128 (pthread.c:804)
8 libsystem_pthread.dylib 0x0000000220f93164 _pthread_start + 40 (pthread.c:827)
9 libsystem_pthread.dylib 0x0000000220f92070 thread_start + 4
Thread 7:
0 libsystem_pthread.dylib 0x0000000220f92064 start_wqthread + 0
Thread 8:
0 libsystem_pthread.dylib 0x0000000220f92064 start_wqthread + 0
Thread 9:
0 libsystem_pthread.dylib 0x0000000220f92064 start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000282a1a766
x4: 0x0000000103938280 x5: 0x0000000000000020 x6: 0x0046000004210103 x7: 0x00000000ffba0038
x8: 0x0000000000000800 x9: 0x0000000220f98b44 x10: 0x0000000220f9408c x11: 0x000000025b529562
x12: 0x000000025b529562 x13: 0x0000000000000018 x14: 0x0000000000000001 x15: 0x0000000000000881
x16: 0x0000000000000148 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x0000000259099100 x21: 0x000000000000002d x22: 0x0000000000000303 x23: 0x00000002590991e0
x24: 0x0000000000000000 x25: 0x000000024d2a3912 x26: 0x0000000102eec200 x27: 0x000000025909cf10
x28: 0x0000000000000001 fp: 0x000000016ddd9960 lr: 0x0000000220f98c70
sp: 0x000000016ddd9930 pc: 0x0000000220f186a4 cpsr: 0x00000000
FYI Line 17 of MyFile.swift is just this:
#objc class RealmDatabase : NSObject
{
var configuration:Realm.Configuration? = nil // Line 17
Thats just a declaration of an optional, so I don't see how that could cause any problems.
Are there any other clues as to what the problem could be?
Just a wild stab in the dark:
One reason that this error can happen is due to ARC and weak references.
A common pattern in iOS is the delegate pattern, where a separate object is constructed to handle the messages of another object. These references are often weak, so that you don't get a memory cycle, where two objects own a strong reference to each other.
Now, it could be, somewhere in your code, that you are generating a RealmDatabase instance somewhere, and handing it off to another object as a weak reference. If this is the case, then it will be destroyed by ARC as soon as all the strong references to it are gone: for example, if it is being referenced by a Realm connection instance of some sort, and the connection is dropped.
This is just a wild guess, but if you are dynamically creating RealmDatabase instances when certain events happen, store references to those objects in a stored property on some object, as an optional, to keep them from being destroyed by ARC.
Good luck, and I hope you solve this for your users.

iOS In App Purchase crashed only in App review - works find in sandbox testing

I have a new app which has been rejected twice with the same crash logs. They say it crashes when they tap the Buy button for in app purchase and gave me the crash file. I have symbolicated it and it hasn't been much helpful to me, can someone else take a look and point out if something's wrong?
The IAP has been tested successfully in sandbox with 2 sandbox users. I have also made sure my IAP has been actually "Cleared for sale" from my side and also "Submitted for review". My bank account info is up to date too and contracts are approved.
Here's the symbolicated logs:
{"app_name":"APPNAME","timestamp":"2017-12-18 08:48:19.56 -0800","app_version":"1.0","slice_uuid":"915a18a0-7c26-3ffd-af45-102cc6d53e21","adam_id":1326580740,"build_version":"2","bundleID":"com.MYCOMPANY.APPNAME","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.2.1 (15C153)","incident_id":"43C16882-BFF8-4C5E-80D7-01AEEE78F017","name":"APPNAME"}
Incident Identifier: 43C16882-BFF8-4C5E-80D7-01AEEE78F017
CrashReporter Key: 6079b68e9b231d52a24bc0ce1c55aa975b16774c
Hardware Model: xxx
Process: APPNAME [1217]
Path: /private/var/containers/Bundle/Application/81E108AB-4E43-4034-9A37-6C83929E75D4/APPNAME.app/APPNAME
Identifier: com.MYCOMPANY.APPNAME
Version: 2 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.MYCOMPANY.APPNAME [832]
Date/Time: 2017-12-18 08:48:19.4110 -0800
Launch Time: 2017-12-18 08:43:02.9432 -0800
OS Version: iPhone OS 11.2.1 (15C153)
Baseband Version: 6.30.04
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x18411e364 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x183364528 objc_exception_throw + 55
2 CoreFoundation 0x18411e2ac +[NSException raise:format:] + 115
3 StoreKit 0x19758aa98 -[SKPaymentQueue addPayment:] + 539
4 APPNAME 0x1007a362c 0x100798000 + 46636
5 UIKit 0x18d6346b4 -[UIApplication sendAction:to:from:forEvent:] + 95
6 UIKit 0x18d634634 -[UIControl sendAction:to:forEvent:] + 79
7 UIKit 0x18d61f1dc -[UIControl _sendActionsForEvents:withEvent:] + 439
8 UIKit 0x18d633f28 -[UIControl touchesEnded:withEvent:] + 575
9 UIKit 0x18d633a48 -[UIWindow _sendTouchesForEvent:] + 2543
10 UIKit 0x18d62ef60 -[UIWindow sendEvent:] + 3207
11 UIKit 0x18d5fff64 -[UIApplication sendEvent:] + 339
12 UIKit 0x18df5531c __dispatchPreprocessedEventFromEventQueue + 2363
13 UIKit 0x18df578a8 __handleEventQueueInternal + 4759
14 UIKit 0x18df507c0 __handleHIDEventFetcherDrain + 151
15 CoreFoundation 0x1840c697c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
16 CoreFoundation 0x1840c68fc __CFRunLoopDoSource0 + 87
17 CoreFoundation 0x1840c6184 __CFRunLoopDoSources0 + 203
18 CoreFoundation 0x1840c3d5c __CFRunLoopRun + 1047
19 CoreFoundation 0x183fe3e58 CFRunLoopRunSpecific + 435
20 GraphicsServices 0x185e90f84 GSEventRunModal + 99
21 UIKit 0x18d66367c UIApplicationMain + 235
22 APPNAME 0x1007aab60 0x100798000 + 76640
23 libdyld.dylib 0x183b0056c start + 3
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000183c302e8 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000183d452f8 pthread_kill$VARIANT$mp + 396
2 libsystem_c.dylib 0x0000000183b9efbc abort + 140
3 libc++abi.dylib 0x000000018333b068 __cxa_bad_cast + 0
4 libc++abi.dylib 0x000000018333b210 default_unexpected_handler+ 8720 () + 0
5 libobjc.A.dylib 0x0000000183364810 _objc_terminate+ 34832 () + 124
6 libc++abi.dylib 0x000000018335354c std::__terminate(void (*)+ 107852 ()) + 16
7 libc++abi.dylib 0x0000000183353158 __cxa_rethrow + 144
8 libobjc.A.dylib 0x00000001833646e8 objc_exception_rethrow + 44
9 CoreFoundation 0x0000000183fe3ec4 CFRunLoopRunSpecific + 544
10 GraphicsServices 0x0000000185e90f84 GSEventRunModal + 100
11 UIKit 0x000000018d66367c UIApplicationMain + 236
12 APPNAME 0x00000001007aab60 0x100798000 + 76640
13 libdyld.dylib 0x0000000183b0056c start + 4
Thread 1 name: com.apple.uikit.eventfetch-thread
Thread 1:
0 libsystem_kernel.dylib 0x0000000183c0f568 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000183c0f3e0 mach_msg + 72
2 CoreFoundation 0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x00000001840c3ed4 __CFRunLoopRun + 1424
4 CoreFoundation 0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5 Foundation 0x0000000184a19594 -[NSRunLoop+ 50580 (NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x0000000184a389ac -[NSRunLoop+ 178604 (NSRunLoop) runUntilDate:] + 96
7 UIKit 0x000000018e1cd7b8 -[UIEventFetcher threadMain] + 136
8 Foundation 0x0000000184b1b0f4 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x0000000183d442b4 _pthread_body + 308
10 libsystem_pthread.dylib 0x0000000183d44180 _pthread_body + 0
11 libsystem_pthread.dylib 0x0000000183d42b74 thread_start + 4
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x0000000183c0f568 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000183c0f3e0 mach_msg + 72
2 CoreFoundation 0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x00000001840c3ed4 __CFRunLoopRun + 1424
4 CoreFoundation 0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5 CFNetwork 0x00000001848d3128 -[__CoreSchedulingSetRunnable runForever] + 780
6 Foundation 0x0000000184b1b0f4 __NSThread__start__ + 996
7 libsystem_pthread.dylib 0x0000000183d442b4 _pthread_body + 308
8 libsystem_pthread.dylib 0x0000000183d44180 _pthread_body + 0
9 libsystem_pthread.dylib 0x0000000183d42b74 thread_start + 4
Thread 3:
0 libsystem_pthread.dylib 0x0000000183d42b68 start_wqthread + 0
Thread 4:
0 libsystem_pthread.dylib 0x0000000183d42b68 start_wqthread + 0
Thread 5:
0 libsystem_pthread.dylib 0x0000000183d42b68 start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x00000001c40f9937
x4: 0x0000000183358afd x5: 0x000000016f6674d0 x6: 0x000000000000006e x7: 0xffffffffffffffec
x8: 0x0000000008000000 x9: 0x0000000004000000 x10: 0x0000000183d495e0 x11: 0x0000000000000003
x12: 0xffffffffffffffff x13: 0x0000000000000001 x14: 0x0000000183bb553f x15: 0x0000000000000010
x16: 0x0000000000000148 x17: 0x00000000ffffffff x18: 0xfffffff00e09925c x19: 0x0000000000000006
x20: 0x00000001b4e6fb80 x21: 0x000000016f6674d0 x22: 0x0000000000000303 x23: 0x00000001b4e6fc60
x24: 0x00000001c0005270 x25: 0x0000000000000000 x26: 0x0000000000000001 x27: 0x0000000000000000
x28: 0x000000016f667b30 fp: 0x000000016f667430 lr: 0x0000000183d452f8
sp: 0x000000016f667400 pc: 0x0000000183c302e8 cpsr: 0x00000000
I resolved this.
In Xcode > Target > Capabilities > Make sure to switch on In app purchases here. If you don't, then while testing with Sandbox, the in app purchase will work just fine. However when app review will test OR when app is live, tapping the Buy button will cause the app to crash because for some reason, the product won't load. The crash log won't be much useful as it will just show StoreKit crash but won't mention anything about capability. Enabling the IAP in capabilities is needed for the IAP to work in live apps. I have no idea why this inconsistency exists between Sandbox testing and App review/Live app.
Also in the code, only do addPayment if the Product is not nil. Since my capability wasn't set on, the product wasn't loading. So when I was calling addPayment, it crashed with:
[SKPaymentQueue addPayment:]
Also in iTunes connect, in banking info, make sure the "Account holder type" field is set. Not sure if this is a new field but mind wasn't set and I have been successfully submitting IAP for 5 years. Only this time, it said the holder type wasn't set.
Now the app review team hasn't reported IAP crash.

iOS crash reports: how to find more informations

Bellow there is a crash report provided by Apple:
{"bundleID":"RomaniaMilitary.RomaniaMilitary","app_name":"RomaniaMilitary","bug_type":"109","name":"RomaniaMilitary","os_version":"iPhone OS 7.1.1 (11D201)","version":"1.0 (1.0)"}
Incident Identifier: 1A9B2804-2C07-4E6B-9377-D396F56704CC
CrashReporter Key: 99f9caadfd48c4739585b7383898f343220c933c
Hardware Model: xxx
Process: RomaniaMilitary [457]
Path: /var/mobile/Applications/A07BCAC9-34FA-459D-9231-C21476488D31/RomaniaMilitary.app/RomaniaMilitary
Identifier: RomaniaMilitary.RomaniaMilitary
Version: 1.0 (1.0)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2014-05-15 10:20:18.368 -0700
OS Version: iOS 7.1.1 (11D201)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
(0x18ab26f50 0x1975041fc 0x18ab2bc04 0x18ab29930 0x18aa495dc 0x100074360 0x18dc38904 0x18dbd6e64 0x18dbd662c 0x18daeaff8 0x18d6dc258 0x18d6d6e20 0x18d6d6cd8 0x18d6d6560 0x18d6d6304 0x18d6cfc38 0x18aae76a8 0x18aae4930 0x18aae4cbc 0x18aa25c20 0x1906c5c0c 0x18db56fdc 0x100074e30 0x197af7aa0)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000197bf258c __pthread_kill + 8
1 libsystem_c.dylib 0x0000000197b86804 abort + 108
2 libc++abi.dylib 0x0000000196dac990 abort_message + 84
3 libc++abi.dylib 0x0000000196dc9c28 default_terminate_handler() + 296
4 libobjc.A.dylib 0x00000001975044d0 _objc_terminate() + 124
5 libc++abi.dylib 0x0000000196dc7164 std::__terminate(void (*)()) + 12
6 libc++abi.dylib 0x0000000196dc6a7c __cxa_throw + 132
7 libobjc.A.dylib 0x0000000197504314 objc_exception_throw + 340
8 CoreFoundation 0x000000018ab2bc00 -[NSObject(NSObject) doesNotRecognizeSelector:] + 216
9 CoreFoundation 0x000000018ab2992c ___forwarding___ + 908
10 CoreFoundation 0x000000018aa495d8 _CF_forwarding_prep_0 + 88
11 RomaniaMilitary 0x000000010007435c 0x100068000 + 50012
12 UIKit 0x000000018dc38900 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 404
13 UIKit 0x000000018dbd6e60 -[UITableView _updateVisibleCellsNow:] + 1928
14 UIKit 0x000000018dbd6628 -[UITableView layoutSubviews] + 164
15 UIKit 0x000000018daeaff4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 344
16 QuartzCore 0x000000018d6dc254 -[CALayer layoutSublayers] + 180
17 QuartzCore 0x000000018d6d6e1c CA::Layer::layout_if_needed(CA::Transaction*) + 296
18 QuartzCore 0x000000018d6d6cd4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
19 QuartzCore 0x000000018d6d655c CA::Context::commit_transaction(CA::Transaction*) + 276
20 QuartzCore 0x000000018d6d6300 CA::Transaction::commit() + 420
21 QuartzCore 0x000000018d6cfc34 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 76
22 CoreFoundation 0x000000018aae76a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
23 CoreFoundation 0x000000018aae492c __CFRunLoopDoObservers + 368
24 CoreFoundation 0x000000018aae4cb8 __CFRunLoopRun + 760
25 CoreFoundation 0x000000018aa25c1c CFRunLoopRunSpecific + 448
26 GraphicsServices 0x00000001906c5c08 GSEventRunModal + 164
27 UIKit 0x000000018db56fd8 UIApplicationMain + 1152
28 RomaniaMilitary 0x0000000100074e2c 0x100068000 + 52780
29 libdyld.dylib 0x0000000197af7a9c start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000197bd9aa8 kevent64 + 8
1 libdispatch.dylib 0x0000000197add998 _dispatch_mgr_thread + 48
Thread 2:
0 libsystem_kernel.dylib 0x0000000197bf2e74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197c71548 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x0000000197bf2e74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197c71548 start_wqthread + 0
Thread 4 name: AFNetworking
Thread 4:
0 libsystem_kernel.dylib 0x0000000197bd9ca0 mach_msg_trap + 8
1 CoreFoundation 0x000000018aae6b70 __CFRunLoopServiceMachPort + 180
2 CoreFoundation 0x000000018aae4d00 __CFRunLoopRun + 832
3 CoreFoundation 0x000000018aa25c1c CFRunLoopRunSpecific + 448
4 Foundation 0x000000018b5c12c0 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 292
5 Foundation 0x000000018b61ed74 -[NSRunLoop(NSRunLoop) run] + 92
6 RomaniaMilitary 0x000000010008332c 0x100068000 + 111404
7 Foundation 0x000000018b6a8408 __NSThread__main__ + 996
8 libsystem_pthread.dylib 0x0000000197c73e18 _pthread_body + 164
9 libsystem_pthread.dylib 0x0000000197c73d70 _pthread_start + 136
10 libsystem_pthread.dylib 0x0000000197c71550 thread_start + 0
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x0000000197bd9ca0 mach_msg_trap + 8
1 CoreFoundation 0x000000018aae6b70 __CFRunLoopServiceMachPort + 180
2 CoreFoundation 0x000000018aae4d00 __CFRunLoopRun + 832
3 CoreFoundation 0x000000018aa25c1c CFRunLoopRunSpecific + 448
4 Foundation 0x000000018b61a424 +[NSURLConnection(Loader) _resourceLoadLoop:] + 344
5 Foundation 0x000000018b6a8408 __NSThread__main__ + 996
6 libsystem_pthread.dylib 0x0000000197c73e18 _pthread_body + 164
7 libsystem_pthread.dylib 0x0000000197c73d70 _pthread_start + 136
8 libsystem_pthread.dylib 0x0000000197c71550 thread_start + 0
Thread 6:
0 libsystem_kernel.dylib 0x0000000197bf2e74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197c71548 start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x0000000197bf2e74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197c71548 start_wqthread + 0
Thread 8:
0 libsystem_kernel.dylib 0x0000000197bf2e74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197c71548 start_wqthread + 0
Thread 9 name: com.apple.CFSocket.private
Thread 9:
0 libsystem_kernel.dylib 0x0000000197bf276c __select + 8
1 libsystem_pthread.dylib 0x0000000197c73e18 _pthread_body + 164
2 libsystem_pthread.dylib 0x0000000197c73d70 _pthread_start + 136
3 libsystem_pthread.dylib 0x0000000197c71550 thread_start + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x000000016fd93ee8
x4: 0x0000000000002060 x5: 0x000000016fd93fa0 x6: 0x000000000000006e x7: 0x0000000000000a20
x8: 0x0000000008000000 x9: 0x0000000004000000 x10: 0x000000009aa3f6f7 x11: 0x0000000000000300
x12: 0x0000000000000000 x13: 0x0000000000000000 x14: 0x0000000000000000 x15: 0x0000000197b9fdcb
x16: 0x0000000000000148 x17: 0x005bf73d22a9626a x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x000000019aa522a0 x21: 0x0000000170126318 x22: 0x0000000170126340 x23: 0x00000001987304f0
x24: 0x0000000000000000 x25: 0x000000018e1e51ea x26: 0x000000014fd354f0 x27: 0x00000001702a12c0
x28: 0x00000001700388a0 fp: 0x000000016fd93f20 lr: 0x0000000197c7516c
sp: 0x000000016fd93f00 pc: 0x0000000197bf258c cpsr: 0x00000000
Update :
Apple message:
We found your app crashed on launch so we were unable to review it. Please revise your app and test it on a device to ensure it will launch without crashing, and that it runs as expected, before resubmitting.
I posted full report (without binary image)
You submitted an application without symbols, so Apple couldn't tell you where in your application the fault is. The last bit of your code that is called gets called from
[UITableView _createPreparedCellForGlobalRow:withIndexPath:]
so it will happen in some delegate method of yours where you are preparing a cell, and you are sending a message to some object that doesn't understand it. There's probably more information in their report which you should post. Knowing which method was sent to which kind of object would be very helpful.
Meanwhile, turn on all warnings in your compiler that you can reasonably turn on and fix the problems, then run the static analyser and fix all problems that it finds, then let someone else test your application on a real device, in case you subconsciously avoid problem areas.
Here's what you need to do:
1) You need your archived application, the one you submitted. If not, then disregard the rest of the steps; it's game over.
2) The archive file is a bundle. You must show its contents.
3) Inside you will find a folder marked 'dSYMs.' Inside it you will find a file named <your app name>.app.dSYM. Select it and copy (using Copy/Command-C).
4) Go back one level. Inside the Products/Applications folder you will find your application. It's a bundle as well. You must show its contents.
5) Inside you will find your application's executable file. Now paste the dSYM file you had previously copied here.
6) Fire up your Terminal. cd to the Products/Applications folder in which you just pasted the dSYM file.
7) Now go back to that 'cryptic' report that Apple sent you. I see that you've included more information from the report, but there ought to be a section that shows all the processes that were running on your device at the time, and at the top should be your application. There are two large hexadecimal numbers there. Make a note of the first one. Then go to line 11 in your stack trace. Make a note of that long hexadecimal (0x000000010007435c). You'll need both of these numbers for the next step.
8) On your Terminal's command line enter
atos -o <your application name, including the extension> -l <first hex number> <second hex number>
9) atos should show you something like this:
-[classname method] (in <your app name>) (<file name where your object is located>:<line number>)
Now you'll have the clue you need to go after your problem.
Good luck to you in your endeavors.

Resources