chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 559 forks source link

App/WebviewCore crash on nfc.share #157

Closed GalumphingCallooh closed 9 years ago

GalumphingCallooh commented 9 years ago

App crashes everytime the share function is called on certain devices. Seems to be related to https://issues.apache.org/jira/browse/CB-7109.

Cordova: 3.6.4 Device: Samsung S3, AT&T, 4.1.2 (JellyBean) Logcat crash output:

D/NfcPlugin(29397): execute shareTag
W/PluginManager(29397): THREAD WARNING: exec() call to NfcPlugin.shareTag blocked the main thread for 71ms. Plugin should use CordovaInterface.getThreadPool().
F/libc    (29397): Fatal signal 11 (SIGSEGV) at 0xbbadbeef (code=1), thread 29414 (WebViewCoreThre)
I/DEBUG   (  180): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  180): Build fingerprint: 'samsung/d2uc/d2att:4.1.2/JZO54K/I747UCDMG2:user/release-keys'
I/DEBUG   (  180): pid: 29397, tid: 29414, name: WebViewCoreThre  >>> com.package.name <<<
I/DEBUG   (  180): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr bbadbeef

Webkit code:

var msg = [ndef.uriRecord('http://google.com')];
nfc.share(msg);
don commented 9 years ago

@MrFancyMonocle I can't duplicate the issue.

Cordova 4.2.0 cordova-android 3.6.4 (from cordova platform ls)

Samsung S3 (GT-I9300), AT&T (or maybe unlocked, no sim), Android 4.3 Google Nexus S (Samsung), unlocked, Android 4.1.2

I didn't see Cordova 3.6.4 in npm view cordova versions, so I used 3.6.3-0.2.13. Everything worked OK.

Can you see if you can duplicate this on your hardware with my sample project? https://github.com/don/nfc-share

Usually it's OK to ignore that threading warning. I'm reluctant to add more threading to this method since startNdefPush also creates a thread. If you patch the shareTag to use the cordova thread pool and it fixes your problem, please submit a pull request.

Also, 4.1.2 is pretty ancient. Hasn't AT&T released an update for this?

don commented 9 years ago

Can't duplicate. Re-open issue and include sample code if it's still a problem.