Multiple processes of an App exist at the same time.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Multiple processes of an App exist at the same time.

Lotus South
Hello,
Recently, my app's had a lot of crashes only on Android 9, 10, here is a crash log from Firebase Crashlytics:

Fatal Exception: java.lang.RuntimeException
Using WebView from more than one process at once with the same data directory is not supported. https://crbug.com/558377 : Current process org.xlotus.ktesteverything (pid 7032), lock owner org.xlotus.ktesteverything (pid 9186)
org.chromium.android_webview.AwDataDirLock.b (AwDataDirLock.java:30)
Mj.i (Mj.java:31)
Lj.run (Lj.java:2)
android.os.Handler.handleCallback (Handler.java:883)
android.os.Handler.dispatchMessage (Handler.java:100)
android.os.Looper.loop (Looper.java:237)
android.app.ActivityThread.main (ActivityThread.java:8107)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)

My app does not use multiple process for any Android Components or others, and also you can see that there are two process(current process and lock owner process) having the same name (my app's package name), why does it happen?

You may think the crash relating to WebView and I should contact to Chromium team, but the root cause is the old process of my App didn't exit and still held the lock of WebView data directory, when user opens the app again, it will run on another process and also want to hold the lock, in this situation, WebView is forced to throw the Exception to avoid race condition (Ref).

Furthermore, Some users got the crash multiple times for about 1 hour with the crash log showing the same lock owner, which means the old process of my app didn't exit and still held the exclusive lock of WebView data directory for a long time. As a result, every time users opened my app again, and when they used a feature using WebView, the crash occurred.



--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/80099601-0c13-494b-81ca-b843dc39b95dn%40googlegroups.com.