firebase-ios-sdk: Crashed: com.google.iid-token-operations (QOS: UTILITY)

Environment

  • Xcode version: 8.3.3
  • Firebase SDK version: 4.4.0

POD file

    pod 'Google-Mobile-Ads-SDK', '7.17.0'
    pod 'Firebase', '~> 4.4'
    pod 'FirebaseAnalytics', '~> 4.0'
    pod 'FirebaseRemoteConfig', '~> 2.0'
    pod 'ATInternet-iOS-ObjC-SDK', '~> 2.2'
    pod 'GoogleTagManager', '~> 6.0'

Resuted pod file Lock

- Firebase (4.4.0):
    - Firebase/Core (= 4.4.0)
  - Firebase/Core (4.4.0):
    - FirebaseAnalytics (= 4.0.4)
    - FirebaseCore (= 4.0.9)
  - FirebaseAnalytics (4.0.4):
    - FirebaseCore (~> 4.0)
    - FirebaseInstanceID (~> 2.0)
    - GoogleToolboxForMac/NSData+zlib (~> 2.1)
    - nanopb (~> 0.3)
  - FirebaseCore (4.0.9):
    - GoogleToolboxForMac/NSData+zlib (~> 2.1)
    - nanopb (~> 0.3)
  - FirebaseInstanceID (2.0.5)
  - FirebaseRemoteConfig (2.0.3):
    - FirebaseAnalytics (~> 4.0)
    - FirebaseInstanceID (~> 2.0)
    - GoogleToolboxForMac/NSData+zlib (~> 2.1)
    - Protobuf (~> 3.1)

The problem

It append on few of my user since, I have this crash on crashlytics.

Crashlytics indicate : The stack trace indicates that heap corruption may have caused your app to crash. Memory corruption can occur pretty easily from freeing a dangling pointer, a thread race, or bad pointer arithmetic. The important thing to keep in mind is that the resulting crash may happen long after the initial corruption. As a result, the stack trace for this crash might not provide any clues to the location of the bug in your code. However, you can still fix memory issues with tools from Apple. For speedy resolution of memory corruption issues, we recommend regularly auditing your app with Xcode’s memory debugging facilities: Visual Memory Debugger, Zombies Instrument, Address Sanitizer, Thread Sanitizer and malloc diagnostics.

LOGS

Crashed: com.google.iid-token-operations (QOS: UTILITY)
0  libobjc.A.dylib                0x184dfc1a0 objc_retain + 16
1  Myapp                  0x101378534 +[FIRLoggerWrapper logWithLevel:withService:withCode:withMessage:withArgs:] + 4281264
2  CoreFoundation                 0x1858d36a0 __invoking___ + 144
3  CoreFoundation                 0x1857b2820 -[NSInvocation invoke] + 292
4  Myapp                  0x101398038 +[FIRInstanceIDLogger logWithLevel:withService:withCode:withMessage:withArgs:] + 4411060
5  Myapp                  0x1013981ec -[FIRInstanceIDLogger logFuncDebug:messageCode:msg:] + 4411496
6  Myapp                  0x10139a97c -[FIRInstanceIDTokenFetchOperation performTokenOperation] + 4421624
7  Foundation                     0x186298004 __NSOQSchedule_f + 404
8  libdispatch.dylib              0x185251048 _dispatch_client_callout + 16
9  libdispatch.dylib              0x1852593d4 _dispatch_continuation_pop$VARIANT$mp + 428
10 libdispatch.dylib              0x185257cd4 _dispatch_async_redirect_invoke$VARIANT$mp + 604
11 libdispatch.dylib              0x18525e1c8 _dispatch_root_queue_drain + 596
12 libdispatch.dylib              0x18525df10 _dispatch_worker_thread3 + 120
13 libsystem_pthread.dylib        0x1854f7130 _pthread_wqthread + 1268
14 libsystem_pthread.dylib        0x1854f6c30 start_wqthread + 4

Relevant Code:

I’m using a subclasse of NSOperation to execute this code:

