Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in FPRGaugeManager addGaugeData #7535

Closed
ivanrein opened this issue Feb 16, 2021 · 8 comments · Fixed by #7601
Closed

Crash in FPRGaugeManager addGaugeData #7535

ivanrein opened this issue Feb 16, 2021 · 8 comments · Fixed by #7601

Comments

@ivanrein
Copy link

ivanrein commented Feb 16, 2021

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.2
  • Firebase SDK version: 7.3.0
  • Installation method: CocoaPods
  • Firebase Component: Performance (Auth, Core, Database, Firestore, Messaging, Storage, etc)

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

Found crash with no known way to reproduce, about 40 crash for 30 days, so far found on iOS 13 and 14
All/most crash seems to happen some time after app returning to foreground

Crashed: com.google.perf.gaugeManager.gaugeData
0  libobjc.A.dylib                0x1974e5c90 objc_retain + 16
1  <appname>                      0x100e0e534 __32-[FPRGaugeManager addGaugeData:]_block_invoke + 4369573172
2  libdispatch.dylib              0x182d7a298 _dispatch_call_block_and_release + 24
3  libdispatch.dylib              0x182d7b280 _dispatch_client_callout + 16
4  libdispatch.dylib              0x182d23dcc _dispatch_lane_serial_drain$VARIANT$mp + 612
5  libdispatch.dylib              0x182d248a8 _dispatch_lane_invoke$VARIANT$mp + 424
6  libdispatch.dylib              0x182d2e338 _dispatch_workloop_worker_thread + 712
7  libsystem_pthread.dylib        0x1cb9695a4 _pthread_wqthread + 272
8  libsystem_pthread.dylib        0x1cb96c874 start_wqthread + 8
@maksymmalyhin
Copy link
Contributor

@ivanrein Thank you for reporting it.

It may be a concurrency issue. Could you please post stack traces for other threads to help us investigate?

@ivanrein
Copy link
Author

Hi @maksymmalyhin
here you go

traces.txt

@paulb777
Copy link
Member

The -[RBSConnection invalidateAssertion:error:] looks suspicious. Any more detail about the error generated there?

@ivanrein
Copy link
Author

Hi @paulb777
No, unfortunately that's everything I have.
I don't know what this RBSConnection is (not from our app), but let me know if I can put some logs in our app to provide more information about this.

@visumickey
Copy link
Contributor

@ivanrein Thanks for the trace logs. The crash log does not specify the thread that got crashed. In the trace logs, we could find the FirebasePerformance stack trace either. It would be helpful to get a couple more information about the crash:

  1. The stacktrace that contains the Firebase Performance classes
  2. Memory/CPU state of the app at the time of the crash (hopefully you have this information from the crashlytics logs)

@ivanrein
Copy link
Author

hi @visumickey
I put the stacktrace with Firebase performance class in my first post, so I didn't put it again in the txt file.
Here it is

Crashed: com.google.perf.gaugeManager.gaugeData
0  libobjc.A.dylib                0x1974e5c90 objc_retain + 16
1  <appname>                      0x100e0e534 __32-[FPRGaugeManager addGaugeData:]_block_invoke + 4369573172
2  libdispatch.dylib              0x182d7a298 _dispatch_call_block_and_release + 24
3  libdispatch.dylib              0x182d7b280 _dispatch_client_callout + 16
4  libdispatch.dylib              0x182d23dcc _dispatch_lane_serial_drain$VARIANT$mp + 612
5  libdispatch.dylib              0x182d248a8 _dispatch_lane_invoke$VARIANT$mp + 424
6  libdispatch.dylib              0x182d2e338 _dispatch_workloop_worker_thread + 712
7  libsystem_pthread.dylib        0x1cb9695a4 _pthread_wqthread + 272
8  libsystem_pthread.dylib        0x1cb96c874 start_wqthread + 8

Here's two device states at the time of crash.
image
image

@angelo-hub
Copy link

We've gotten these as well

@maksymmalyhin
Copy link
Contributor

The actual reason of the crash is not clear but a possible reason may the following. It looks like in some conditions FPRGaugeManager.gaugeData property may be accessed concurrently from different threads here:

NSArray *currentBatch = self.gaugeData;

and here:
[self.gaugeData addObject:gaugeData];

As this is the only possible reason related to the posted stack trace found we most likely will post a fix and see if the crash still happens.

cc @visumickey

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.