firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.67k stars 1.49k forks source link

Crash - FPRMakeFirstSessionVerbose in FPRNanoPbUtils.m #10522

Open tamv-ika opened 1 year ago

tamv-ika commented 1 year ago

Description

Hi, I got a crash happen with Firebase SDK This related to this issue #8139 and mark fixed #8189, but on the version I'm using 8.15.0 this crash still happen. I cannot reproduce this crash

Reproducing the issue

Cannot reproduce this crash, this crash is show in the Firebase crash analytics

Firebase SDK Version

8.15.0

Xcode Version

14.1

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics, Crashlytics, Performance

Targeted Platforms

iOS

Relevant Log Output

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x9e88 __exceptionPreprocess
1  libobjc.A.dylib                0x178d8 objc_exception_throw
2  CoreFoundation                 0x17e84c +[NSObject(NSObject) _copyDescription]
3  CoreFoundation                 0x1ffa0 ___forwarding___
4  CoreFoundation                 0x88350 _CF_forwarding_prep_0
5  MyApp                       0x1563cac FPRMakeFirstSessionVerbose + 456 (FPRNanoPbUtils.m:456)
6  MyApp                       0x1563af8 FPRGetTraceMetric + 286 (FPRNanoPbUtils.m:286)
7  MyApp                       0x1561250 __22-[FPRClient logTrace:]_block_invoke + 174 (FPRClient.m:174)
8  libdispatch.dylib              0x24b4 _dispatch_call_block_and_release
9  libdispatch.dylib              0x3fdc _dispatch_client_callout
10 libdispatch.dylib              0xb774 _dispatch_lane_serial_drain
11 libdispatch.dylib              0xc1e0 _dispatch_lane_invoke
12 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread
13 libsystem_pthread.dylib        0xdf8 _pthread_wqthread
14 libsystem_pthread.dylib        0xb98 start_wqthread

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

No response

google-oss-bot commented 1 year ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

rizafran commented 1 year ago

Hi @tamv-ika, is this issue also reproducible on the latest SDK version?

tamv-ika commented 1 year ago

HI @rizafran, this issue is reported from firebase crashlytics. The version shipped with our products is 8.15.0, I haven't updated the SDK to the lastest, so I don't know does this crash happen on the lastest one. Do you have any suggestion?

rizafran commented 1 year ago

Thanks for letting me know, @tamv-ika. For now, what I may suggest is to check if the issue is reproducible with any memory debugging tools (like zombies, asan) to isolate it.

tamv-ika commented 1 year ago

@rizafran for now, I can't reproduce this crash in our enviroment, none of this crash has been reported when we were developing or testing. This crash happen to the published application. Do you have any guess?

tamvutdt commented 1 year ago

@rizafran are you at work today? Please help me or suggest me some solutions to this issue. Thank you so much.

paulb777 commented 1 year ago

@tamv-ika See https://developer.apple.com/forums/thread/92102

visumickey commented 1 year ago

@tamv-ika Thanks for sharing the stack trace. Can you share the other threads for this crash? I'm looking at a potential race condition that could happen and it would be helpful to see if we are able to see other thread to validate that theory.

tamv-ika commented 1 year ago

@visumickey Thanks for investigating. The crash that I grabbed is from Crashlytics, it's unable to get all threads' stack trace at the time of crash. If your theory is right, it's still very difficult to verify or reproduce this crash because we are running in a multithreaded environment. I think we should dig down into the code and found the potential race condition, and keep tracing further to validate your theory.