iOS Mystery crash w libsystem_kernel.dylib - ios

The report I'm getting back from Crashlytics is
Crashed: com.apple.main-thread
SIGABRT ABORT at 0x357fedf0
How do I narrow this mystery crash down?
Also, here's some additional info from Crashlytics
EDIT
Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x3b90f350 __pthread_kill + 8
1 libsystem_c.dylib 0x3b886123 pthread_kill + 58
2 libsystem_c.dylib 0x3b8c2973 abort + 94
3 libc++abi.dylib 0x3ae60d4f abort_message + 74
4 libc++abi.dylib 0x3ae5e0db safe_handler_caller(void (*)()) + 174
5 libc++abi.dylib 0x3ae5e114 std::terminate() + 19
6 libc++abi.dylib 0x3ae5f599 __cxa_current_exception_type
7 libobjc.A.dylib 0x3b4119d1 objc_exception_rethrow + 12
8 CoreFoundation 0x336d7f21 CFRunLoopRunSpecific + 456
9 CoreFoundation 0x336d7d49 CFRunLoopRunInMode + 104
10 GraphicsServices 0x3728a2eb GSEventRunModal + 74
11 UIKit 0x355ed301 UIApplicationMain + 1120
12 MyAppName 0x000f1e9f main (main.m:15)

as I see from the logs "pthread_kill" in the stack, I hope that this answer helps you.
Exception Type: EXC_CRASH (SIGABRT)

Related

What's [NSException initWithCoder:]?

In my crash log, I see [NSException initWithCoder:] at the top of the crashed stack trace. What's NSException initWithCoder? Why would NSException have this method? Note: I am not interested in knowing the cause of the crash, but why NSException's initWithCoder appears here and what it's doing.
Example crash logs:
Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 6874214720 __pthread_kill + 8
1 libsystem_pthread.dylib 6875041528 pthread_kill + 112
2 libsystem_c.dylib 6873639800 abort + 140
3 Dringend 4298949820 CLSTerminateHandler() + 4299310268
4 libc++abi.dylib 6854520644 std::__terminate(void (*)()) + 16
5 libc++abi.dylib 6854519568 __cxa_rethrow + 144
6 Dringend 4298949752 CLSTerminateHandler() + 4299310200
7 libc++abi.dylib 6854520644 std::__terminate(void (*)()) + 16
8 libc++abi.dylib 6854518876 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 134
9 libobjc.A.dylib 6864339092 _objc_exception_destructor(void*) + 330
10 CoreFoundation 6515019408 -[NSException initWithCoder:] + 118
11 CoreFoundation 6513992388 -[__NSCFString substringWithRange:] + 140
12 <…> 4298521360 -[ViewController <…>] (<…>:1633)

