Hung WebApk onResume |
||||||||
Issue description
I'm on the Android O beta and testing on Chrome Dev 61.0.3129.3
What I'm seeing is occasionally a WebApk hung and never leaving the splash screen.
I looked at some logs and I see the following for 2 different renderer process launches:
06-20 10:46:49.825 918-2154/? I/ActivityManager: Start proc 19592:com.chrome.dev:sandboxed_process0/u0i489 for service com.chrome.dev/org.chromium.content.app.SandboxedProcessService0
06-20 10:46:50.129 19592-19592/? W/dboxed_process0: type=1400 audit(0.0:10469): avc: denied { getattr } for path="/data/data/com.chrome.dev" dev="sda35" ino=893559 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
06-20 10:46:50.189 19592-19592/? W/dboxed_process0: type=1400 audit(0.0:10470): avc: denied { search } for name="tmp" dev="sda35" ino=32770 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
06-20 10:46:50.218 19592-19592/? I/cr_ChildProcessService: Creating new ChildProcessService pid=19592
06-20 10:46:51.204 19592-19606/? I/cr_LibraryLoader: Time to load native libraries: 60 ms (timestamps 7545-7605)
06-20 10:46:51.206 19592-19606/? I/cr_LibraryLoader: Using linker: org.chromium.base.library_loader.ModernLinker
06-20 10:46:51.208 19592-19606/? I/chromium: [INFO:library_loader_hooks.cc(144)] Chromium logging enabled: level = 0, default verbosity = 0
06-20 10:46:51.208 19592-19606/? I/cr_LibraryLoader: Expected native library version number "61.0.3129.3", actual native library version number "61.0.3129.3"
06-20 10:47:01.132 918-8515/? I/ActivityManager: Start proc 19791:com.chrome.dev:sandboxed_process1/u0i490 for service com.chrome.dev/org.chromium.content.app.SandboxedProcessService1
06-20 10:47:01.789 19791-19791/? W/dboxed_process1: type=1400 audit(0.0:10472): avc: denied { getattr } for path="/data/data/com.chrome.dev" dev="sda35" ino=893559 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
06-20 10:47:01.853 19791-19791/? W/dboxed_process1: type=1400 audit(0.0:10473): avc: denied { search } for name="tmp" dev="sda35" ino=32770 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
06-20 10:47:01.880 19791-19791/? I/cr_ChildProcessService: Creating new ChildProcessService pid=19791
Where the second renderer (19791) never logs that it loaded native libraries.
The steps that I observed to repro were:
1) launch 2 different webapks
2) use different apps so that chrome gets evicted due to memory pressure
3) relaunch one webapk (works fine, first logs above)
4) relaunch another webapk and hangs forever.
Unfortunately that was on a user build so I'm now trying to repro on trunk with dev build. What's different from other issues I've seen that appear related is that in this case it's the second webapk that's broken, and so unlikely to be caused by the warmup renderer.
Addding Bo/Jay in case you've seen something similar recently but still trying to dig into this.
What's dif
,
Jun 20 2017
+peconn@ - this seems like it could be related to the picture-in-picture work for Android O that moved fullscreen web content to a new Activity.
,
Jun 20 2017
Hmm, I think I'm onto something. WebappDirectoryManager.findStaleWebappDirectories. It seems to be nuking WebApk history files cause they're similar (but different) from Webapp. They're close enough that it looks like it's processing them, but it's really not and ends up deleting valid history elements. We just missed this while making webapks work cause there wasn't enough usage to see this history problem.
,
Jun 20 2017
So the simplest fix is to change WebApkConstants.WEBAPK_ID_PREFIX from "webapk:" to "webapk-". This is because WebappDirectoryManager gets the intent's host while looking for live apps and using "webapk:..." means that the host is always "webapk". Not sure if there's any reason not to do this, but some local testing seems to check out.
,
Jun 20 2017
Of course that entails being able to migrate over existing shared prefs from one place to the other (e.g. webapp_webapk:org.chromium.webapk.a4b4240ee93f1a289.xml ->webapp_webapk-org.chromium.webapk.a4b4240ee93f1a289.xml) :S
,
Jun 21 2017
Xi pointed out yesterday that WebappDataStorage does not have any critical data for WebAPKs. WebappDataStorage mostly has timestamps that we use to determine when to next update WebAPKs. We wouldn't be sad if we lost all of the data in WebappDataStorage. However, we would need to ensure that we delete data in the old WebappDataStorage
,
Jun 21 2017
> However, we would need to ensure that we delete data in the old WebappDataStorage Don't these automatically age out after some period of time?
,
Jun 21 2017
WebappRegistry.unregisterOldWebapps will already clear unused storage after 28 days but that's for webapps. For webapks, it just checks whether it's installed and both entries would map to an installed webapk. At the end of the day though, it's a tiny amount of on-disk storage. Each webapk is <1k of shared prefs
,
Jun 21 2017
I have a patch that CQ seems happy with up at https://codereview.chromium.org/2952023002/#msg3 but I still want to add tests
,
Jun 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5ff213a88961f80fab0e21a871b62eb4336f3cb0 commit 5ff213a88961f80fab0e21a871b62eb4336f3cb0 Author: yfriedman <yfriedman@chromium.org> Date: Mon Jun 26 14:21:32 2017 Change WebApk app-id prefix from 'webapk:' to 'webapk-' This fixes some code which uses the host of a WebApp for various processing. Specifically, when examining history state (https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDirectoryManager.java?type=cs&q=liveWebapps.add+package:%5Echromium$&l=111) this would fail because 'webapk:' becomes the host name. This also makes WebApk id's consistent with traditional A2HS ids. Finally, this includes a change to the cleanup routine run on WebApps to age out the old entries. We will lose install source as part of this but it's just metrics book-keeping for us and doesn't affect users. BUG= 735060 , 735722 Review-Url: https://codereview.chromium.org/2952023002 Cr-Commit-Position: refs/heads/master@{#482267} [modify] https://crrev.com/5ff213a88961f80fab0e21a871b62eb4336f3cb0/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java [modify] https://crrev.com/5ff213a88961f80fab0e21a871b62eb4336f3cb0/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java [modify] https://crrev.com/5ff213a88961f80fab0e21a871b62eb4336f3cb0/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java [modify] https://crrev.com/5ff213a88961f80fab0e21a871b62eb4336f3cb0/chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkConstants.java
,
Jun 30 2017
Haven't heard any issues on this and it's been working for me on dev chanel
,
Jun 30 2017
This bug requires manual review: M60 has already been promoted to the beta branch, so this requires manual review Please contact the milestone owner if you have questions. Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 7 2017
So the issue here is if a user opesn multiple wbapks, then chrome goes to the background and is evicted from memory. When user relaunches chrome, if/when they try a second webapk, they'll be stuck on the splashcreen forever cause the page isn't initialized. WOrkaroudn is to hit back or home and try again.
,
Jul 7 2017
Spoke with yfriedman@ offline on this, the breakage is pretty bad when it does occur and the code only affects WebAPKs - thus approved for M60 branch 3112.
,
Jul 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8b2a6269e945ebf038f2377f3637b044deff6aa1 commit 8b2a6269e945ebf038f2377f3637b044deff6aa1 Author: Yaron Friedman <yfriedman@chromium.org> Date: Mon Jul 10 17:26:56 2017 Change WebApk app-id prefix from 'webapk:' to 'webapk-' This fixes some code which uses the host of a WebApp for various processing. Specifically, when examining history state (https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDirectoryManager.java?type=cs&q=liveWebapps.add+package:%5Echromium$&l=111) this would fail because 'webapk:' becomes the host name. This also makes WebApk id's consistent with traditional A2HS ids. Finally, this includes a change to the cleanup routine run on WebApps to age out the old entries. We will lose install source as part of this but it's just metrics book-keeping for us and doesn't affect users. BUG= 735060 , 735722 TBR=pkotwicz (cherry picked from commit 5ff213a88961f80fab0e21a871b62eb4336f3cb0) Review-Url: https://codereview.chromium.org/2952023002 Cr-Original-Commit-Position: refs/heads/master@{#482267} Change-Id: Ib52aea4f06752504b697f9d2e81ad22ec65c0be7 Reviewed-on: https://chromium-review.googlesource.com/565463 Reviewed-by: Yaron Friedman <yfriedman@chromium.org> Cr-Commit-Position: refs/branch-heads/3112@{#558} Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897} [modify] https://crrev.com/8b2a6269e945ebf038f2377f3637b044deff6aa1/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java [modify] https://crrev.com/8b2a6269e945ebf038f2377f3637b044deff6aa1/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java [modify] https://crrev.com/8b2a6269e945ebf038f2377f3637b044deff6aa1/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java [modify] https://crrev.com/8b2a6269e945ebf038f2377f3637b044deff6aa1/chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkConstants.java
,
Jul 10 2017
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by yfried...@chromium.org
, Jun 20 2017Summary: Hung WebApk onResume (was: Hung renderer )