Namespace SIGNAL, Code 0x5 with EXC_BREAKPOINT (SIGTRAP) - ios

I am unable to reproduce the issue. One of my user sent the crash log and the issue seem to point to NSUserDefault setBool:forKey method.
Not working for user Device iPhone 6, iOS version: 12.4.4. For now only one user contacted due to the App crash.
Working on the devices I tested. (iPad Air 2, iPhone XS, iOS version 13.3)
This is the method I am using.
- (void) saveToDefaults:(NSString*)productId
{
[ [ NSUserDefaults standardUserDefaults ] setBool:YES forKey:productId ];
[ [ NSUserDefaults standardUserDefaults ] synchronize];
}
Crash dump
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000020eae32e4
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [15897]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 CoreFoundation 0x000000020eae32e4 CFHash + 372 (CFRuntime.c:1147)
1 CoreFoundation 0x000000020eb75a38 CFBasicHashFindBucket + 224 (CFBasicHash.c:465)
2 CoreFoundation 0x000000020eb75a38 CFBasicHashFindBucket + 224 (CFBasicHash.c:465)
3 CoreFoundation 0x000000020eaada40 CFDictionaryGetValue + 120 (CFDictionary.c:413)
4 CoreFoundation 0x000000020eaca938 -[CFPrefsSearchListSource alreadylocked_setPrecopiedValues:forKeys:count:from:] + 496 (CFPrefsSearchListSource.m:632)
5 CoreFoundation 0x000000020eb81230 -[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:] + 372 (CFPrefsSource.m:742)
6 CoreFoundation 0x000000020eb81524 -[CFPrefsSource setValues:forKeys:count:copyValues:from:] + 36 (CFPrefsSource.m:766)
7 CoreFoundation 0x000000020ea3e3dc -[CFPrefsSource setValue:forKey:from:] + 64 (CFPrefsSource.m:772)
8 CoreFoundation 0x000000020eaccc54 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurat... + 272 (CFPrefsSearchListSource.m:1553)
9 CoreFoundation 0x000000020eacc698 normalizeQuintuplet + 340 (CFPrefsSearchListSource.m:63)
10 CoreFoundation 0x000000020ea3ad64 -[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationUR... + 108 (CFPrefsSearchListSource.m:1433)
11 CoreFoundation 0x000000020ea3dd7c -[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:] + 92 (CFXPreferences.m:759)
12 CoreFoundation 0x000000020eb8b360 _CFPreferencesSetAppValueWithContainerAndConfiguration + 132 (CFXPreferences.m:1867)
13 Foundation 0x000000020f4eb3b8 -[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 64 (NSUserDefaults.m:228)
14 MyApp 0x00000001004adb14 -[IAPHelper saveToDefaults:] + 88 (IAPHelper.m:206)
15 MyApp 0x00000001004adc3c -[IAPHelper restoreTransaction:] + 224 (IAPHelper.m:223)
16 MyApp 0x00000001004ad928 -[IAPHelper paymentQueue:updatedTransactions:] + 264 (IAPHelper.m:0)
17 libdispatch.dylib 0x000000020e58ca38 _dispatch_call_block_and_release + 24 (init.c:1372)
18 libdispatch.dylib 0x000000020e58d7d4 _dispatch_client_callout + 16 (object.m:511)
19 libdispatch.dylib 0x000000020e53b008 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068 (inline_internal.h:2441)
20 CoreFoundation 0x000000020eae0b20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1813)
21 CoreFoundation 0x000000020eadba58 __CFRunLoopRun + 1924 (CFRunLoop.c:3113)
22 CoreFoundation 0x000000020eadafb4 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
23 GraphicsServices 0x0000000210cdc79c GSEventRunModal + 104 (GSEvent.c:2245)
24 UIKitCore 0x000000023b33cc38 UIApplicationMain + 212 (UIApplication.m:4353)
25 MyApp 0x00000001004e9cec main + 88 (main.m:14)
26 libdyld.dylib 0x000000020e59e8e0 start + 4
How can I handle this exception to avoid this problem in the future.

Following up comments discussion and this answer indicating synchronize is not required (as per Apple's iOS 12 release notes):
My target iOS is from 11.2, guess I cannot use it for now.
Yes you can.
Wrapping up my suggestion in comment :
if (#available(iOS 12, *)) {
// don't need to synchronize
} else {
[NSUserDefaults.standardUserDefaults synchronize];
}
The above code #available Swift-like syntax assumes you're using Xcode 9 or higher. Which given the targeted iOS is pretty much a must.
Just to make myself 100% clear I cannot guarantee this will solve this particular crash issue, but it is worth trying as a very low effort fix candidate.

Related

Expo standalone iOS build crashes on splash screen on Simulator and Testflight

I developed a marketplace app using Expo. It works fine on Expo Go both on Android and iOS, as well as a standalone app for Android. The problem is when I build a .tar for iOS simulator or when I upload to Testflight to test it. Then it crashes right after showing the splash screen. I use a managed workflow, and I think I followed all the instructions.
Here's the crash log:
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
*** Terminating app due to uncaught exception 'ExpoFatalError', reason: 'Expo encountered a fatal error: Unhandled JS Exception: Invariant Violation: Native module cannot be null.'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 757.5 - Device: iPhone 12 (0D59D0C0-2D3B-40ED-A8E2-DA0B1417C29C) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 12
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff20422fba __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20193ff5 objc_exception_throw + 48
2 ComGrabbiGrabbiapp 0x000000010b375821 -[EXAppViewController maybeShowError:] + 506
3 ComGrabbiGrabbiapp 0x000000010b396dce handleFatalReactError_block_invoke_2 + 574
4 libdispatch.dylib 0x00007fff201078df _dispatch_client_callout + 8
5 libdispatch.dylib 0x00007fff201156ca _dispatch_async_and_wait_invoke + 109
6 libdispatch.dylib 0x00007fff201078df _dispatch_client_callout + 8
7 libdispatch.dylib 0x00007fff20114a27 _dispatch_main_queue_callback_4CF + 1045
8 CoreFoundation 0x00007fff203908f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
9 CoreFoundation 0x00007fff2038b169 __CFRunLoopRun + 2781
10 CoreFoundation 0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
11 GraphicsServices 0x00007fff2b874d85 GSEventRunModal + 139
12 UIKitCore 0x00007fff246c14df -[UIApplication _run] + 912
13 UIKitCore 0x00007fff246c639c UIApplicationMain + 101
14 ComGrabbiGrabbiapp 0x000000010b1461d0 main + 80
15 libdyld.dylib 0x00007fff2025abbd start + 1
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff60309946 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff60343615 pthread_kill + 263
2 libsystem_c.dylib 0x00007fff200fbd4f __abort + 139
3 libsystem_c.dylib 0x00007fff200fbcc4 abort + 135
4 libc++abi.dylib 0x00007fff20254692 abort_message + 241
5 libc++abi.dylib 0x00007fff20245dfd demangling_terminate_handler() + 266
6 libobjc.A.dylib 0x00007fff20179ace _objc_terminate() + 96
7 libc++abi.dylib 0x00007fff20253aa7 std::__terminate(void (*)()) + 8
8 libc++abi.dylib 0x00007fff20253a49 std::terminate() + 41
9 libdispatch.dylib 0x00007fff201078f3 _dispatch_client_callout + 28
10 libdispatch.dylib 0x00007fff201156ca _dispatch_async_and_wait_invoke + 109
11 libdispatch.dylib 0x00007fff201078df _dispatch_client_callout + 8
12 libdispatch.dylib 0x00007fff20114a27 _dispatch_main_queue_callback_4CF + 1045
13 com.apple.CoreFoundation 0x00007fff203908f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
14 com.apple.CoreFoundation 0x00007fff2038b169 __CFRunLoopRun + 2781
15 com.apple.CoreFoundation 0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
16 com.apple.GraphicsServices 0x00007fff2b874d85 GSEventRunModal + 139
17 com.apple.UIKitCore 0x00007fff246c14df -[UIApplication _run] + 912
18 com.apple.UIKitCore 0x00007fff246c639c UIApplicationMain + 101
19 com.grabbi.grabbiapp 0x000000010b1461d0 main + 80
20 libdyld.dylib 0x00007fff2025abbd start + 1
Okay after a weekend of debugging I fixed it. I had my main app component (in Expo) wrapped in a Stripe Provider component. Since I wasn't using Stripe but Paypal for checkout, I deleted the Stripe wrapper and now it works.
if(fontsLoaded){
return (
<StripeProvider
publishableKey="xxxxxxxxxxxxxxxxx"
urlScheme="your-url-scheme" // required for 3D Secure and bank redirects
merchantIdentifier="merchant.com.{{YOUR_APP_NAME}}" // required for Apple Pay
>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<RootRouter />
</PersistGate>
</Provider>
</StripeProvider>
);

How to initialize a CLLocationCoordinate2D struct [duplicate]

This question already has answers here:
CLLocationCoordinate2D can't be instantiated
(2 answers)
Closed 1 year ago.
I'm trying to initialize a CLLocationCoordinate2D from a Swift Playground, and I'm getting the error:
error: Execution was interrupted, reason: signal SIGABRT.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
Not sure what I'm doing wrong. Here is what I tried:
var temporaryCoordinate = CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0)
You have found a very unusual and interesting bug. I can reproduce your problem by running the following code in a Blank iOS playground:
import UIKit
import CoreLocation
var temporaryCoordinate = CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0)
What is going wrong is that the runtime environment, the Playground, is itself crashing. In the Mac, in the Console app, with Crash Reports left tab, we can see that the Xcode Playground is crashing.
Process: scratch-playground [1696]
Path: /Users/USER/Library/Developer/XCPGDevices/D22341D9-BFF3-4575-9801-1405F0AA2EA2/data/Containers/Bundle/Application/67A50F6D-18E8-4220-A2EB-8673018601AA/scratch-playground-1381-1.app/scratch-playground
Identifier: scratch-playground
Version: 1.0 (1)
Code Type: ARM-64 (Native)
Parent Process: ??? [1697]
Responsible: SimulatorTrampoline [635]
User ID: 501
Date/Time: 2021-04-06 21:43:05.608 +0100
OS Version: macOS 11.2.3 (20D91)
Report Version: 12
Anonymous UUID: BFEAE183-A757-B843-D9D2-BF254A4665C2
Time Awake Since Boot: 6300 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
External Modification Warnings:
Debugger attached to process.
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSValue valueWithMKCoordinate:]: unrecognized selector sent to class 0x1c9d3f588'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 732.18.6 - Device: iPad Pro (9.7-inch) (D22341D9-BFF3-4575-9801-1405F0AA2EA2) - Runtime: iOS 14.4 (18D46) - DeviceType: iPad Pro (9.7-inch)
Application Specific Backtrace 1:
0 CoreFoundation 0x00000001803f61fc __exceptionPreprocess + 236
1 libobjc.A.dylib 0x000000018016a438 objc_exception_throw + 56
2 CoreFoundation 0x00000001804053bc __CFExceptionProem + 0
3 CoreFoundation 0x00000001803fa45c ___forwarding___ + 1408
4 CoreFoundation 0x00000001803fc42c _CF_forwarding_prep_0 + 92
5 libswiftCoreLocation.dylib 0x00000001b1f98044 $s12CoreLocation39CLLocationCoordinate2DInNSValueObjCType33_25AD2332B1DC67E23B54508C4A7DAD45LLSPys4Int8VGvpfiAFyXEfU_ + 104
6 libswiftCoreLocation.dylib 0x00000001b1f97fcc globalinit_33_25AD2332B1DC67E23B54508C4A7DAD45_func0 + 12
7 libdispatch.dylib 0x0000000180100c48 _dispatch_client_callout + 16
8 libdispatch.dylib 0x0000000180102300 _dispatch_once_callout + 28
9 libswiftCore.dylib 0x000000018eed4ee8 swift_once + 44
10 libswiftCoreLocation.dylib 0x00000001b1f9817c $sSo22CLLocationCoordinate2DVs21_ObjectiveCBridgeable12CoreLocationsACP09_bridgeToC1C01_C5CTypeQzyFTW + 116
11 libswiftCore.dylib 0x000000018eeac510 _ZL37bridgeAnythingNonVerbatimToObjectiveCPN5swift11OpaqueValueEPKNS_14TargetMetadataINS_9InProcessEEEb + 360
12 libswiftCore.dylib 0x000000018ec10d70 $ss27_bridgeAnythingToObjectiveCyyXlxlF + 184
13 PlaygroundLogger 0x0000000100c6f9f8 globalinit_33_86996C1BC443F28F24E6A34F24210E4B_func8 + 2132
14 PlaygroundLogger 0x0000000100c6c848 globalinit_33_B1F54B50FE3698781248948D54A93147_func6 + 520
15 PlaygroundLogger 0x0000000100c6db44 playground_log_hidden + 276
16 ??? 0x0000000100c34350 0x0 + 4307764048
17 scratch-playground 0x0000000100ac2ea4 main + 0
18 CoreFoundation 0x0000000180365254 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
19 CoreFoundation 0x00000001803644ec __CFRunLoopDoBlocks + 404
20 CoreFoundation 0x000000018035eda8 __CFRunLoopRun + 780
21 CoreFoundation 0x000000018035e58c CFRunLoopRunSpecific + 572
22 GraphicsServices 0x000000018b9c2740 GSEventRunModal + 160
23 UIKitCore 0x00000001843ccbf0 -[UIApplication _run] + 964
24 UIKitCore 0x00000001843d19d0 UIApplicationMain + 112
25 scratch-playground 0x0000000100ac2f7c main + 216
26 libdyld.dylib 0x0000000180223cbc start + 4
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00000001bd7c3c10 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001bd7fc034 pthread_kill + 260
2 libsystem_c.dylib 0x00000001800f378c abort + 100
3 libc++abi.dylib 0x000000018021cf20 abort_message + 128
4 libc++abi.dylib 0x000000018020ef1c demangling_terminate_handler() + 296
5 libobjc.A.dylib 0x000000018016a6e8 _objc_terminate() + 124
6 libc++abi.dylib 0x000000018021c3c0 std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x000000018021c358 std::terminate() + 44
8 libdispatch.dylib 0x0000000180100c5c _dispatch_client_callout + 36
9 libdispatch.dylib 0x0000000180102300 _dispatch_once_callout + 28
10 libswiftCore.dylib 0x000000018eed4ee8 swift_once + 44
11 libswiftCoreLocation.dylib 0x00000001b1f9817c protocol witness for _ObjectiveCBridgeable._bridgeToObjectiveC() in conformance CLLocationCoordinate2D + 116
12 libswiftCore.dylib 0x000000018eeac510 bridgeAnythingNonVerbatimToObjectiveC(swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, bool) + 360
13 libswiftCore.dylib 0x000000018ec10d70 _bridgeAnythingToObjectiveC<A>(_:) + 184
14 com.apple.dt.PlaygroundLogger 0x0000000100c6f9f8 0x100c68000 + 31224
15 com.apple.dt.PlaygroundLogger 0x0000000100c6c848 0x100c68000 + 18504
16 com.apple.dt.PlaygroundLogger 0x0000000100c6db44 playground_log_hidden + 276
17 ??? 0x0000000100c34350 0 + 4307764048
18 com.apple.dt.playground.stub.iOS_Simulator.scratch-playground-10BCB7AC-7E28-4D75-BC98-3FA7A44E2F36 0x0000000100ac2ea4 linkResources + 328
19 com.apple.CoreFoundation 0x0000000180365254 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
20 com.apple.CoreFoundation 0x00000001803644ec __CFRunLoopDoBlocks + 404
21 com.apple.CoreFoundation 0x000000018035eda8 __CFRunLoopRun + 780
22 com.apple.CoreFoundation 0x000000018035e58c CFRunLoopRunSpecific + 572
23 com.apple.GraphicsServices 0x000000018b9c2740 GSEventRunModal + 160
24 com.apple.UIKitCore 0x00000001843ccbf0 -[UIApplication _run] + 964
25 com.apple.UIKitCore 0x00000001843d19d0 UIApplicationMain + 112
26 com.apple.dt.playground.stub.iOS_Simulator.scratch-playground-10BCB7AC-7E28-4D75-BC98-3FA7A44E2F36 0x0000000100ac2f7c main + 216
27 libdyld.dylib 0x0000000180223cbc start + 4
I think the problem is that there are two Core Location binaries in play:
0x18321e000 - 0x1832a8fff com.apple.corelocation (2420.12.16 - 2420.12.16) <F94D1F57-86D5-3A82-8F2B-80A9AEAC0308> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreLocation.framework/CoreLocation
and
0x1b1f96000 - 0x1b1f98fff +libswiftCoreLocation.dylib (5) <EE615605-C11D-3F60-B611-8B1C1D45FEEA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCoreLocation.dylib
and the playground is communicating from one world to the other world; talking to the iOS simulator. But there is an incompatibility between the two as the message is not carried across correctly due to type confusion. This leads to the
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSValue
valueWithMKCoordinate:]: unrecognized selector sent to class
0x1c9d3f588' terminating with uncaught exception of type NSException
I think you should file a bug with Apple. To avoid the problem, write your code based on the iOS Simulator directly, instead of using the Playground. In such circumstances, your code will execute correctly (since it directly will run against the simulator without the intervening bridge from the Playground).
As Alexander says in his comment, there is nothing wrong with the code you posted. The cause of the crash is elsewhere.

