Skip to content

Crash in FPRGaugeManager addGaugeData #7535

Closed

Description

@ivanrein

[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

Activity

  1. maksymmalyhin commented on Feb 16, 2021

    @maksymmalyhin
    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?

  2. ivanrein commented on Feb 17, 2021

    @ivanrein
    Author

    Hi @maksymmalyhin
    here you go

    traces.txt

  3. paulb777 commented on Feb 18, 2021

    @paulb777
    Member

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

  4. ivanrein commented on Feb 18, 2021

    @ivanrein
    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.

  5. visumickey commented on Feb 18, 2021

    @visumickey
    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)
  6. ivanrein commented on Feb 19, 2021

    @ivanrein
    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

  7. angelo-hub commented on Feb 24, 2021

    @angelo-hub

    We've gotten these as well

  8. maksymmalyhin commented on Feb 24, 2021

    @maksymmalyhin
    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

  9. added a commit that references this issue on Feb 24, 2021
    5061c11
  10. added this to the 7.8.0 - M91 milestone on Feb 25, 2021
  11. locked and limited conversation to collaborators on Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions