Android-runtime: Crashing Issue #2 - @Next 2.4

Created on 20 Oct 2016  Â·  4Comments  Â·  Source: NativeScript/android-runtime

While playing with workers, I noticed that if the worker was "busy" that switching back and forth on two tabs, will eventually crash the app. This one actually is inside the Worker thread..

Tell us about the problem

App crashes

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

nativescript │ 2.3.0
tns-core-modules │ 2.4.0-2016-10-17-4410
tns-android │ 2.4.0-next-2016-10-14-1253
tns-ios │

Did the error happen while the app was executing? (runtime error)

Attached the full log.
crash2.zip

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

Start a worker doing some work (mine got into a loop where it was running several setTimeouts that would occur every 100ms on the worker -- a bug of my own :grinning: that I need to figure out). Occasionally when I switch tabs (this is the key, the UI has to be doing something, it only appears to crash when I switch tabs. The TWO Tabs are very simple tabs, each tab has a simple TextEntry, a label, and a listview. The ListView uses a GridLayout and two label fields.. These are all bound to data in an observable. Switching tabs does NOT trigger any user defined events, so this is purely NS code re-drawing the other tab...

This is duplicatable; however it can take sometimes take several switches before it dies. I see the other Crash (on main thread: #593) more often than this one; but this one does occasionally occur with pretty much the exact same steps. However, to make this occur more offen, switch between tabs and actually type/delete character then switch to the other tab. This will cause more setTimeouts to be queued so the worker has a LOT more going on...

Callstack:
D/TNS.Java( 938): Uncaught Exception Message=An uncaught Exception occurred on "W0: ./contacts.worker.js" thread.
W/System.err( 938): com.tns.NativeScriptException: Cannot find method 'get' implementation
W/System.err( 938): at com.tns.Runtime.callJSMethodNative(Native Method)
W/System.err( 938): at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1010)
W/System.err( 938): at com.tns.Runtime.callJSMethodImpl(Runtime.java:895)
W/System.err( 938): at com.tns.Runtime.callJSMethod(Runtime.java:883)
W/System.err( 938): at com.tns.Runtime.callJSMethod(Runtime.java:867)
W/System.err( 938): at com.tns.Runtime.callJSMethod(Runtime.java:859)
W/System.err( 938): at com.tns.gen.java.lang.Runnable.run(java.lang.Runnable.java)
W/System.err( 938): at android.os.Handler.handleCallback(Handler.java:733)
W/System.err( 938): at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err( 938): at android.os.Looper.loop(Looper.java:136)
W/System.err( 938): at android.os.HandlerThread.run(HandlerThread.java:61)

done bug

All 4 comments

I have sent you access creds to the repo via email @Pip3r4o - You just have to clone the repo, then checkout the “CrashingTest” branch...

The two issues are very likely related and a result of the same bug, I'd expect to experience even more crashes when calling java methods through JS at the same time.

@NathanaelA good news, @slavchev helped me troubleshoot the issue, and it turned out to be a bug in our java string to c++ string conversion logic. The fix should be in the master branch in a couple of hours

Awesome news guys! Glad that I was able to give you a test case that allowed you to trace this down, always nice to fix a low level issue. :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

x4080 picture x4080  Â·  5Comments

NathanaelA picture NathanaelA  Â·  3Comments

tsonevn picture tsonevn  Â·  4Comments

atanasovg picture atanasovg  Â·  3Comments

Natalia-Hristova picture Natalia-Hristova  Â·  3Comments