How to identify the state of an iOS App while crash occurs

With following crash log stack. Can I say that App was in Foreground state when crash occurred. because I can see UIKit calls.. What should one look to identified various state of App. like Suspended / Background / Foreground
**
#0
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000f158936c
**
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3a72c626 objc_msgSend + 5
1 CoreFoundation 0x2feae16b +[__NSArrayI __new:::] + 58
2 CoreFoundation 0x2feab945 -[__NSPlaceholderArray initWithObjects:count:] + 172
3 CoreFoundation 0x2feb5341 +[NSArray arrayWithObjects:count:] + 44
4 CoreFoundation 0x2feeb1bb -[NSDictionary allKeys] + 174
5 UIKit 0x3292430f -[UITouchesEvent _cloneEvent] + 342
6 UIKit 0x32786df9 _UIGestureRecognizerUpdate + 5240
7 CoreFoundation 0x2ff3d255 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
8 CoreFoundation 0x2ff3abf9 __CFRunLoopDoObservers + 284
9 CoreFoundation 0x2ff3af3b __CFRunLoopRun + 730
10 CoreFoundation 0x2fea5ebf CFRunLoopRunSpecific + 522
11 CoreFoundation 0x2fea5ca3 CFRunLoopRunInMode + 106
12 GraphicsServices 0x34dab663 GSEventRunModal + 138
13 UIKit 0x327f214d UIApplicationMain + 1136
14 MyApp 0xff6bf main (main.m:16)
15 libdyld.dylib 0x3ac2fab7 start + 2
com.apple.main-thread is the main thread which loads up the UI of the ViewController.
Since the crash is on the main thread then the app is to be running in foreground.
I hope it helps.