- (void)main {
    @try {
      
        // Add test for min version
        self.remoteConfig = [FIRRemoteConfig remoteConfig];
        FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:NO];
        self.remoteConfig.configSettings = remoteConfigSettings;
        
        [self.remoteConfig fetchWithExpirationDuration:5 completionHandler:^(FIRRemoteConfigFetchStatus status, NSError *error) {
            if (status == FIRRemoteConfigFetchStatusSuccess) {
                [self.remoteConfig activateFetched];
            }
            [self completeOperation];
        }];
        
    }
    @catch(...) {
        // Do not rethrow exceptions.
    }
}

I’m also using FirebaseAnalytics but I can’t found in the logs witch part of my code generate this crash. Which seems to be internal.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 42 (16 by maintainers)

Most upvoted comments

Thanks everyone. We have a fix in next release that is coming out soon.

Thanks @chliangGoogle, as my app is crashing due to Firebase too, I was wondering when are you planning to make a release with this fix in it? I would like to plan a release of my app with updated Firebase SDK.

This should be fixed in the 4.8.0 release of Firebase, feel free to reopen if that’s not the case.

This seems to be a “me too” day so if it helps, I can also confirm this crash happens frequently (unfortunately not frequently enough to be reproducible on my side) and has been the number one crash in my 4 apps.

I still have this issue with latest release 😦

Crashed: com.google.iid-token-operations :: NSOperation 0x1742f5300 (QOS: UTILITY)
0  libobjc.A.dylib                0x18e1981a0 objc_retain
1  Heetch                         0x10054db70 +[FIRLoggerWrapper logWithLevel:withService:withCode:withMessage:withArgs:]
2  CoreFoundation                 0x18f720e80 __invoking___
3  CoreFoundation                 0x18f6162c4 -[NSInvocation invoke]
4  Heetch                         0x10056eb48 +[FIRInstanceIDLogger logWithLevel:withService:withCode:withMessage:withArgs:]
5  Heetch                         0x10056ecfc -[FIRInstanceIDLogger logFuncDebug:messageCode:msg:]
6  Heetch                         0x10057148c -[FIRInstanceIDTokenFetchOperation performTokenOperation]
7  Foundation                     0x1901ebbb0 __NSOQSchedule_f
8  libdispatch.dylib              0x18e5d29a0 _dispatch_client_callout
9  libdispatch.dylib              0x18e5e0ad4 _dispatch_queue_serial_drain
10 libdispatch.dylib              0x18e5d62cc _dispatch_queue_invoke
11 libdispatch.dylib              0x18e5e2a50 _dispatch_root_queue_drain
12 libdispatch.dylib              0x18e5e27d0 _dispatch_worker_thread3
13 libsystem_pthread.dylib        0x18e7db100 _pthread_wqthread
14 libsystem_pthread.dylib        0x18e7dacac start_wqthread

Podfile.lock

- Firebase/Core (4.6.0):
  - FirebaseAnalytics (= 4.0.5)
  - FirebaseCore (= 4.0.11)
- Firebase/RemoteConfig (4.6.0):
  - Firebase/Core
  - FirebaseRemoteConfig (= 2.1.0)
- FirebaseABTesting (1.0.0):
  - FirebaseCore (~> 4.0)
  - Protobuf (~> 3.1)
- FirebaseAnalytics (4.0.5):
  - FirebaseCore (~> 4.0)
  - FirebaseInstanceID (~> 2.0)
  - GoogleToolboxForMac/NSData+zlib (~> 2.1)
  - nanopb (~> 0.3)
- FirebaseCore (4.0.11):
  - GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseInstanceID (2.0.6)
- FirebaseRemoteConfig (2.1.0):
  - FirebaseABTesting (~> 1.0)
  - FirebaseAnalytics (~> 4.0)
  - FirebaseInstanceID (~> 2.0)
  - GoogleToolboxForMac/NSData+zlib (~> 2.1)
  - Protobuf (~> 3.1)

Yep, this was fixed in the latest release. Feel free to reopen or file a new issue if this regresses.

4.6.0 was just released (https://firebase.google.com/support/release-notes/ios). Looks like it contains the fix.