firebase-ios-sdk
firebase-ios-sdk copied to clipboard
Crash at FPRTraceBackgroundActivityTracker.m
Crash at FPRTraceBackgroundActivityTracker.m
Here is stacktrace
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x9748 objc_moveWeak + 196
1 CoreFoundation 0x50a94 _CFXNotificationRegistrarAddObserver + 392
2 CoreFoundation 0x4f864 CFXNotificationRegistrarAdd + 580
3 CoreFoundation 0x4f040 _CFXNotificationRegisterObserver + 248
4 FirebasePerformance 0x1c9f4 __41-[FPRTraceBackgroundActivityTracker init]_block_invoke + 44 (FPRTraceBackgroundActivityTracker.m:44)
5 libdispatch.dylib 0x213c _dispatch_call_block_and_release + 32
6 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20
7 libdispatch.dylib 0x125a4 _dispatch_main_queue_drain + 988
8 libdispatch.dylib 0x121b8 _dispatch_main_queue_callback_4CF + 44
9 CoreFoundation 0x56710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
10 CoreFoundation 0x53914 __CFRunLoopRun + 1996
11 CoreFoundation 0x52cd8 CFRunLoopRunSpecific + 608
12 GraphicsServices 0x11a8 GSEventRunModal + 164
13 UIKitCore 0x40a90c -[UIApplication _run] + 888
14 UIKitCore 0x4be9d0 UIApplicationMain + 340
15 App 0x844f4 main + 36 (KAAppDelegate.swift:36)
16 ??? 0x1c3b51e4c (Missing)
Reproducing the issue
We don't know a 100% way to reproduce it, but looks like the crash happens when user moves app to background and then back to the foreground
Firebase SDK Version
11.6.0
Xcode Version
16.1
Installation Method
CocoaPods
Firebase Product(s)
Performance, Crashlytics, Remote Config, Analytics
Targeted Platforms
iOS
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
I am unable to reproduce this issue, is there any more information you can give?
@MichaelVerdon I have investigated the analytics and most of the time the crash happens when user moves app to the background and then returns it to the foreground or during the first app launch. But sometimes it happens randomly, so I hope this information will help you
Thanks for your response, when I failed to reproduce the issue I had ran a bunch of simulations but I was using the latest IOS version, is this issue happening on a particular IOS version like an older one?
@MichaelVerdon not really, it reproducible for any of these versions: 17.4.1, 18.1.1, 18.0.1, 17.4.0, 17.6.1, 16.6.0 and others. There is no specific version to reproduce it.
I also found a little bit more verbose stacktrace, I hope that it could help you somehow
Crashed: org.alamofire.session.rootQueue
0 libobjc.A.dylib 0xfda8 objc_moveWeak + 196
1 CoreFoundation 0x554c4 _CFXNotificationRegistrarAddObserver + 392
2 CoreFoundation 0x54f0c CFXNotificationRegistrarAdd + 580
3 CoreFoundation 0x54880 _CFXNotificationRegisterObserver + 248
4 FirebasePerformance 0x1c7b8 -[FPRTraceBackgroundActivityTracker init] + 44 (FPRTraceBackgroundActivityTracker.m:44)
5 FirebasePerformance 0x11bf4 -[FPRNetworkTrace start] + 198 (FPRNetworkTrace.m:198)
6 FirebasePerformance 0x17a68 __InstrumentDataTaskWithRequest_block_invoke + 276 (FPRNSURLSessionInstrument.m:276)
7 Alamofire 0x2d82c DataStreamRequest.task(for:using:) + 122 (DataRequest.swift:122)
8 Alamofire 0xbc690 Session.didCreateURLRequest(_:for:) + 1188 (Session.swift:1188)
9 Alamofire 0xca120 partial apply for closure #3 in Session.performSetupOperations(for:convertible:shouldCreateTask:) + 72
10 Alamofire 0x88dc4 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:28)
11 libdispatch.dylib 0x213c _dispatch_call_block_and_release + 32
12 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20
13 libdispatch.dylib 0xb400 _dispatch_lane_serial_drain + 748
14 libdispatch.dylib 0xbf64 _dispatch_lane_invoke + 432
15 libdispatch.dylib 0xb284 _dispatch_lane_serial_drain + 368
16 libdispatch.dylib 0xbf30 _dispatch_lane_invoke + 380
17 libdispatch.dylib 0x16cb4 _dispatch_root_queue_drain_deferred_wlh + 288
18 libdispatch.dylib 0x16528 _dispatch_workloop_worker_thread + 404
19 libsystem_pthread.dylib 0x1f20 _pthread_wqthread + 288
20 libsystem_pthread.dylib 0x1fc0 start_wqthread + 8
Also, here is the link to the previous issue that has been fixed in 11.6.0. Probably, that fix may be connected to the new issues that I created.
Thanks for more logs, I have still been unable to recreate the issue, you could tediously go through every dependency and see which could be the culprit but I heavily suspect AlamoFire might be heavily involved. After running more tests with AlamoFire, I have yet to get a crash, especially moving back to background and foreground. Would you be able to give me a repository to look at and investigate?
@MichaelVerdon Unfortunately I couldn't give you the access to the repository =(
Same problem with same stack trace. Any idea how to fix?
@visumickey
Hello everyone
Doing research into this and I will have a fix soon (hopefully!) 😸
@JesusRojass any update on this issue? It is causing a large number of crashes in our app.
@clayjonezie Hello there
yes actually! I am gearing up to push a fix for this this week, though I would absolutely love if you could share some stack traces so I can take a quick look and see if I'm not missing anything
Hello everyone
I am extremly sorry for the delay on this but I am currently checking the fix and solution to this issue
Just running several tests to check for flakiness and edge cases but it is coming!
Good morning or afternoon or evening ya'll I have pushed a PR that adresses this crash, just waiting on review
Happy Monday and Happy Coding 🤓
Hello hello there
The fix has been made and it's been merged This issue should now be addressed
If anything you know you can reach me and I will gladly help!
Thank you all for the patience and information!
Keep on keeping on!