UICollectionViewData layoutAttributesForItemAtIndexPath HockeyApp Crash Report

I am using HockeyApp for crash reporting and getting the following crash. I am unable to reproduce the crash. Can this be due to animating the scroll in the UICollectionView?
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x66dbc2408
Crashed Thread: 0
Application Specific Information:
Selector name found in current argument registers: indexAtPosition:
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000198e8c0b0 objc_retain + 16
1 UIKit 0x00000001898bade0 -[UICollectionViewData layoutAttributesForItemAtIndexPath:] + 248
2 UIKit 0x0000000189acb1dc -[UICollectionView scrollToItemAtIndexPath:atScrollPosition:animated:] + 256
3 MyApp 0x000000010016c33c -[CalendarView scrollToDate:animated:] (CalendarView.m:183)
4 MyApp 0x00000001001607cc __56-[CalendarViewController _updateHighlightedDateRange]_block_invoke (CalendarViewController.m:577)
5 libdispatch.dylib 0x00000001996916e8 _dispatch_call_block_and_release + 20
6 libdispatch.dylib 0x00000001996916a8 _dispatch_client_callout + 12
7 libdispatch.dylib 0x0000000199696db0 _dispatch_main_queue_callback_4CF + 1840
8 CoreFoundation 0x00000001842781f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
9 CoreFoundation 0x0000000184276060 __CFRunLoopRun + 1624
10 CoreFoundation 0x00000001841a4ca0 CFRunLoopRunSpecific + 380
11 GraphicsServices 0x000000018f3e0088 GSEventRunModal + 176
12 UIKit 0x00000001898bcffc UIApplicationMain + 200
13 MyApp 0x000000010015c2a4 main (main.m:12)
14 libdyld.dylib 0x00000001996c28b8 start + 0

