I'm seeing the following crash report, but it's not reproducible. How would I go about debugging it? Is this an AFNetworking issue? I'm using version 2.4.1.
Crashed: com.apple.NSURLSession-work
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000000000000
Thread : Crashed: com.apple.NSURLSession-work
0 CoreFoundation 0x0000000184aad978 CFDictionaryGetValue + 56
1 Foundation 0x0000000185aa9300 _NSSetLongLongValueAndNotify + 72
2 Foundation 0x0000000185aa9300 _NSSetLongLongValueAndNotify + 72
3 CFNetwork 0x0000000184543468 -[__NSCFLocalSessionTask _task_onqueue_didFinish] + 472
4 CFNetwork 0x0000000184544b38 -[__NSCFLocalSessionTask connection:didFinishLoadingWithError:] + 40
5 CFNetwork 0x000000018458d030 __46-[__NSCFURLSessionConnection _task_sendFinish]_block_invoke + 136
6 libdispatch.dylib 0x0000000196a49994 _dispatch_call_block_and_release + 24
7 libdispatch.dylib 0x0000000196a49954 _dispatch_client_callout + 16
8 libdispatch.dylib 0x0000000196a540a4 _dispatch_queue_drain + 1448
9 libdispatch.dylib 0x0000000196a4ca5c _dispatch_queue_invoke + 132
10 libdispatch.dylib 0x0000000196a56318 _dispatch_root_queue_drain + 720
11 libdispatch.dylib 0x0000000196a57c4c _dispatch_worker_thread3 + 108
12 libsystem_pthread.dylib 0x0000000196c2922c _pthread_wqthread + 816
Yes, it's probably an AFNetworking bug (fixed in 2.5.0), in all likelihood. Specifically, this one:
https://github.com/AFNetworking/AFNetworking/issues/1477
If not, then it is probably something similar—a key-value observer trying to observe some aspect of a URL session task has been deallocated and didn't stop observing that task prior to being deallocated.
I got the same issue and I found it is because I was using Firebase SDK and I upgraded it to 7.0.0,(Although this issue is reported by many developers from > 6.32.1 to 7.0.0) So the firebasePerformance is causing this issue in the first place, which later caused a crash while downloading images using SDWebImage. More information about this issue is here:
firebase/firebase-ios-sdk#6734
Firebase recently fixed this and released a new version for FirebasePerformance (7.0.1) After upgrading to version 7.0.1, I wasn't able to reproduce the crash any longer.
So upgrading of FirebasePerformance SDK to 7.0.1 version worked for me.
Related
I wrote a simple app with React Native targeting iOS. When I build the app in Xcode to test on simulators or my iPhone everything works perfectly. When I archive the build in Xcode and load it on my iPhone using the development option, it crashes when I press the only button on screen on start.
The app source code can be found on GitHub.
I am using React Native ~0.63.4 and React: 16.13.1 in a bare Expo workflow.
Third party dependencies:
#react-native-async-storage/async-storage
expo-constants
expo-notifications
uuid
react-native-date-picker
Here is a full crash report from the device logs: Google Drive
I'm at a loss trying to interpret the crash logs but the thread that crashes is exactly this everytime (except for the thread number):
Thread 3 name: Dispatch queue: com.facebook.react.ExceptionsManagerQueue
Thread 3 Crashed:
0 libsystem_kernel.dylib 0x00000001d285f414 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001eed77b40 pthread_kill + 272
2 libsystem_c.dylib 0x00000001aec84b74 abort + 104
3 libc++abi.dylib 0x00000001b9fbccf8 __cxxabiv1::__aligned_malloc_with_fallback+ 81144 (unsigned long) + 0
4 libc++abi.dylib 0x00000001b9fade4c demangling_unexpected_handler+ 20044 () + 0
5 libobjc.A.dylib 0x00000001b9eb6f64 _objc_terminate+ 28516 () + 144
6 libc++abi.dylib 0x00000001b9fbc0e0 std::__terminate(void (*)+ 78048 ()) + 20
7 libc++abi.dylib 0x00000001b9fbc06c std::terminate+ 77932 () + 44
8 libdispatch.dylib 0x00000001a5554dc4 _dispatch_client_callout + 40
9 libdispatch.dylib 0x00000001a555c10c _dispatch_lane_serial_drain + 580
10 libdispatch.dylib 0x00000001a555cc5c _dispatch_lane_invoke + 408
11 libdispatch.dylib 0x00000001a5566d78 _dispatch_workloop_worker_thread + 708
12 libsystem_pthread.dylib 0x00000001eed78804 _pthread_wqthread + 276
13 libsystem_pthread.dylib 0x00000001eed7f75c start_wqthread + 8
When I open the app while connected to my laptop and have the console for my iPhone open while crashing the app, I first get these messages under Errors and Faults:
error 16:14:06.383233-0500 remindrs Error: Requiring unknown module "undefined".
error 16:14:06.386759-0500 remindrs Unhandled JS Exception: Error: Requiring unknown module "undefined".
error 16:14:06.463315-0500 SpringBoard Ignoring state for untracked process [application<org.name.remindrs>:5966]: <RBSProcessState| task:none debug:none>
fault 16:14:06.559231-0500 SpringBoard Unable to move topic <private>, This topic was not in the list provided! APSTopicListOpportunistic
I've tried cleaning the build folder, turning off Swift compiler optimizations, and rearchived the project multiple times.
None of my searching has paid off and I'm not sure how to identify the issue I am having. I don't know if it is with React Native or with some configuration in Xcode.
Thank you for your help!
I solved the problem by removing a few lines of codes dealing with a Date. I'm not sure why this caused a crash in release and not debug but the problem is fixed!
We've had a few very bizarre crashes in our app recently. They are not reliably reproducable. The crashes have all occurred on iOS 11 devices so far. Our app is written in Swift 3.2. We are using Xcode 9.0.1 with the standard build system (not the new Swift build system). It seems that after performing a certain web request, the app crashes with the below stack trace:
Crashed: com.apple.main-thread
0 OurFramework 0x105283e84 __swift_deallocate_boxed_opaque_existential_0 + 2588
1 OurFramework 0x10528366c __swift_deallocate_boxed_opaque_existential_0 + 516
2 OurFramework 0x10528b368 swift_rt_swift_storeEnumTagSinglePayload + 24748
3 OurFramework 0x1052911cc swift_rt_swift_storeEnumTagSinglePayload + 48912
4 OurFramework 0x1052133d8 __swift_memmove_array32_8 + 1336
5 OurFramework 0x10521304c __swift_memmove_array32_8 + 428
6 OurFramework 0x105292504 swift_rt_swift_storeEnumTagSinglePayload + 53832
7 Alamofire 0x1057cac64 _T09Alamofire11DataRequestC8responseACXDSo13DispatchQueueCSg5queue_x0D10SerializeryAA0B8ResponseVy16SerializedObjectQzGc17completionHandlertAA0biH8ProtocolRzlFyycfU_yycfU_AA0biH0VyypG_Tg5 + 264
8 Alamofire 0x1057ca3f8 _T0Ix_IyB_TR + 36
9 libdispatch.dylib 0x1860c5088 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x1860c5048 _dispatch_client_callout + 16
11 libdispatch.dylib 0x1860d1b74 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1016
12 CoreFoundation 0x1866e9eb0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
13 CoreFoundation 0x1866e7a8c __CFRunLoopRun + 2012
14 CoreFoundation 0x186607fb8 CFRunLoopRunSpecific + 436
15 GraphicsServices 0x18849ff84 GSEventRunModal + 100
16 UIKit 0x18fbdc2e8 UIApplicationMain + 208
17 OurApp 0x104de98b0 main (main.swift:19)
18 libdyld.dylib 0x18612a56c start + 4
We are using Crashlytics to track our crashes and I'm not sure if it's because of a symbolication issue that I don't see more info than this but the trace indicates that something is going awry during a web request. Our app uses Alamofire to make web requests. Results from our testing where this crash occurred also support this theory since the crashes always occurred right after the app made a request to our backend. Could it be that in iOS 11 something changed in the underlying NSURLSession that Alamofire uses? Maybe iOS 11 is using a different caching strategy or something that's causing alamofire to invoke our result completion handler in a way that causes this crash? Has anyone seen this kind of crash before? What do __swift_deallocate_boxed_opaque_existential and swift_rt_swift_storeEnumTagSinglePayload mean? Any help is greatly appreciated, thank you!
Xcode 9 seems to be reporting a lot of Main thread calls to UIApplication properties. Even though the UI is not being updated this is particularly cumbersome due to the extension of logs it produces a default environment.
4 TestApp 0x0000000101c262e0 __39-[ViewController viewDidLoad]_block_invoke + 196
5 libdispatch.dylib 0x0000000102279654 _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x0000000102279614 _dispatch_client_callout + 16
7 libdispatch.dylib 0x0000000102289008 _dispatch_queue_serial_drain + 716
8 libdispatch.dylib 0x000000010227ce58 _dispatch_queue_invoke + 340
9 libdispatch.dylib 0x000000010228a1c4 _dispatch_root_queue_drain_deferred_wlh + 412
10 libdispatch.dylib 0x00000001022917fc _dispatch_workloop_worker_thread + 868
11 libsystem_pthread.dylib 0x00000001ac6771e8 _pthread_wqthread + 924
12 libsystem_pthread.dylib 0x00000001ac676e40 start_wqthread + 4
If these reporting messages confuse you uncheck them:
Edit Scheme...
Uncheck "Main Thread Checker" in Run > Diagnostics
Check also ARKit template Xcode project Main Thread Checker log console.
If UIApplication or UIApplicationDelegate method is called from another thread you can disable checking thread as in CGN answer, but it will disable this checker completely. You can also subclass what is necessary and call metod of superclass on main thread. This way you can still use Main Thread Sanitizer in other places in code
I'm using FMDB in an iOS app. Recently I have received several crash reports from Apteligent about a crash of FMDB:
0 libdispatch.dylib 0x00000001810ab120 _dispatch_main_queue_callback_4CF + 2904
! 1 myApp 0x00000001001ac840 -[FMDatabaseQueue inDatabase:] (FMDatabaseQueue.m:142)
2 myApp 0x000000010011844c +[DataBaseController insert:withObjects:] (DataBaseController.m:602)
3 myApp 0x0000000100118254 +[DataBaseController insertObjects:withObjects:] (DataBaseController.m:575)
4 myApp 0x0000000100150e80 -[SendManagementBBDD crearySalvarEnvioConSolicitud:EntidadParaEncolar:borrarTrasEnvio:] (SendManagementBBDD.m:686)
5 myApp 0x0000000100150a28 __76-[SendManagementBBDD sendEntitiesAfterDetail:OnComplete:]_block_invoke (SendManagementBBDD.m:615)
6 libdispatch.dylib 0x00000001810a55f0 _dispatch_client_callout + 12
7 libdispatch.dylib 0x00000001810b0b94 _dispatch_sync_f_invoke + 68
8 myApp 0x0000000100150404 -[SendManagementBBDD sendEntitiesAfterDetail:OnComplete:] (SendManagementBBDD.m:563)
9 myApp 0x000000010005c284 __44-[DetailVC startWork:]_block_invoke (DetailVC.m:286)
10 libdispatch.dylib 0x00000001810a5630 _dispatch_call_block_and_release + 20
11 libdispatch.dylib 0x00000001810a55f0 _dispatch_client_callout + 12
12 libdispatch.dylib 0x00000001810b3a88 _dispatch_root_queue_drain + 2136
13 libdispatch.dylib 0x00000001810b3224 _dispatch_worker_thread3 + 108
14 libsystem_pthread.dylib 0x00000001812b9470 _pthread_wqthread + 1088
15 libsystem_pthread.dylib 0x00000001812b9020 start_wqthread + 0
I access to the database from multiple threads. As the documentation says, I have a single instance of FMDatabaseQueue and I share it across all the threads of the app. I'm getting a SEGV_MAPERR crash at the method [FMDatabaseQueue inDatabase:]
This crash happens hardly ever, but I would like to resolve it.
Any ideas what is causing it?
Thank you very much.
Like your other question, this crash seems to be a part of your app code and not Crittercism SDK. If you still believe that this has been caused due to Crittercism, you can create a support ticket by sending an email to support#apteligent.com by mentioning the concerned App ID and the direct crash URL. Be noted that the email support is available for paid customers only.
I'm getting crash reports of AFNetworking throwing an EXC_BAD_ACCESS KERN_INVALID_ADDRESS:
Thread : Crashed: com.apple.root.default-priority
0 libobjc.A.dylib 0x39e237fa objc_release + 9
1 MY_APP 0x0015ba63 __64-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke (AFHTTPRequestOperation.m:266)
2 MY_APP 0x00163bf7 __47-[AFURLConnectionOperation setCompletionBlock:]_block_invoke (AFURLConnectionOperation.m:301)
3 Foundation 0x3049a2a9 __103+[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:]_block_invoke96 + 12
4 libdispatch.dylib 0x3a30b0c3 _dispatch_call_block_and_release + 10
5 libdispatch.dylib 0x3a3107d9 _dispatch_root_queue_drain + 224
6 libdispatch.dylib 0x3a3109c5 _dispatch_worker_thread2 + 56
7 libsystem_pthread.dylib 0x3a43adff _pthread_wqthread + 298
I need help to understand the possible bug. This is something that happens sometimes, actually is very rare and it could be related to a timeout issue when user is using 3G (network can be disconnected while loading data).
I don't post my code because I can't find on the crash log in which file or class this crash happened and I use AFNetworking in a lot of files.
Without any code this is all conjecture but:
Something in the completion block is being accessed after it is deallocated. Commonly, this happens when a network operation isn't cancelled after a view controller is dismissed.