What's [NSException initWithCoder:]? - ios

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)

Related

Difficult iOS Crash - SIGABRT ABORT

I've got a difficult iOS crash that is a decent % of users. I can't reproduce it and the accompanying logs indicate that it occurs quite randomly. I have not been able to isolate the crash to a particular use case.
From Crashlytics, I get the following title:
libc++abi.dylib
std::__terminate(void (*)())
and stack trace:
Crashed: com.apple.root.default-qos
SIGABRT ABORT 0x00000001b889fb78
Crashed: com.apple.root.default-qos
0 libsystem_kernel.dylib 0x7b78 __pthread_kill + 8
1 libsystem_pthread.dylib 0x73bc pthread_kill + 268
2 libsystem_c.dylib 0x2051c abort + 168
3 libc++abi.dylib 0x11b7c __cxxabiv1::__aligned_malloc_with_fallback(unsigned long) + 130
4 libc++abi.dylib 0x10f38 std::__terminate(void (*)()) + 52
5 libc++abi.dylib 0x10eb4 std::terminate() + 64
6 libobjc.A.dylib 0x2d268 objc::DenseMapBase<objc::DenseMap<objc_class*, PendingInitialize*, objc::DenseMapValueInfo<PendingInitialize*>, objc::DenseMapInfo<objc_class*>, objc::detail::DenseMapPair<objc_class*, PendingInitialize*> >, objc_class*, PendingInitialize*, objc::DenseMapValueInfo<PendingInitialize*>, objc::DenseMapInfo<objc_class*>, objc::detail::DenseMapPair<objc_class*, PendingInitialize*> >::FatalCorruptHashTables(objc::detail::DenseMapPair<objc_class*, PendingInitialize*> const*, unsigned int) const + 14
7 libdispatch.dylib 0x3a40 _dispatch_client_callout + 40
8 libdispatch.dylib 0x6b44 _dispatch_queue_override_invoke + 784
9 libdispatch.dylib 0x15164 _dispatch_root_queue_drain + 396
10 libdispatch.dylib 0x1596c _dispatch_worker_thread2 + 164
11 libsystem_pthread.dylib 0x1080 _pthread_wqthread + 228
12 libsystem_pthread.dylib 0xe5c start_wqthread + 8
The app is a Cordova application with a sizable native layer implemented in both Objective C and Swift.

iOS 10 AVPlayer crash when dealloc

I got a crash when using AVPlayer to play a remote audio. The App crash on main thread. The crash log is below:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001806a7014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018076f450 pthread_kill + 112
2 libsystem_c.dylib 0x000000018061b49c __abort + 144
3 libsystem_c.dylib 0x000000018061b40c __abort + 0
4 libc++abi.dylib 0x00000001800e52d4 __cxa_bad_cast + 0
5 libc++abi.dylib 0x0000000180102cc0 default_unexpected_handler+ 126144 () + 0
6 libobjc.A.dylib 0x0000000180110844 _objc_terminate+ 34884 () + 124
7 FanXing 0x0000000103712edc 0x10007c000 + 57241308
8 libc++abi.dylib 0x00000001800ff66c std::__terminate(void (*)+ 112236 ()) + 16
9 libc++abi.dylib 0x00000001800ff234 __cxa_rethrow + 144
10 libobjc.A.dylib 0x000000018011071c objc_exception_rethrow + 44
11 Foundation 0x0000000182154644 NSKVODeallocate + 380
12 CoreFoundation 0x00000001816ca36c -[__NSSingleObjectArrayI dealloc] + 44
13 AVFoundation 0x0000000188e166b0 -[AVPlayer dealloc] + 696
14 libsystem_blocks.dylib 0x00000001805b7a28 _Block_release + 144
15 libdispatch.dylib 0x00000001805621bc _dispatch_client_callout + 16
16 libdispatch.dylib 0x0000000180566d68 _dispatch_main_queue_callback_4CF + 1000
17 CoreFoundation 0x0000000181686810 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
18 CoreFoundation 0x00000001816843fc __CFRunLoopRun + 1660
19 CoreFoundation 0x00000001815b22b8 CFRunLoopRunSpecific + 444
20 GraphicsServices 0x0000000183066198 GSEventRunModal + 180
21 UIKit 0x00000001875f97fc -[UIApplication _run] + 684
22 UIKit 0x00000001875f4534 UIApplicationMain + 208
23 FanXing 0x00000001004c248c 0x10007c000 + 4482188
24 libdyld.dylib 0x00000001805955b8 start + 4

ios - SocketMobile SocketScan -[AccessoryMonitor CheckForChanges:] NSRangeException

