I wanted to have a backtrace with the classes and method names displayed every time the app crashes. I managed to do it in debug mode, using this code (the printTrace function just prints the string on a file.):
void HandleException(NSException *exception)
{
[SILogManager printTrace:[NSString stringWithFormat:#"******************** CRASH *********************"]];
[SILogManager printTrace:[NSString stringWithFormat:#"-> Stack Trace: %#", [exception callStackSymbols]]];
}
Although this won't work when the app is released, because it will produce a stacktrace like this one:
******************** CRASH *********************
-> Stack Trace: (
0 CoreFoundation 0x27b5f60f <redacted> + 150
1 libobjc.A.dylib 0x35613c77 objc_exception_throw + 38
2 CoreFoundation 0x27a733a7 <redacted> + 178
3 iSelz POS 0x000bf6c7 iSelz POS + 403143
4 iSelz POS 0x000bf099 iSelz POS + 401561
5 iSelz POS 0x000dda31 iSelz POS + 526897
6 CFNetwork 0x276b7eed <redacted> + 56
7 CFNetwork 0x276b7ea7 <redacted> + 182
8 CFNetwork 0x276b7f99 <redacted> + 36
9 CFNetwork 0x275cceef <redacted> + 78
10 CFNetwork 0x2766976d <redacted> + 60
11 CFNetwork 0x275bdd71 <redacted> + 60
12 CoreFoundation 0x27a705a1 CFArrayApplyFunction + 36
13 CFNetwork 0x275bdc2b <redacted> + 182
14 CFNetwork 0x275bdaf1 <redacted> + 216
15 CFNetwork 0x275bd98d <redacted> + 48
16 CoreFoundation 0x27b25fd7 <redacted> + 14
17 CoreFoundation 0x27b253eb <redacted> + 222
18 CoreFoundation 0x27b23a69 <redacted> + 768
19 CoreFoundation 0x27a70b31 CFRunLoopRunSpecific + 476
20 CoreFoundation 0x27a70943 CFRunLoopRunInMode + 106
21 GraphicsServices 0x2edf8051 GSEventRunModal + 136
22 UIKit 0x2b0666f1 UIApplicationMain + 1440
23 iSelz POS 0x00066aab iSelz POS + 39595
24 libdyld.dylib 0x35bafaaf <redacted> + 2
)
And I don't find it very useful.
I've also already tried to call backtrace and backtrace_symbols manually, but it doesn't work!
In the project properties, I have the following settings, that should copy all the dynamic symbols when building, so I still can't figure out why it isn't working!
What can I do to have this feature also in the released app? What am I doing wrong?
Thank you in advance!
Related
I was trying to redo my LaunchScreen.storyboard so I deleted it and created a new LaunchScreen via File(in the toolbar) > New > New File > Launch Screen and then I started getting this problem. I've already checked my IBOutlet connections. I deleted the new LaunchScreen.storyboard in hopes of solving it but it still can't transition to my GameScene. I use SpriteKit and UICollectionView for my game.
Debug Navigator Screenshot
AppDelegate SIGABRT Screenshot
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) e Thread.callStackSymbols.forEach{print($0)}
0 ??? 0x00000001062343cc 0x0 + 4397941708
1 Billionaire City 0x00000001006e23b8 main + 0
2 libsystem_c.dylib 0x00000001c28f7ea8 abort + 140
3 libc++abi.dylib 0x00000001c1fc4788 __cxa_bad_cast + 0
4 libc++abi.dylib 0x00000001c1fc4934 <redacted> + 0
5 libobjc.A.dylib 0x00000001c1fdbe00 <redacted> + 124
6 libc++abi.dylib 0x00000001c1fd0838 <redacted> + 16
7 libc++abi.dylib 0x00000001c1fd01a8 __cxa_get_exception_ptr + 0
8 libc++abi.dylib 0x00000001c1fd0168 <redacted> + 0
9 libobjc.A.dylib 0x00000001c1fdbb3c <redacted> + 0
10 CoreFoundation 0x00000001c2d1d278 <redacted> + 0
11 CoreFoundation 0x00000001c2e05d60 <redacted> + 1408
12 CoreFoundation 0x00000001c2e079fc _CF_forwarding_prep_0 + 92
13 CoreText 0x00000001c6a178d0 <redacted> + 92
14 UIFoundation 0x00000001cd3edf78 <redacted> + 120
15 CoreText 0x00000001c6a1707c <redacted> + 84
16 CoreText 0x00000001c6a169d0 <redacted> + 92
17 CoreText 0x00000001c6a16834 <redacted> + 104
18 CoreText 0x00000001c69c660c <redacted> + 216
19 CoreText 0x00000001c69c651c <redacted> + 160
20 CoreText 0x00000001c69c1da4 CTTypesetterCreateWithAttributedString + 60
21 SpriteKit 0x00000001d98f1c04 _ZN12SKCLabelNode11rebuildTextEv + 1064
22 libdispatch.dylib 0x00000001019f8c74 _dispatch_client_callout + 16
23 libdispatch.dylib 0x0000000101a07480 _dispatch_lane_barrier_sync_invoke_and_complete + 124
24 SpriteKit 0x00000001d98f1230 _ZN12SKCLabelNode21addRenderableChildrenEP13SKCRenderInfoPNSt3__16vectorIP7SKCNodeNS2_9allocatorIS5_EEEE + 92
25 SpriteKit 0x00000001d99aed90 _ZN11SKCRenderer18doBuildRenderGroupEP7SKCNode14SKCRenderState13simd_float4x4 + 372
26 SpriteKit 0x00000001d99aefb8 _ZN11SKCRenderer18doBuildRenderGroupEP7SKCNode14SKCRenderState13simd_float4x4 + 924
27 SpriteKit 0x00000001d99aefb8 _ZN11SKCRenderer18doBuildRenderGroupEP7SKCNode14SKCRenderState13simd_float4x4 + 924
28 SpriteKit 0x00000001d99ae2fc _ZN11SKCRenderer16buildRenderGroupERKNSt3__110shared_ptrI18SKCRenderSortGroupEE + 940
29 SpriteKit 0x00000001d99ab608 _ZN11SKCRenderer15buildRenderPassERKNSt3__110shared_ptrI13SKCRenderPassEE + 96
30 SpriteKit 0x00000001d99aaea0 _ZN11SKCRenderer6renderEP7SKCNodeDv4_fRKNSt3__110shared_ptrI15jet_framebufferEEDv4_j13simd_float4x4bP12NSDictionaryP8SKCStatsSE_d + 1628
31 SpriteKit 0x00000001d9928c80 <redacted> + 664
32 SpriteKit 0x00000001d9928958 <redacted> + 252
33 SpriteKit 0x00000001d992cbec <redacted> + 184
34 UIKitCore 0x00000001ef7cbe54 <redacted> + 1292
35 QuartzCore 0x00000001c728e1f0 <redacted> + 184
36 QuartzCore 0x00000001c7293198 <redacted> + 332
37 QuartzCore 0x00000001c71f60a8 <redacted> + 348
38 QuartzCore 0x00000001c7224108 <redacted> + 640
39 UIKitCore 0x00000001ef35c534 <redacted> + 124
40 CoreFoundation 0x00000001c2d9210c <redacted> + 20
41 CoreFoundation 0x00000001c2d91a10 <redacted> + 272
42 CoreFoundation 0x00000001c2d8ca74 <redacted> + 1024
43 CoreFoundation 0x00000001c2d8c354 CFRunLoopRunSpecific + 436
44 GraphicsServices 0x00000001c4f8c79c GSEventRunModal + 104
45 UIKitCore 0x00000001ef343b68 UIApplicationMain + 212
46 Billionaire City 0x00000001006e2404 main + 76
47 libdyld.dylib 0x00000001c28528e0 <redacted> + 4
(lldb)
It is preferable for an application to run with a LaunchScreen.
In order to fix your problem, try adding a new LaunchScreen, then head to Project Settings - General and from the Launch Screen File drop down menu select your new LaunchScreen.
You can also run it without a LaunchScreen. Delete the LaunchScreen from project in Xcode and Finder, then head to Project Settings - General and from the Launch Screen File drop down menu select scene-name (Main).
I have the following crash report but I can't figure out the cause of this crash. This crash appears quite frequently but the pattern varies at each time. Many thanks!
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000198337270 __pthread_kill + 8
1 libsystem_c.dylib 0x00000001982aeb18 abort + 112
2 libsystem_malloc.dylib 0x00000001983723e4 <redacted> + 0
3 libsystem_malloc.dylib 0x00000001983712f8 <redacted> + 192
4 CoreFoundation 0x00000001866c55e8 <redacted> + 192
5 CoreFoundation 0x00000001865d1394 CFRelease + 328
6 CoreFoundation 0x00000001866bc2bc _CFStringCreateWithFormatAndArgumentsAux2 + 272
7 Foundation 0x0000000187502448 -[NSPlaceholderString initWithFormat:locale:arguments:] + 172
8 0x000000010020f088 _mh_execute_header + 1536136
9 0x0000000100225614 _mh_execute_header + 1627668
10 0x00000001001ac6d0 _mh_execute_header + 1132240
11 CFNetwork 0x00000001861745b8 <redacted> + 80
12 CFNetwork 0x0000000186174548 <redacted> + 208
13 CFNetwork 0x00000001861746c4 <redacted> + 60
14 CFNetwork 0x0000000186047990 <redacted> + 104
15 CFNetwork 0x000000018611150c <redacted> + 104
16 CFNetwork 0x0000000186033ac8 <redacted> + 76
17 CoreFoundation 0x00000001865d4cdc CFArrayApplyFunction + 68
18 CFNetwork 0x0000000186033974 <redacted> + 136
19 CFNetwork 0x0000000186033828 <redacted> + 312
20 CFNetwork 0x0000000186033654 <redacted> + 68
21 CoreFoundation 0x00000001866ac240 <redacted> + 24
22 CoreFoundation 0x00000001866ab4e4 <redacted> + 264
23 CoreFoundation 0x00000001866a9594 <redacted> + 712
24 CoreFoundation 0x00000001865d52d4 CFRunLoopRunSpecific + 396
25 GraphicsServices 0x000000018fc9b6fc GSEventRunModal + 168
26 UIKit 0x000000018b19afac UIApplicationMain + 1488
27 0x000000010024bf1c _mh_execute_header + 1785628
28 libdyld.dylib 0x000000019821ea08 <redacted> + 4
I am assuming that you download some information from the web and are trying to create a string with some parts of that information:
6 CoreFoundation 0x00000001866bc2bc _CFStringCreateWithFormatAndArgumentsAux2 + 272
7 Foundation 0x0000000187502448 -[NSPlaceholderString initWithFormat:locale:arguments:] + 172
Where ever you are using information that you fetched from the Internet, you should first check if that information is valid and respects the right format you expect. Therefore, I recommend you to validate the information before using it.
this might help you:
iPhone app crash at [NSString stringWithFormat]
the error line must be:
[NSString stringWithFormat:#"%#,%#...",a,b...];
I have a stack trace from Flurry that is from a crash that is happening a couple times on my app and I dont understand what is going wrong. Any suggestions or hints how I can make sense of this?
0 CoreFoundation 0x184bc2084 <redacted> + 132
1 libobjc.A.dylib 0x1951a00e4 _objc_exception_throw + 60
2 CoreFoundation 0x184ab6ff8 <redacted> + 0
3 My App 0x100015ef4 __mh_execute_header + 73460
4 My App 0x10000c61c __mh_execute_header + 34332
5 My App 0x10000b024 __mh_execute_header + 28708
6 CFNetwork 0x1846624cc <redacted> + 80
7 CFNetwork 0x18466245c <redacted> + 208
8 CFNetwork 0x1846625d8 <redacted> + 60
9 CFNetwork 0x184537684 <redacted> + 104
10 CFNetwork 0x1845ffcb8 <redacted> + 104
11 CFNetwork 0x1845239cc <redacted> + 76
12 CoreFoundation 0x184aa506c _CFArrayApplyFunction + 68
13 CFNetwork 0x184523878 <redacted> + 136
14 CFNetwork 0x18452372c <redacted> + 312
15 CFNetwork 0x184523558 <redacted> + 68
16 CoreFoundation 0x184b7a324 <redacted> + 24
17 CoreFoundation 0x184b795c8 <redacted> + 264
18 CoreFoundation 0x184b77678 <redacted> + 712
19 CoreFoundation 0x184aa5664 _CFRunLoopRunSpecific + 396
20 GraphicsServices 0x18dbe75a4 _GSEventRunModal + 168
21 UIKit 0x1893aa4f8 _UIApplicationMain + 1488
22 My App 0x10000c8f0 __mh_execute_header + 35056
23 libdyld.dylib 0x19580ea08 <redacted> + 4
This is the crash report i am getting. App store guys said while clicking on any functionality crashes the app but this is not the case, in debug mode everything is working fine.
Full Stack Trace:
0 libobjc.A.dylib 0x196f9c0b8 _objc_retain + 24
1 KitchenFast 0x1000e26f0 __mh_execute_header + 452336
2 CoreFoundation 0x18a55b5b4 <redacted> + 20
3 CoreFoundation 0x18a4a8104 __CFXNotificationPost + 2064
4 Foundation 0x18b03a748 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
5 KitchenFast 0x1000e1608 __mh_execute_header + 448008
6 Foundation 0x18b1285cc <redacted> + 328
7 CoreFoundation 0x18a567644 <redacted> + 24
8 CoreFoundation 0x18a5669a0 <redacted> + 256
9 CoreFoundation 0x18a564c38 <redacted> + 632
10 CoreFoundation 0x18a4a5c20 _CFRunLoopRunSpecific + 452
11 GraphicsServices 0x190145c0c _GSEventRunModal + 168
12 UIKit 0x18d5d6fdc _UIApplicationMain + 1156
13 KitchenFast 0x10007d700 __mh_execute_header + 38656
14 libdyld.dylib 0x197577aa0 <redacted> + 4
While running my ios app a user has encountered the following error. It has only happened once and I cannot figure out how to repeat the error. Could someone please interpret the following stacktrace to help me find the cause of the error.
Signal
Unknown Signal
Stacktrace (9)
0 LeadsBoard 0x0001b5f2 testflight_backtrace + 142
1 LeadsBoard 0x0001c180 TFSignalHandler + 212
2 libsystem_c.dylib 0x3419d72e _sigtramp + 42
3 libsystem_c.dylib 0x341923ba pthread_kill + 58
4 libsystem_c.dylib 0x3418abfe abort + 78
5 libsystem_c.dylib 0x3419e828 szone_error + 216
6 libsystem_c.dylib 0x341a4f0e szone_realloc + 66
7 libsystem_c.dylib 0x341c60e6 malloc_zone_realloc + 62
8 Foundation 0x3486bcf4 NSZoneRealloc + 32
9 Foundation 0x3486bb40 _NSMutableDataGrowBytes + 336
10 Foundation 0x3486b96c -[NSConcreteMutableData appendData:] + 80
11 LeadsBoard 0x0000fd90 -[DataModelPeopleClass connection:didReceiveData:] (DataModelPeopleClass.m:152)
12 Foundation 0x3486b8f6 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidReceiveData:originalLength:] + 150
13 Foundation 0x3486b822 _NSURLConnectionDidReceiveData + 90
14 CFNetwork 0x35a7406c _ZN19URLConnectionClient21_clientDidReceiveDataEPK8__CFDataPNS_26ClientConnectionEventQueueE + 172
15 CFNetwork 0x35a68fb4 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 212
16 CFNetwork 0x35a68e36 _ZN19URLConnectionClient13processEventsEv + 70
17 CFNetwork 0x35a68de8 _ZN13URLConnection24multiplexerClientPerformEP18RunLoopMultiplexer + 36
18 CFNetwork 0x35a68d5a _ZN17MultiplexerSource7performEv + 126
19 CFNetwork 0x35a68cd8 _ZN17MultiplexerSource8_performEPv + 8
20 CoreFoundation 0x36487a78 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
21 CoreFoundation 0x3648975e __CFRunLoopDoSources0 + 382
22 CoreFoundation 0x3648a4ea __CFRunLoopRun + 230
23 CoreFoundation 0x3641aec2 CFRunLoopRunSpecific + 230
24 CoreFoundation 0x3641adca CFRunLoopRunInMode + 58
25 GraphicsServices 0x35bd441e GSEventRunModal + 114
26 GraphicsServices 0x35bd44ca GSEventRun + 62
27 UIKit 0x352c4d68 -[UIApplication _run] + 404
28 UIKit 0x352c2806 UIApplicationMain + 670
29 LeadsBoard 0x000020fc main (main.m:14)
30 LeadsBoard 0x000020c7 start + 39
Environment
Device Name: iPhone
Model: iPhone 4
Version: 4.3.5
Language: en_AU (English)
Carrier: Virgin Mobile
Timezone: AEST
Architecture: armv7
Connection State: Wifi
Check your NSURLConnection delegates, specifically in DataModelPeopleClass.