A very interesting crash log with Exception Type:"EXC_CRASH (SIGSEGV)"

  Firstly, the desymbolicated crash log is at the bottom. I cannot post all the content out of privacy reason. However the first 3 threads log is enough I thought, if you really want that please leave a message.
  And here is the thing, depending on this article Understanding iOS Exception Types | 5Neo.Be5Neo.Be, the mach exception type -- EXC_CRASH -- is not usual following with the C signal SIGSEGV (which means access an address you don't own).
  So I want to know what reason or when will EXC_CRASH (SIGSEGV) appear?
  Second question is if this crash is actually trigger by Thread 0 as the log said. And if it's ture, then what does
"__NSThreadPerformPerform"
and
"__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__"
means?
  What action is system doing? By the way, __NSThreadPerformPerform will appear when App call "performSelector:" method according to this answer -- iphone - SIGABRT crash on CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION - Stack Overflow.
Thanks.
-- Crash log is here: --
{"name":"XXXApp","bug_type":"109","os_version":"iPhone OS 7.1.1 (11D201)","bundleID":"com.xxx","version":"6.7.1.0 (6.7.1)","app_name":"XXXApp"}
Incident Identifier: EC2DC883-C0DB-4FD6-81FB-237626598366
CrashReporter Key: d5c091bc35732df06fcaf41e5786833159b04ea5
Hardware Model: iPhone5,2
Process: XXXApp [1912]
Path: /var/mobile/Applications/4E3E131C-5847-4B61-A0E0-D350830C1693/BaiduBoxApp.app/XXXApp
Identifier: com.xxx
Version: 6.7.1.0 (6.7.1)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2015-08-28 00:37:32.658 +0800
OS Version: iOS 7.1.1 (11D201)
Report Version: 104
Exception Type: EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x39c636d8 __kill + 8
1 Foundation 0x2f901c1e __NSThreadPerformPerform + 382
2 CoreFoundation 0x2eee3fec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
3 CoreFoundation 0x2eee34b2 __CFRunLoopDoSources0 + 202
4 CoreFoundation 0x2eee1ca2 __CFRunLoopRun + 626
5 CoreFoundation 0x2ee4c764 CFRunLoopRunSpecific + 520
6 CoreFoundation 0x2ee4c546 CFRunLoopRunInMode + 102
7 GraphicsServices 0x33db96ce GSEventRunModal + 134
8 UIKit 0x317ab88c UIApplicationMain + 1132
9 BaiduBoxApp 0x0006d13e main (main.m:17)
10 libdyld.dylib 0x39badab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x39c51804 kevent64 + 24
1 libdispatch.dylib 0x39ba0050 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x39b9a2de _dispatch_mgr_thread + 34
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x39c51a50 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39c51848 mach_msg + 36
2 CoreFoundation 0x2eee3624 __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2eee1d44 __CFRunLoopRun + 788
4 CoreFoundation 0x2ee4c764 CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2ee4c546 CFRunLoopRunInMode + 102
6 Foundation 0x2f88c23c +[NSURLConnection(Loader) _resourceLoadLoop:] + 316
7 Foundation 0x2f901a0a __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x39ccb956 _pthread_body + 138
9 libsystem_pthread.dylib 0x39ccb8c6 _pthread_start + 98
10 libsystem_pthread.dylib 0x39cc9ae4 thread_start + 4
Thread 3 name: com.apple.CFSocket.private
Thread 3:
0 libsystem_kernel.dylib 0x39c64434 __select + 20
1 CoreFoundation 0x2eee751e __CFSocketManager + 482
2 libsystem_pthread.dylib 0x39ccb956 _pthread_body + 138
3 libsystem_pthread.dylib 0x39ccb8c6 _pthread_start + 98
4 libsystem_pthread.dylib 0x39cc9ae4 thread_start + 4
...

EXC_BAD_ACCESS when allocating an NSMutableArray

This is a bit of a weird one.
In my code, I have this line:
NSMutableArray *unresolvedPlayers = [NSMutableArray arrayWithCapacity:3];
This seems like a perfectly valid line. I crashed on this line with this stack trace (I have replaced my app name with xxxxxxxxx):
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xc158f710
Triggered by Thread: 7
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x3870d648 syscall_thread_switch + 8
1 libsystem_platform.dylib 0x3879a79a _os_lock_handoff_lock_slow + 74
2 libsystem_malloc.dylib 0x38748ece szone_malloc_should_clear + 50
3 libsystem_malloc.dylib 0x3874c444 malloc_zone_calloc + 92
4 libsystem_malloc.dylib 0x3874c3d2 calloc + 46
5 libobjc.A.dylib 0x380c8414 class_createInstance + 36
6 CoreFoundation 0x2a5773d0 __CFAllocateObject2 + 8
7 CoreFoundation 0x2a48c86a +[__NSArrayM __new:::::] + 38
8 CoreFoundation 0x2a48fd7c -[__NSPlaceholderArray initWithCapacity:] + 100
9 CoreFoundation 0x2a497e88 +[NSMutableArray arrayWithCapacity:] + 36
10 xxxxxxxxxx 0x001730f4 -[HostManager setHost:timestamp:] (HostManager.m:703)
11 xxxxxxxxxx 0x0016ff10 -[HostManager initSessionFromInvitation:] (HostManager.m:46)
12 xxxxxxxxxx 0x000ea68e -[NetworkController updateWithMatch:] (NetworkController.m:894)
13 xxxxxxxxxx 0x000ea418 __72-[NetworkController invitePlayersToMatch:playerGroup:completionHandler:]_block_invoke544 (NetworkController.m:844)
14 GameCenterFoundation 0x31263936 __72-[GKMatchmaker invitePlayersWithRequest:serverHosted:completionHandler:]_block_invoke601 + 42
15 libdispatch.dylib 0x38620420 _dispatch_call_block_and_release + 8
16 libdispatch.dylib 0x3862040c _dispatch_client_callout + 20
17 libdispatch.dylib 0x3862b1b0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 708
18 CoreFoundation 0x2a53762c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4
19 CoreFoundation 0x2a535d4c __CFRunLoopRun + 1508
20 CoreFoundation 0x2a482b2c CFRunLoopRunSpecific + 472
21 CoreFoundation 0x2a48293e CFRunLoopRunInMode + 102
22 GraphicsServices 0x3183904c GSEventRunModal + 132
23 UIKit 0x2da786ec UIApplicationMain + 1436
24 xxxxxxxxxx 0x000503b2 main (main.m:16)
25 libdyld.dylib 0x3865baac start + 0
How is it possible that my memory has gotten corrupted up to this point that allocating a new NSMutableArray would cause this to happen? I'm not even sure where to start with debugging this one. I am not sure this is easily reproducible.
As a side note, it happened when inviting nearby players to a realtime GameCenter match.
EDIT: I just realized this is crashing on Thread 7. This is what Thread 7 looks like:
Thread 7 name: Dispatch queue: com.apple.root.default-qos
Thread 7 Crashed:
0 libobjc.A.dylib 0x380cbf66 objc_msgSend + 6
1 GameCenterFoundation 0x31285efc -[GKMatchmaker(Nearby) inviteAnyNearbyPlayersWithRequest:] + 960
2 GameCenterFoundation 0x312636a8 __72-[GKMatchmaker invitePlayersWithRequest:serverHosted:completionHandler:]_block_invoke + 256
3 GameCenterFoundation 0x3129ae92 __39-[GKDispatchGroup notifyOnQueue:block:]_block_invoke44 + 10
4 libdispatch.dylib 0x38620420 _dispatch_call_block_and_release + 8
5 libdispatch.dylib 0x3862c2d6 _dispatch_root_queue_drain + 846
6 libdispatch.dylib 0x3862d1f6 _dispatch_worker_thread3 + 102
7 libsystem_pthread.dylib 0x3879de22 _pthread_wqthread + 666
8 libsystem_pthread.dylib 0x3879db74 start_wqthread + 4
So, this is probably a bug with GameCenter.
Crash in objc_msgSend can indicate that message destination object is deallocated already. Try to enable zombie objects and keep your eyes on logs.

Application Rejected from appstore due to this crash log

My app got rejected by Apple App Store review team because it was crashed on iPad air running iOS 7.1.1, as soon as the app lunches, as they said. They've attached a crash report that I have no idea how to investigate and will appreciate if you can help:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
(0x3097decb 0x3b557ce7 0x308b7791 0x2040d 0x3135e117 0x30948f0f 0x30948b2b 0x30946eb3 0x308b1729 0x308b150b 0x357ea6d3 0x33212871 0x132f2f 0x3ba55ab7)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3bb0c1f0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x3bb747b3 pthread_kill + 55
2 libsystem_c.dylib 0x3babcff5 abort + 73
3 libc++abi.dylib 0x3af0b98b abort_message + 71
4 libc++abi.dylib 0x3af246e3 default_terminate_handler() + 251
5 libobjc.A.dylib 0x3b557f7b _objc_terminate() + 191
6 libc++abi.dylib 0x3af221b1 std::__terminate(void (*)()) + 77
7 libc++abi.dylib 0x3af21d13 __cxa_rethrow + 99
8 libobjc.A.dylib 0x3b557e2b objc_exception_rethrow + 39
9 CoreFoundation 0x308b179b CFRunLoopRunSpecific + 639
10 CoreFoundation 0x308b1507 CFRunLoopRunInMode + 103
11 GraphicsServices 0x357ea6cf GSEventRunModal + 135
12 UIKit 0x3321286d UIApplicationMain + 1133
13 SocialCheckin 0x00132f2b 0x7000 + 1228587
14 libdyld.dylib 0x3ba55ab5 start + 1
attention to the follows:
Exception Type: EXC_CRASH (SIGABRT)
It is not caused by your code. I think the system send some code like kill to your app.
Maybe the following reason:
Your app has not launched in five seconds.

[NSPlaceholderString initWithString:]: nil argument on jail break device

I tried with many search with the above title and also do as many advice of my search but cannot solved the problem. My app got crash when I build on the iPad which had jail break. But with the device not jail break it worked. Call the below function is the reason for crash:
-(void)btnLoginPressed:(id)sender {
[[MoboAccesstoken ActiveAccessToken] setMoboAccessTokenDelegate:self];
if (![[MoboAccesstoken ActiveAccessToken]isOpened]){
[MoboSDK openActiveSessionWithCompletion:^(NSDictionary *data) {
NSLog(#"data: %#", data);
}];
}
}
and the stack trace is:
2014-06-05 13:11:39.749 g1[1687:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
*** First throw call stack:
(0x355e988f 0x3320d259 0x355e9789 0x355e97ab 0x3499d4c9 0x71af33 0x71cb3f 0x71b893 0x71c8bf 0x1ae2f9 0x2c619f 0x4054ef 0x15dea3 0xca883 0xcf5ab 0x558dcd 0x6a73cd 0x2a5a9f 0x30399f 0x4ba2bb 0x4ba365 0x4ab929 0x4abd4b 0x4abd71 0x2c50fd 0x334c47 0x32d0392b 0x32d03319 0x32ce9695 0x32ce8f3b 0x332db22b 0x355bd523 0x355bd4c5 0x355bc313 0x3553f4a5 0x3553f36d 0x332da439 0x32d17cd5 0xa1167 0x99de8)
terminate called throwing an exception
The image of crash log:
Incident Identifier: 0F14065E-394E-43C4-8B6C-007CF55EDAEA
CrashReporter Key: 975f6d2f7ff682cc1bad50cfed0e860f0502f830
Hardware Model: iPad1,1
Process: TestMoboSDK-Client [294]
Path: /var/mobile/Applications/077E9D1E-0594-45F1-8A23-154B630B8FDB/TestMoboSDK-Client.app/TestMoboSDK-Client
Identifier: TestMoboSDK-Client
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-06-05 18:38:04.276 +0700
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x357d688f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x333fa259 objc_exception_throw + 32
2 CoreFoundation 0x357d6789 +[NSException raise:format:arguments:] + 100
3 CoreFoundation 0x357d67ab +[NSException raise:format:] + 34
4 Foundation 0x34b8a4c9 -[NSPlaceholderString initWithString:] + 92
5 TestMoboSDK-Client 0x000f4921 0xe8000 + 51489
6 TestMoboSDK-Client 0x000f05c1 0xe8000 + 34241
7 TestMoboSDK-Client 0x000f4283 0xe8000 + 49795
8 UIKit 0x3310360b _UIXXRemoteNotificationRegistrationSucceeded + 146
9 UIKit 0x331040dd _XRemoteNotificationRegistrationSucceeded + 116
10 AppSupport 0x33ce5af9 migHelperRecievePortCallout + 148
11 CoreFoundation 0x357aa523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
12 CoreFoundation 0x357aa4c5 __CFRunLoopDoSource1 + 140
13 CoreFoundation 0x357a9313 __CFRunLoopRun + 1370
14 CoreFoundation 0x3572c4a5 CFRunLoopRunSpecific + 300
15 CoreFoundation 0x3572c36d CFRunLoopRunInMode + 104
16 GraphicsServices 0x334c7439 GSEventRunModal + 136
17 UIKit 0x32f04cd5 UIApplicationMain + 1080
18 TestMoboSDK-Client 0x000f6c0f 0xe8000 + 60431
19 TestMoboSDK-Client 0x000ee008 0xe8000 + 24584
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3584c32c __pthread_kill + 8
1 libsystem_c.dylib 0x34a34208 pthread_kill + 48
2 libsystem_c.dylib 0x34a2d298 abort + 88
3 libc++abi.dylib 0x35044f64 abort_message + 40
4 libc++abi.dylib 0x35042346 default_terminate() + 18
5 libobjc.A.dylib 0x333fa350 _objc_terminate + 140
6 libc++abi.dylib 0x350423be safe_handler_caller(void (*)()) + 70
7 libc++abi.dylib 0x3504244a std::terminate() + 14
8 libc++abi.dylib 0x3504381e __cxa_rethrow + 82
9 libobjc.A.dylib 0x333fa2a2 objc_exception_rethrow + 6
10 CoreFoundation 0x3572c506 CFRunLoopRunSpecific + 398
11 CoreFoundation 0x3572c366 CFRunLoopRunInMode + 98
12 GraphicsServices 0x334c7432 GSEventRunModal + 130
13 UIKit 0x32f04cce UIApplicationMain + 1074
14 TestMoboSDK-Client 0x000f6c08 0xe8000 + 60424
15 TestMoboSDK-Client 0x000ee000 0xe8000 + 24576
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3583c3a8 kevent + 24
1 libdispatch.dylib 0x33b6fea4 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x33b6fbc2 _dispatch_mgr_thread + 30
Thread 2:
0 libsystem_kernel.dylib 0x3584ccd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x349eff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x349efcc8 start_wqthread + 0
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x3584c0d8 __psynch_mutexwait + 24
1 libsystem_c.dylib 0x349e9674 pthread_mutex_lock + 376
2 WebCore 0x373cf4e8 _WebTryThreadLock(bool) + 208
3 WebCore 0x373cf7ec WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 24
4 CoreFoundation 0x357aab14 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
5 CoreFoundation 0x357a8d50 __CFRunLoopDoObservers + 252
6 CoreFoundation 0x357a916a __CFRunLoopRun + 946
7 CoreFoundation 0x3572c49e CFRunLoopRunSpecific + 294
8 CoreFoundation 0x3572c366 CFRunLoopRunInMode + 98
9 WebCore 0x37472c9c RunWebThread(void*) + 396
10 libsystem_c.dylib 0x349f572e _pthread_start + 314
11 libsystem_c.dylib 0x349f55e8 thread_start + 0
Thread 4:
0 libsystem_kernel.dylib 0x3584ccd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x349eff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x349efcc8 start_wqthread + 0
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x3583c004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3583c1fa mach_msg + 50
2 CoreFoundation 0x357aa3ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x357a9124 __CFRunLoopRun + 876
4 CoreFoundation 0x3572c49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x3572c366 CFRunLoopRunInMode + 98
6 Foundation 0x34b71bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x34b71a7a -[NSThread main] + 66
8 Foundation 0x34c0558a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x349f572e _pthread_start + 314
10 libsystem_c.dylib 0x349f55e8 thread_start + 0
Thread 6:
0 libsystem_kernel.dylib 0x3584ccd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x349eff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x349efcc8 start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000
r4: 0x00000006 r5: 0x3f0f8d98 r6: 0x00000002 r7: 0x2fee39a8
r8: 0x00000000 r9: 0x35045a4a r10: 0x0014a888 r11: 0x333f4f69
ip: 0x00000148 sp: 0x2fee399c lr: 0x34a3420f pc: 0x3584c32c
cpsr: 0x00000010
Edit:
The crash only happen on iPad(jail break) 5.1.1. With iPad(jail break) 7.0.4 or 6. -> it worked.*
Reason: When I call openActiveSessionWithCompletion function,I do many actions to collect the info to make a url link. It included the action: get UUIDString .And with iOS 5.1 the result when get UUIDString is a NULL string. So that, it's reason for app crash when I call the command: uuid_String = [[NSString alloc]initWithString:[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]];. initWithString: this function when push a NULL string will make app crash.
This is wrong:
uuid_String = [[NSString alloc]initWithString:[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]]
Just do this:
uuid_String = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
As for why it returns nil, probably because advertising is disabled on the device. Users are allowed to opt out of tracking.
Check the documentation and beware iOS 5 and 7 have different behaviour.

Resources