I have integrated with Socket Mobile scanners using the ScanApiSDK (v 10.2.227). We received a crash log on -[AccessoryMonitor CheckForChanges:] which seems to be part of the SDK.
Has anyone experienced this before? What would be the best way to find the cause of the issue?
Appreciate any help. Crash log is below.
*** -[__NSArrayM getObjects:range:]: range {0, 1} extends beyond bounds for empty array
#7. Crashed: com.twitter.crashlytics.ios.exception
0 MyFirstApp 0x10076389c CLSProcessRecordAllThreads + 4302256284
1 MyFirstApp 0x10076389c CLSProcessRecordAllThreads + 4302256284
2 MyFirstApp 0x100763d4c CLSProcessRecordAllThreads + 4302257484
3 MyFirstApp 0x10074e78c CLSHandler + 4302169996
4 MyFirstApp 0x100761aa4 __CLSExceptionRecord_block_invoke + 4302248612
5 libdispatch.dylib 0x1811d947c _dispatch_client_callout + 16
6 libdispatch.dylib 0x1811e4728 _dispatch_barrier_sync_f_invoke + 100
7 MyFirstApp 0x10076163c CLSExceptionRecord + 4302247484
8 MyFirstApp 0x100761454 CLSExceptionRecordNSException + 4302246996
9 MyFirstApp 0x1007610b4 CLSTerminateHandler() + 4302246068
10 libc++abi.dylib 0x180de6f44 std::__terminate(void (*)()) + 16
11 libc++abi.dylib 0x180de685c __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 134
12 libobjc.A.dylib 0x180df4094 _objc_exception_destructor(void*) + 330
13 CoreFoundation 0x181672ff8 -[NSMutableArray sortUsingSelector:] + 634
14 CoreFoundation 0x181672b10 -[NSArray initWithArray:range:copyItems:] + 248
15 CoreFoundation 0x181672a04 +[NSArray arrayWithArray:] + 80
16 MyFirstApp 0x1004f59d8 -[AccessoryMonitor CheckForChanges:] (AccessoryMonitor.m:204)
17 MyFirstApp 0x1004f5be0 SktAccessoryEnumerator::Wait(unsigned long, TSktHardware**, CSktTransport**) (SktAccessoryEnumerator.mm:86)
18 MyFirstApp 0x1004e6130 SktScanAPIListenerThread(void*) (SktListener.mm:207)
19 libsystem_pthread.dylib 0x1813f3b28 _pthread_body + 156
20 libsystem_pthread.dylib 0x1813f3a8c _pthread_body + 154
21 libsystem_pthread.dylib 0x1813f1028 thread_start + 4
--
Fatal Exception: NSRangeException
0 CoreFoundation 0x18178edb0 __exceptionPreprocess
1 libobjc.A.dylib 0x180df3f80 objc_exception_throw
2 CoreFoundation 0x181672ff8 -[NSMutableArray sortUsingSelector:]
3 CoreFoundation 0x181672b10 -[NSArray initWithArray:range:copyItems:]
4 CoreFoundation 0x181672a04 +[NSArray arrayWithArray:]
5 MyFirstApp 0x1004f59d8 -[AccessoryMonitor CheckForChanges:] (AccessoryMonitor.m:204)
6 MyFirstApp 0x1004f5be0 SktAccessoryEnumerator::Wait(unsigned long, TSktHardware**, CSktTransport**) (SktAccessoryEnumerator.mm:86)
7 MyFirstApp 0x1004e6130 SktScanAPIListenerThread(void*) (SktListener.mm:207)
8 libsystem_pthread.dylib 0x1813f3b28 _pthread_body
9 libsystem_pthread.dylib 0x1813f3a8c _pthread_body
10 libsystem_pthread.dylib 0x1813f1028 thread_start

Understanding This Crash Report

I just received this crash report for my app from Flurry Analytics. But I don't know how to read this. It seems like there's no enough information to really tell what or where is this crash.
Could any of you guys help understand this report?
Thanks!
REPORT:
0 libsystem_kernel.dylib 0x19b7971e0 ___pthread_kill + 8
1 libsystem_c.dylib 0x19b706c00 _abort + 140
2 libc++abi.dylib 0x19a4bd3f4 ___cxa_bad_cast + 0
3 libc++abi.dylib 0x19a4d9e98 + 0
4 libobjc.A.dylib 0x19ae34264 + 124
5 libc++abi.dylib 0x19a4d6f44 + 16
6 libc++abi.dylib 0x19a4d6b10 ___cxa_rethrow + 144
7 libobjc.A.dylib 0x19ae3413c _objc_exception_rethrow + 44
8 CoreFoundation 0x1862a9328 _CFRunLoopRunSpecific + 552
9 GraphicsServices 0x1914200cc _GSEventRunModal + 180
10 UIKit 0x18ba96df8 _UIApplicationMain + 204
11 MYAPP 0x1000ffe24 main + 96 (main.m:21)
12 libdyld.dylib 0x19b6768b8 + 4

iOS Mystery crash w libsystem_kernel.dylib

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)

Resources