nativescript-sentry icon indicating copy to clipboard operation
nativescript-sentry copied to clipboard

kThreadSecondary Error

Open JimLynchCodes opened this issue 5 years ago • 3 comments
trafficstars

Which platform(s) does your issue occur on?

  • iOS
  • iOS 9+
  • emulator

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)
  • Cross-platform modules: (check the 'version' attribute in the node_modules/tns-core-modules/package.json file in your project)
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
  • Plugin(s): (look for the version numbers in the package.json file of your project and paste your dependencies and devDependencies here)

Please, tell us how to recreate the issue in as much detail as possible.

Scaffold fresh nativescript project and add the plugin. Then run:

tns run ios

App crashed before starting up with this error:


/Users/jlynch/Git-Projects/Study-App/study-app/platforms/ios/Pods/Sentry/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_MachException.c:269:19: warning: 
      result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Wstring-compare]
    if(threadName == kThreadSecondary)
                  ^  ~~~~~~~~~~~~~~~~
1 warning generated.
/Users/jlynch/Git-Projects/Study-App/study-app/platforms/ios/Pods/Sentry/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_MachException.c:269:19: warning: 
      result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Wstring-compare]
    if(threadName == kThreadSecondary)
                  ^  ~~~~~~~~~~~~~~~~
1 warning generated.
/Users/jlynch/Git-Projects/Study-App/study-app/platforms/ios/Pods/Sentry/Sources/Sentry/NSString+SentryNSUIntegerValue.m:22:12: warning: implicit conversion
      loses integer precision: 'unsigned long long' to 'NSUInteger' (aka 'unsigned int') [-Wshorten-64-to-32]
    return strtoull([self UTF8String], NULL, 0);
    ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Users/jlynch/Git-Projects/Study-App/study-app/platforms/ios/Pods/Sentry/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_MachException.c:269:19: warning: 
      result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Wstring-compare]
    if(threadName == kThreadSecondary)
                  ^  ~~~~~~~~~~~~~~~~
1 warning generated.

JimLynchCodes avatar Oct 03 '20 18:10 JimLynchCodes

I only got

 result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Wstring-compare]
    if(threadName == kThreadSecondary)

Fixed it by changing if(threadName == kThreadSecondary) to if(strcmp( threadName, kThreadSecondary) == 0)

in SentryCrashMonitor_MachException.c

forgm avatar Nov 04 '20 12:11 forgm

Thanks, can you open a PR with the fix pls? Modifying a consumed library's code is generally not a good practice.

JimLynchCodes avatar Nov 12 '20 17:11 JimLynchCodes

From what I know this repo is inactive, and FinanzRitter/nativescript-sentry is the active one. I'll see what I can do there. They updated that problem in the newer version of sentry-cocoa so it can probably be done by updating the pod version of sentry-cocoa and migrating code to the new version.

forgm avatar Nov 13 '20 10:11 forgm