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

iOS app crashing on calling startTrace method #602

Closed
4 tasks done
jhpetersen opened this issue Mar 22, 2021 · 2 comments
Closed
4 tasks done

iOS app crashing on calling startTrace method #602

jhpetersen opened this issue Mar 22, 2021 · 2 comments
Labels
bug Something isn't working properly ios relates to iOS platform legacy Related to inherited code/functionality runtime issue An issue related to app runtime

Comments

@jhpetersen
Copy link

Hi there, i decided to file a bug report due to hard crashs happening only on iOS devices, which seem to be related to something inside this plugin code.

Bug report

CHECKLIST

  • I have read the documentation thoroughly and it does not help solve my issue.

  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

The iOS App is crashing many times (but not always) with a com.apple.root.default-qos on plugin method startTrace (either with "SIGABRT ABORT" or "EXC_BAD_ACCESS KERN_INVALID_ADDRESS"), reporting FirebasePlugin.m - Zeile 1448 __29-[FirebasePlugin startTrace:]_block_invoke + 1448 as the cause.

The crash not happens on Android, but only on iOS on a variety of devices (iPhone X, iPhone XR, iPhone 11 Pro, iPhone 12 Mini, iPhone 8, iPhone 12 Max Pro, iPhone iPhone SE 2nd gen) and iOS versions (iOS 14.4.0, 14.5.0).

Expected behavior:

The app should not crash on calling firebase plugin startTrace method.

Crashlog

0    libsystem_kernel.dylib    __pthread_kill + 8
1    libsystem_pthread.dylib   pthread_kill + 272
2    libsystem_c.dylib         abort + 104
3    libsystem_malloc.dylib    _malloc_put + 558
4    libsystem_malloc.dylib    malloc_report + 64
5    libsystem_malloc.dylib    free + 532
6    CoreFoundation            mdict_rehashd + 288
7    CoreFoundation            -[__NSDictionaryM setObject:forKey:] + 732
8    myApp                     FirebasePlugin.m - Zeile 1448
                               __29-[FirebasePlugin startTrace:]_block_invoke + 1448
9    libdispatch.dylib         _dispatch_call_block_and_release + 32
10   libdispatch.dylib         _dispatch_client_callout + 20
11   libdispatch.dylib         _dispatch_queue_override_invoke + 692
12   libdispatch.dylib         _dispatch_root_queue_drain + 356
13   libdispatch.dylib         _dispatch_worker_thread2 + 116
14   libsystem_pthread.dylib   _pthread_wqthread + 216
15   libsystem_pthread.dylib   start_wqthread + 8

Environment information

  • Cordova CLI version: 10.0.0
  • Cordova platform version: ios 5.1.1
  • Plugins & versions installed in project (including this plugin):
cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release"
cordova-clipboard 1.2.1 “Clipboard”
cordova-plugin-actionsheet 2.3.3 “ActionSheet”
cordova-plugin-androidx-adapter 1.1.3 “cordova-plugin-androidx-adapter”
cordova-plugin-app-version 0.1.9 “AppVersion”
cordova-plugin-camera 5.0.1 “Camera”
cordova-plugin-console 1.1.0 “Console”
cordova-plugin-customurlscheme 4.4.0 “Custom URL scheme”
cordova-plugin-device 2.0.3 “Device”
cordova-plugin-dialogs 2.0.2 “Notification”
cordova-plugin-file 6.0.2 “File”
cordova-plugin-filechooser 1.0.1 “File Chooser”
cordova-plugin-filepath 1.5.8 “cordova-plugin-filepath”
cordova-plugin-firebasex 11.0.3 “Google Firebase Plugin”
cordova-plugin-globalization 1.11.0 “Globalization”
cordova-plugin-image-resizer 0.1.1 “Image Resizer”
cordova-plugin-inappbrowser 4.1.0 “InAppBrowser”
cordova-plugin-ionic-keyboard 2.2.0 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 5.0.0 “cordova-plugin-ionic-webview”
cordova-plugin-network-information 2.0.2 “Network Information”
cordova-plugin-screen-orientation 3.0.2 “Screen Orientation”
cordova-plugin-splashscreen 5.0.4 “Splashscreen”
cordova-plugin-statusbar 2.4.3 “StatusBar”
cordova-plugin-whitelist 1.3.4 “Whitelist”
cordova-plugin-wkwebview-inject-cookie 1.0.2 “WKWebViewInjectCookie”
cordova-sqlite-evcore-extbuild-free 0.12.1 “Cordova sqlite storage - free enterprise version with Android performance/memory improvements and extra features for PhoneGap Build”
phonegap-plugin-barcodescanner 8.1.0 “BarcodeScanner”
uk.co.workingedge.phonegap.plugin.launchnavigator 4.2.2 “Launch Navigator”
  • Dev machine OS and version: macOS 11.2.3
  • Device details: variety of devices (iPhone X, iPhone XR, iPhone 11 Pro, iPhone 12 Mini, iPhone 8, iPhone 12 Max Pro, iPhone iPhone SE 2nd gen)
  • OS details: iOS 14.4.0 and 14.5.0 (in the past 7 days)

