Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upworker crash on physical device with Android 9 or 10 since tns-android 6.4.x #1602
Comments
|
In our real app, we do some file-system stuff in the worker script and instead of just silently crashing, the app also logs something like this in the console:
I updated the demo app to do some totally simplified file system stuff:
|
|
@felixkrautschuk - Does your app use Flavors in your gradle configurations by any chance? I worked with #1597 and we spent a lot of time tracking it down to |
|
@NathanaelA no it does not use flavors, neither the demo app from here nor our real app. |
|
@felixkrautschuk - Thanks for confirming that -- I was really hoping you would say yes, but guessed that it would be no since you said you could duplicate it with your demo. :-) |
|
Sorry for that :D When I run into a new issue, it is always the first step for me to create a new app project and check if it also occurs there and if not, I know that is must be a mistake from myself in my own project. |
|
Just few more information on this: The issue is not related on Android 10 only and also occurs on Android 9 physical devices. On devices with older Android versions, we cannot reproduce this (I already updated the title and description of this thread). If the worker only sends a message back to the main thread (or may be does a console log before that) and then terminates, everything works as expected on ALL devices. But as soon as you but that into a setTimeout-call, it crashes with
|
|
@felixkrautschuk - One minor question; you say it fails on 6.4.1 and 6.5.0 does this work fine on 6.4.0? |
|
@NathanaelA Indeed, 6.4.0 is the latest working android runtime, not 6.3.1. In the release notes, they only mentioned 6.4.1, that's why I did not explicitly test 6.4.0. |
|
any idears/updates to this? |
|
I have the same problem in my app. |
|
I just found out that it is not related only on tns-android 6.4.1+, it also happens on tns-android 6.4.0, but not that often like on 6.5.0 or 6.5.1. It also happens on Emulators by the way... not sure why it was working on emulators for me when I created this issue. |
|
I'm having the same problem. Currently on tns-android 6.5.0 |
|
Confirmed on tns-android 6.5.3 |
|
Same problem in my app: tns android 6.5.3 and physical devices android 10 |
|
Just a status update, I finally had a chance with the above demos I am able to cause a random crash on both the android.os.looper and it totally segfaulted on an emulator a couple of times. So I can duplicate this on Android 10 emulators with both samples.. THANK YOU @felixkrautschuk for the samples! It does look like something in the worker is getting corrupted; not sure what yet. After some more discussions with my partners; we have agreed that this type of bug should be fixed on a higher priority basis, as crashing is a bad thing. So I'll be looking into it shortly. Hopefully have some good news soon. |
|
I have the same issue. The app crashes if I call .terminate() or close() |
|
Hi - Is there a release version date / version chosen for this fix as yet? Thanks |
|
Hi, this is actually one of my higher priority bugs I'm looking into -- now that we finally pushed out NS7 yesterday; the availability to track down some of these bugs should be a lot more available. :) I will be converting the two sample app to NS7 today and verifying that the issue wasn't fixed by some of the other issues we fixed in NS7 and/or by the engine upgrade that also happened. |
Great thanks, I tried running npm view tns-android versions today but its not picked up 7.0.0 as I was hoping to test similar to see if that upgrade has fixed it |
|
It is no longer called If you want to manually try this engine with a older CLI; you can use |
|
Exact same behavior here.... with any call to terminate inside or outside of worker -> crash... without any call to terminate()...its works... @NathanaelA Please if you fin a solution ( soon I hope ;-) )...Can you also make it available for NS 6.8.0... I'm reaaaally not ready to upgrade to NS 7 right now... -> too big angular 8 shared code project...will make it slow to angular 10.. |
|
Is it a so really bad practice to not call terminate() on worker ref ? |
|
@lostation - We would make the patch for NS7 Android runtime, since that is what we are maintaining... However, before that statement worries you; the good news is you can easily use the NS7 runtimes with NS6. Their are no breaking changes and they should be 100% compatible. :-) Now as to how you are causing a crash, is all you are doing is calling terminate() inside the worker? Does it crash every time? |
|
You mean I can upgrade to NS7 while keeping typescript 3.5.3 and angular 8.21 ?
If yes, can you tell me how, I'm not yet an expert... ? I'm using big angular shared project...(Alex Ziskind has made an audit for this project some months ago, he can tell you about it). Sometimes it's quite hard to manage shared Web and NS project.
About worker crashes, I've tried both calling context.terminate() from inside worker, only when error happened inside it, and also when workers job is done from an outside service, using the worker ref.
In fact, I have 2 workers instanciated but not at same time and I reuse the same variable while instanciating new Worker(). The first one is used to read files from filesystem and second one to write files back to filesystem... And as you mentioned, the first read worker works just fine even using terminate from outside service, but then after some time I create the second worker for writing cache stuffs and this is when it crashes at the time of calling terminate inside or outside this second worker, also if error inside or not.
Right now, I comment all calls to terminate and it seems OK.
Le 11 sept. 2020 à 20:43, à 20:43, Nathanael Anderson <notifications@github.com> a écrit:
…
@lostation - We would make the patch for NS7 Android runtime, since
that is what we are maintaining... However, before that statement
worries you; the good news is you can easily use the NS7 runtimes with
NS6. Their are no breaking changes and they should be 100%
compatible. :-)
Now as to how you are causing a crash, is all you are doing is calling
terminate() inside the worker? Does it crash every time?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1602 (comment)
|
|
NS has several pieces;
The android runtime is where this issue would be occurring, if you are calling The NS 7 android runtime should currently be backwards compatible with NS6, however to install it you have manually download it and use the |
|
A fix for this bug would be highly appreciated :) |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns infoin your project folder or by inspecting thepackage.jsonof the project):Describe the bug
When starting a worker script for the second time on an Androd 9 / 10 physical device, the worker thread throws an exception and most times, the app crashes as well.
Please note
What we are doing in the demo app provided below
On button tap we call this:
And that's the worker script:
To Reproduce
1.) Start the demo app provided below (on Android 9 or 10 physical device)
2.) Tap the button, wait some short time and you see the alert "Worker success"
3.) Tapping the button for a second time should also alert "Worker success", but instead it crashes the app
4.)
5.) repeat steps 1-3 and you see that the app won't crash anymore.
Expected behavior
You should be able to start and terminate this worker script as often as you want, like it was working until tns-android 6.3.1
Sample project
ns-worker-issue-android10.zip