How do I debug this crash in UIDictationController?

Recently I am trying to debug with the information provided by Crash Reports. So far I have been able to identify and fix some bugs but not this one.
As I read from the crash report, it's something wrong with UIDictationController, but my code did not call UIDictationController at all. The crash report is generated by PLCrashReporter.
It seems that the user is using an iPad Mini (WiFi) and running iOS 6.0.2.
Incident Identifier: [REMOVED]
CrashReporter Key: [REMOVED]
Hardware Model: iPad2,5
Process: MyApp [2849]
Path: [REMOVED]
Identifier: com.yourcompany.MyApp
Version: 1.1
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2013-01-26 02:11:01 +0000
OS Version: iPhone OS 6.0.2 (10A550)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x32255350
Crashed Thread: 0
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
Last Exception Backtrace:
0 CoreFoundation 0x3882e2a3 __exceptionPreprocess + 163
1 libobjc.A.dylib 0x30d8897f objc_exception_throw + 31
2 CoreFoundation 0x387788d9 -[__NSArrayM insertObject:atIndex:] + 769
3 UIKit 0x36ad24c3 -[UIDictationMeterView initWithFrame:] + 267
4 UIKit 0x36abe699 -[UIDictationView initWithFrame:] + 281
5 UIKit 0x36abdcd1 +[UIDictationView sharedInstance] + 145
6 UIKit 0x36aae7f5 -[UIDictationController setState:] + 149
7 UIKit 0x36aaef5f -[UIDictationController setupForDictationStart] + 199
8 UIKit 0x36aae5d7 -[UIDictationController startConnectionForReason:] + 51
9 UIKit 0x36aaf173 -[UIDictationController startDictationFromLayout] + 55
10 UIKit 0x36825c09 -[UIKeyboardLayoutStar touchUp:] + 5249
11 UIKit 0x3682472f -[UIKeyboardLayout touchesEnded:withEvent:] + 387
12 UIKit 0x3670c5f1 -[UIWindow _sendTouchesForEvent:] + 525
13 UIKit 0x366f9801 -[UIApplication sendEvent:] + 381
14 UIKit 0x366f911b _UIApplicationHandleEvent + 6155
15 GraphicsServices 0x3771e5a3 _PurpleEventCallback + 591
16 GraphicsServices 0x3771e1d3 PurpleEventCallback + 35
17 CoreFoundation 0x38803173 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
18 CoreFoundation 0x38803117 __CFRunLoopDoSource1 + 139
19 CoreFoundation 0x38801f99 __CFRunLoopRun + 1385
20 CoreFoundation 0x38774ebd CFRunLoopRunSpecific + 357
21 CoreFoundation 0x38774d49 CFRunLoopRunInMode + 105
22 GraphicsServices 0x3771d2eb GSEventRunModal + 75
23 UIKit 0x3674d2f9 UIApplicationMain + 1121
24 MyApp 0x000032e1 main (main.m:36)
25 MyApp 0x00003230 start + 40
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x30f10350 __pthread_kill + 8
1 libsystem_c.dylib 0x304f8973 abort + 95
2 MyApp 0x000e954f uncaught_exception_handler + 27
3 CoreFoundation 0x3882e57f __handleUncaughtException + 615
4 libobjc.A.dylib 0x30d88a65 _objc_terminate() + 129
5 libc++abi.dylib 0x3719807b safe_handler_caller(void (*)()) + 79
6 libc++abi.dylib 0x37198114 std::terminate() + 20
7 libc++abi.dylib 0x37199599 __cxa_current_exception_type + 1
8 libobjc.A.dylib 0x30d889d1 objc_exception_rethrow + 13
9 CoreFoundation 0x38774f21 CFRunLoopRunSpecific + 457
10 CoreFoundation 0x38774d49 CFRunLoopRunInMode + 105
11 GraphicsServices 0x3771d2eb GSEventRunModal + 75
12 UIKit 0x3674d2f9 UIApplicationMain + 1121
13 MyApp 0x000032e1 main (main.m:36)
Is there any way that I can do with this bug? Or, at least mitigating the issue? Thanks in advance.
the problem is that somewhere in your app you have a keyboard come up and with iOS version 6.0.1 and 6.0.2, apple enabled the dictation controller even if you didn't specify it to be enabled. Two solutions to fixing it: create a custom keyboard without it or implement dictation in your app.
My suggestion is to just let it be, only affects two outdate iOS versions and hopefully the crashes will go away as the users upgrade their devices
I have the keyboard coming up for a custom TextView, and when the user pushed the dictation button, said something, pushed finish, and then they tried to dismiss the keyboard, there would be a crash. Possible this is also what you're experiencing?

Resources