Other information:

I briefly looked over the iOS source code of FirebasePlugin.m startTrace method.
Maybe it could be a problem calling FIRTrace *trace = [self.traces objectForKey:traceName]; in line 1449 before checking for existance if ( self.traces == nil) { self.traces = [NSMutableDictionary new]; } in line 1451 ff?
But nevertheless the try/catch block should handle that kind of error and this doesn't explain any heap related errors..

Thanks in advance for any hint on this problem.

@dpa99c dpa99c added bug Something isn't working properly ios relates to iOS platform legacy Related to inherited code/functionality runtime issue An issue related to app runtime labels Mar 23, 2021
@dpa99c dpa99c closed this as completed in e9c23fb Mar 23, 2021
@jhpetersen
Copy link
Author

jhpetersen commented Mar 23, 2021

Thanks for propsing a fix.
I tried version 12.0.0 of this plugin, but sadly there still seems to be another issue on startTrace method.
Directly after upgrading the app, the first call on startTrace crashed the app again. (subsequential calls or closing/reopening the app were ok without a crash, at least on my 5 attempts..)

Please see this crashlog:

0   libsystem_kernel.dylib    __pthread_kill + 8
1   libsystem_pthread.dylib   pthread_kill + 272
2   libsystem_c.dylib         abort + 104
3   libsystem_malloc.dylib    _malloc_put + 558
4   libsystem_malloc.dylib    malloc_report + 64
5   libsystem_malloc.dylib    free + 532
6   CoreFoundation            __CFStringAppendFormatCore + 13712
7   CoreFoundation            _CFStringCreateWithFormatAndArgumentsReturningMetadata + 164
8   Foundation                +[NSString stringWithFormat:] + 76
9   myApp                     -[CDVCommandDelegateImpl sendPluginResult:callbackId:] + 127248
10  myApp                     FirebasePlugin.m - Zeile 1460
                              __29-[FirebasePlugin startTrace:]_block_invoke + 1460
11  libdispatch.dylib         _dispatch_call_block_and_release + 32
12  libdispatch.dylib         _dispatch_client_callout + 20
13  libdispatch.dylib         _dispatch_queue_override_invoke + 692
14  libdispatch.dylib         _dispatch_root_queue_drain + 356
15  libdispatch.dylib         _dispatch_worker_thread2 + 116
16  libsystem_pthread.dylib   _pthread_wqthread + 216
17  libsystem_pthread.dylib   start_wqthread + 8

I have no clue what stringWithFormat inside cordova-ios implementation of sendPluginResult causes a crash.
Do you see why this happens?

@jhpetersen
Copy link
Author

jhpetersen commented Mar 24, 2021

I updated cordova-ios to 6.2.0 and will observe if a crash occurs again.
Unless proven otherwise i suppose this issue as closed..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly ios relates to iOS platform legacy Related to inherited code/functionality runtime issue An issue related to app runtime
Projects
None yet
Development

No branches or pull requests

2 participants