Crash in ios 6 and later -[MKStoreManager provideContent:forReceipt:] - iphone

I have my app live which is non-consumable type.
App is crashing on iOS 6 and later. It is crashing on user's device but not on testing device.
Crash log says this:
Exception Type: SIGTRAP
Exception Codes: #0 at 0x3350316c
Crashed Thread: 0
Thread 0 Crashed:
0 CoreFoundation 0x3350316c _CFHash + 8
1 CoreFoundation 0x00002b50 CFBasicHashFindBucket + 1892
2 CoreFoundation 0x33503a8b _CFDictionaryGetValue + 83
3 CoreFoundation 0x0004a7a7 -[CFXPreferencesPropertyListSource setValue:forKey:] + 39
4 CoreFoundation 0x0004a723 _CFXPreferencesSetValue + 135
5 CoreFoundation 0x3354a601 _CFPreferencesSetAppValue + 41
6 Foundation 0x00009907 -[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 83
7 myAppName 0x00038287 -[MKStoreManager provideContent:forReceipt:] (MKStoreManager.m:311)
8 myAppName 0x000387b1 -[MKStoreObserver restoreTransaction:] (MKStoreObserver.m:88)
9 myAppName 0x000385e1 -[MKStoreObserver paymentQueue:updatedTransactions:] (MKStoreObserver.m:64)
10 StoreKit 0x0000404d __NotifyObserverAboutChanges + 85
11 CoreFoundation 0x3350874d _CFArrayApplyFunction + 177
12 StoreKit 0x00003fe9 -[SKPaymentQueue _notifyObserversAboutChanges:sendUpdatedDownloads:] + 129
13 StoreKit 0x000048af -[SKPaymentQueue _processUpdates:trimUnmatched:sendUpdatedDownloads:] + 999
14 StoreKit 0x00004f8d -[SKPaymentQueue _setTransactionsWithReply:] + 157
15 StoreKit 0x00003b8b __block_global_0 + 63
16 libdispatch.dylib 0x0000211f _dispatch_call_block_and_release + 11
17 libdispatch.dylib 0x000014b7 _dispatch_client_callout + 23
18 libdispatch.dylib 0x000061bd _dispatch_main_queue_callback_4CF$VARIANT$mp + 225
19 CoreFoundation 0x00095f3b __CFRunLoopRun + 1291
20 CoreFoundation 0x33508ebd _CFRunLoopRunSpecific + 357
21 CoreFoundation 0x33508d49 _CFRunLoopRunInMode + 105
22 GraphicsServices 0x370bb2eb _GSEventRunModal + 75
23 UIKit 0x3541e301 _UIApplicationMain + 1121
24 myAppName 0x0000260f main (main.m:20)
This app supports iOS 4.3 and later.
I have tried in many ways but can't find proper solution. Anyone have any idea how I resolve this? Should I use some other code for in-app purchase?

Related

GULUserDefaults crash Swift Xcode (maybe firebase)

I am facing this error really randomly and rarely but still want to fix it. I don't know how to reproduce it as its not happening on my device but on other users devices.
The crash log does not really help me, at least I cannot figure out where the is issue is coming from and how to solve it.
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000000000001c
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x19fa3513c object_isClass + 16
1 Foundation 0x18c807978 KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 48
2 Foundation 0x18c807774 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 288
3 Foundation 0x18c7413f8 -[NSObject(NSKeyValueObservingPrivate) _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:] + 836
4 CoreFoundation 0x18b3cc60c -[CFPrefsSource forEachObserver:] + 336
5 CoreFoundation 0x18b3cde3c -[CFPrefsSource _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:] + 112
6 CoreFoundation 0x18b541b68 ___CFPrefsDeliverPendingKVONotificationsGuts_block_invoke + 428
7 CoreFoundation 0x18b4253f0 __CFDictionaryApplyFunction_block_invoke + 28
8 CoreFoundation 0x18b50bd94 CFBasicHashApply + 144
9 CoreFoundation 0x18b4253ac CFDictionaryApplyFunction + 240
10 CoreFoundation 0x18b53d748 _CFPrefsDeliverPendingKVONotificationsGuts + 300
11 CoreFoundation 0x18b53bf44 -[_CFXPreferences _deliverPendingKVONotifications] + 96
12 CoreFoundation 0x18b4ff194 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 432
13 CoreFoundation 0x18b4fe720 normalizeQuintuplet + 356
14 CoreFoundation 0x18b4fefbc -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 152
15 CoreFoundation 0x18b3c1580 -[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:] + 128
16 CoreFoundation 0x18b53fdd8 _CFPreferencesSetAppValueWithContainerAndConfiguration + 136
17 GoogleUtilities 0x1012a7acc -[GULUserDefaults setObject:forKey:] + 109 (GULUserDefaults.m:109)
18 FirebaseMessaging 0x1011a86b0 -[FIRMessagingPubSub archivePendingTopicsList:] + 238 (FIRMessagingPubSub.m:238)
19 FirebaseMessaging 0x1011a67d4 -[FIRMessagingPendingTopicsList addOperationForTopic:withAction:completion:] + 164 (FIRMessagingPendingTopicsList.m:164)
20 FirebaseMessaging 0x1011a8304 -[FIRMessagingPubSub subscribeToTopic:handler:] + 184 (FIRMessagingPubSub.m:184)
21 FirebaseMessaging 0x1011a16a8 __44-[FIRMessaging subscribeToTopic:completion:]_block_invoke + 674 (FIRMessaging.m:674)
22 FirebaseInstanceID 0x101166674 __39-[FIRInstanceID instanceIDWithHandler:]_block_invoke + 220 (FIRInstanceID.m:220)
23 FirebaseInstanceID 0x101167ee8 __34-[FIRInstanceID getIDWithHandler:]_block_invoke + 454 (FIRInstanceID.m:454)
24 FirebaseInstallations 0x1011378a8 __49-[FIRInstallations installationIDWithCompletion:]_block_invoke + 210 (FIRInstallations.m:210)
25 FBLPromises 0x100deda48 __56-[FBLPromise chainOnQueue:chainedFulfill:chainedReject:]_block_invoke.48 + 273 (FBLPromise.m:273)
26 libdispatch.dylib 0x18b0d324c _dispatch_call_block_and_release + 32
27 libdispatch.dylib 0x18b0d4db0 _dispatch_client_callout + 20
28 libdispatch.dylib 0x18b0e2800 _dispatch_main_queue_callback_4CF + 920
29 CoreFoundation 0x18b45c11c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
30 CoreFoundation 0x18b456120 __CFRunLoopRun + 2508
31 CoreFoundation 0x18b45521c CFRunLoopRunSpecific + 600
32 GraphicsServices 0x1a24d4784 GSEventRunModal + 164
33 UIKitCore 0x18de8e200 -[UIApplication _run] + 1072
34 UIKitCore 0x18de93a74 UIApplicationMain + 168
35 MyApp 0x100424788 main + 20 (HashtagTableViewCell.swift:20)
36 libdyld.dylib 0x18b1156c0 start + 4
It looks like its coming from firebase but ultimately it crashes on the user defaults.
Any idea or hint how to solve this is greatly appreciated.
GULUserDefaults.m line 109
this is the headline of the crash in my firebase Crashlytics

Flutter crash - Fatal Exception: NSInvalidArgumentException

I am getting crash in flutter firebase database , here is the crash log on crashlytics
Fatal Exception: NSInvalidArgumentException
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x19f11098c __exceptionPreprocess
1 libobjc.A.dylib 0x19ee390a4 objc_exception_throw
2 CoreFoundation 0x19f1663f8 -[__NSCFString characterAtIndex:].cold.1
3 CoreFoundation 0x19f16f75c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.5
4 CoreFoundation 0x19effd5dc -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
5 CoreFoundation 0x19efef470 +[NSDictionary dictionaryWithObjects:forKeys:count:]
6 Runner 0x104e69a44 __53-[FLTFirebaseDatabasePlugin handleMethodCall:result:]_block_invoke.437 + 292 (FLTFirebaseDatabasePlugin.m:292)
7 Runner 0x104d469bc __39-[FRepo abortTransactionsAtNode:error:]_block_invoke + 1426 (FRepo.m:1426)
8 libdispatch.dylib 0x19eddd610 _dispatch_call_block_and_release
9 libdispatch.dylib 0x19edde184 _dispatch_client_callout
10 libdispatch.dylib 0x19ed901d0 _dispatch_main_queue_callback_4CF$VARIANT$mp
11 CoreFoundation 0x19f08e3c4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
12 CoreFoundation 0x19f0893b8 __CFRunLoopRun
13 CoreFoundation 0x19f0888bc CFRunLoopRunSpecific
14 GraphicsServices 0x1a8ef4328 GSEventRunModal
15 UIKitCore 0x1a311e6d4 UIApplicationMain
16 Runner 0x104cb0e58 main + 8 (AppDelegate.swift:8)
17 libdyld.dylib
0x19ef13460 start
Crashed: com.twitter.crashlytics.ios.exception
SIGABRT ABORT 0x000000019ef08ebc
Crashed: com.twitter.crashlytics.ios.exception
0 Runner 0x104cca6bc CLSProcessRecordAllThreads + 4329924284
1 Runner 0x104ccaaa4 CLSProcessRecordAllThreads + 4329925284
2 Runner 0x104cba310 CLSHandler + 4329857808
3 Runner 0x104cc8cb4 __CLSExceptionRecord_block_invoke + 4329917620
4 libdispatch.dylib 0x19edde184 _dispatch_client_callout + 16
5 libdispatch.dylib 0x19ed90c44 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 Runner 0x104cc8720 CLSExceptionRecord + 4329916192
7 Runner 0x104cc854c CLSExceptionRecordNSException + 4329915724
8 Runner 0x104cc8140 CLSTerminateHandler() + 4329914688
9 libc++abi.dylib 0x19eede304 std::__terminate(void (*)()) + 16
10 libc++abi.dylib 0x19eede29c std::terminate() + 44
11 libobjc.A.dylib 0x19ee392dc _objc_terminate() + 10
12 libdispatch.dylib 0x19edde198 _dispatch_client_callout + 36
13 libdispatch.dylib 0x19ed901d0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1044
14 CoreFoundation 0x19f08e3c4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
15 CoreFoundation 0x19f0893b8 __CFRunLoopRun + 2004
16 CoreFoundation 0x19f0888bc CFRunLoopRunSpecific + 464
17 GraphicsServices 0x1a8ef4328 GSEventRunModal + 104
18 UIKitCore 0x1a311e6d4 UIApplicationMain + 1936
19 Runner 0x104cb0e58 main + 8 (AppDelegate.swift:8)
20 libdyld.dylib 0x19ef13460 start + 4
If the question is about why the exception
appears to be showing Crashlytics frames, it's known behavior and it's just an artifact of how Crashlytics attempts to write crash information during crash time. It doesn't indicate that Crashlytics itself is causing an issue. https://docs.fabric.io/apple/crashlytics/advanced-setup.html#crashlytics-frames-appearing-in-crashes

AFNetworking and NSBlockOperation crash

Running an iPhone app using the latest version of AFNetworking, the most popular crash according to Crashlytics is involving NSBlockOperation. I am unsure whether AFNetworking is responsible or not. The log from Crashlytics:
Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0x2985118298
5com.apple.NSURLConnectionLoader Crashed
0 libobjc.A.dylib objc_msgSend + 9
1 Foundation -[NSBlockOperation main] + 200
2 Foundation -[__NSOperationInternal start] + 840
3 Foundation -[_NSCFURLProtocolBridgeWithTrampoline processEventQ] + 344
4 Foundation -[_NSCFURLProtocolBridgeWithTrampoline pushEvent:from:] + 298
5 Foundation -[_NSCFURLProtocolBridge stop] + 88
6 Foundation _bridger + 64
7 CFNetwork __block_global_7 + 24
8 CFNetwork __block_global_8 + 12
9 CFNetwork ___performAsync_block_invoke_068 + 18
10 CoreFoundation CFArrayApplyFunction + 176
11 CFNetwork RunloopBlockContext::perform() + 74
12 CFNetwork MultiplexerSource::perform() + 188
13 ... CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
14 CoreFoundation __CFRunLoopDoSources0 + 212
15 CoreFoundation __CFRunLoopRun + 646
16 CoreFoundation CFRunLoopRunSpecific + 356
17 CoreFoundation CFRunLoopRunInMode + 104
18 Foundation +[NSURLConnection(Loader) _resourceLoadLoop:] + 308
19 Foundation __NSThread__main__ + 972
20 libsystem_c.dylib _pthread_start + 308
Let me know if you need more logs. Can anybody direct me in the direction to avoid this crash? Out of 2500 users 76 users has been affected.
Update Sept 17:
Seems like this guy is having the same problem:
iOS Blocks Async Callbacks Causing Crash after View Controller is deallocated.

Mysterious app crash after AppStore update

We have released an app to the AppStore and after an update it crashes after trying to login. We have been heavily relying on a CoreData database in it and we think it is the reason of the crash. Nevertheless I couldn't get any valuable info from the device, just a crash log that features some thread information. Here's how it looks:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xd0000008
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x32b3e5b0 objc_msgSend + 16
1 Foundation 0x337cbd18 -[NSError dealloc] + 56
2 libobjc.A.dylib 0x32b40484 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 164
3 CoreFoundation 0x31bc843c _CFAutoreleasePoolPop + 12
4 Foundation 0x337ccf76 -[NSAutoreleasePool drain] + 118
5 CoreData 0x32f6d4ae -[NSManagedObjectContext save:] + 1206
6 ourapp 0x0012fbf8 0xba000 + 482296
7 CoreData 0x32f70bbe developerSubmittedBlockToNSManagedObjectContextPerform + 86
8 CoreData 0x32f70cee -[NSManagedObjectContext performBlockAndWait:] + 90
9 ourapp 0x0012fb4c 0xba000 + 482124
10 ourapp 0x000c4e08 0xba000 + 44552
11 ourapp 0x000cced4 0xba000 + 77524
12 ourapp 0x000db50a 0xba000 + 136458
13 ourapp 0x0014c41a 0xba000 + 599066
14 Foundation 0x33893ef2 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 14
15 Foundation 0x337d39ec -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 196
16 Foundation 0x337d3908 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 56
17 CFNetwork 0x38da65dc ___delegate_didFinishLoading_block_invoke_0 + 24
18 CFNetwork 0x38da5cc8 ___withDelegateAsync_block_invoke_0 + 52
19 CFNetwork 0x38dce130 ___performAsync_block_invoke_068 + 16
20 CoreFoundation 0x31bcb74a CFArrayApplyFunction + 174
21 CFNetwork 0x38dce58e RunloopBlockContext::perform() + 70
22 CFNetwork 0x38d3215a MultiplexerSource::perform() + 186
23 CoreFoundation 0x31c5a680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
24 CoreFoundation 0x31c59f7a __CFRunLoopDoSources0 + 358
25 CoreFoundation 0x31c58cb2 __CFRunLoopRun + 642
26 CoreFoundation 0x31bcbeb8 CFRunLoopRunSpecific + 352
27 CoreFoundation 0x31bcbd44 CFRunLoopRunInMode + 100
28 GraphicsServices 0x399c92e6 GSEventRunModal + 70
29 UIKit 0x394872f4 UIApplicationMain + 1116
30 ourapp 0x000be76a 0xba000 + 18282
31 ourapp 0x000bb684 0xba000 + 5764
Are there any other chances I can get more info out of this situation? How can I plug it in to XCode and possibly trace the crash or it can only be done post-factum?
And most importantly, what do you think is causing the crash?
Our problem was connected with Core Data lightweight migration. We were using the "Magical Record" library for handling our Core Data fetches and updating it solved the problem.
Also, this blog post was quite useful.

good methods to debug iOS exception

i want to debug my exception at my app,i have read
Debugging -[NSCFDictionary setObject:forKey:]: attempt to insert nil value add so on,but these methods is happen at i am running my app,so i can use add an Exception breakpoint, click the Add (+) button at the bottom of the breakpoints list and click Add Exception Breakpoint ,and use gcc command line怂but my question is if user give me a crash report,the bug not easy happen,how to solve it ,for example:
Application received signal SIGSEGV
(null)
(
0 CoreFoundation 0x3120e2bb + 186
1 libobjc.A.dylib 0x38f2b97f objc_exception_throw + 30
2 CoreFoundation 0x3120e1c5 + 0
3 myshine 0x001f9f51 myshine + 1503057
4 libsystem_c.dylib 0x393a9e8b _sigtramp + 34
5 myshine 0x000ac985 myshine + 137605
6 myshine 0x000ac35d myshine + 136029
7 CoreFoundation 0x311ab7cf + 74
8 CoreFoundation 0x311b1623 + 74
9 CoreFoundation 0x311ab507 + 326
10 CFNetwork 0x30f0fa8b + 98
11 CFNetwork 0x30f0ec71 + 36
12 CFNetwork 0x30f11365 + 44
13 CFNetwork 0x30f110f9 + 88
14 CFNetwork 0x30f114ff + 34
15 CFNetwork 0x30ed0ce1 + 324
16 CFNetwork 0x30ed1661 + 156
17 CFNetwork 0x30f0ec71 + 36
18 CFNetwork 0x30f11365 + 44
19 CoreFoundation 0x311e3683 + 14
20 CoreFoundation 0x311e2ee9 + 212
21 CoreFoundation 0x311e1cb7 + 646
22 CoreFoundation 0x31154ebd CFRunLoopRunSpecific + 356
23 CoreFoundation 0x311b39bb CFRunLoopRun + 98
24 myshine 0x000b20ef myshine + 159983
25 Foundation 0x31b24e85 + 972
26 libsystem_c.dylib 0x39382311 + 308
27 libsystem_c.dylib 0x393821d8 thread_start + 8
)
and
*** -[__NSArrayM objectAtIndex:]: index 121 beyond bounds [0 .. 23]
(
0 CoreFoundation 0x311963ff + 186
1 libobjc.A.dylib 0x38e87963 objc_exception_throw + 30
2 CoreFoundation 0x310e1ef9 + 164
3 myshine 0x001720b1 myshine + 1372337
4 UIKit 0x33090087 + 70
5 UIKit 0x3309003b + 30
6 UIKit 0x33090015 + 44
7 UIKit 0x3308f8cb + 502
8 UIKit 0x3308fdb9 + 488
9 UIKit 0x32fb85f9 + 524
10 UIKit 0x32fa58e1 + 380
11 UIKit 0x32fa51ef + 6198
12 GraphicsServices 0x34cbc5f7 + 590
13 GraphicsServices 0x34cbc227 + 34
14 CoreFoundation 0x3116b3e7 + 34
15 CoreFoundation 0x3116b38b + 138
16 CoreFoundation 0x3116a20f + 1382
17 CoreFoundation 0x310dd23d CFRunLoopRunSpecific + 356
18 CoreFoundation 0x310dd0c9 CFRunLoopRunInMode + 104
19 GraphicsServices 0x34cbb33b GSEventRunModal + 74
20 UIKit 0x32ff92b9 UIApplicationMain + 1120
21 myshine 0x00026ec7 myshine + 16071
22 myshine 0x00025660 myshine + 9824
)
through i know NSArray beyond bounds,but my app have many many NSArray,and they are user report,can you give me some easy methods to find the location?
From your question what I understood is you want the method which has produced the crash in your app. May be this can help you Symbolicating iPhone App Crash Reports.