ankidroid/Anki-Android

WebView Renderer OOM - kills application if triggered on startup

Open

#5,883 创建于 2020年3月31日

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)Kotlin (2,789 fork)batch import
BugHelp WantedKeep OpenPriority-High

仓库指标

Star
 (11,132 star)
PR 合并指标
 (平均合并 9天 12小时) (30 天内合并 93 个 PR)

描述

If Anki Logcat doesn't display a line, then a WebView Renderer crash has the possibility to take down the process even if we hook onRenderProcessGone. This doesn't appear to be any of our WebViews, and might be due to bloatware in my OS, or an unexpected WebView in a dependency.

Phone does not crash if the following appears:

2020-03-31 11:45:10.978 24674-24674/com.ichi2.anki E/chromium: [ERROR:aw_browser_terminator.cc(125)] Renderer process (24741) crash detected (code -1).

Phone OS: Honor 9 Lite

Description below is a bit rough as it's copy/pasted.


Had a long debug session for this yesterday. It takes a long time to occur, but once it does, it happens with regularity.

I could only get it to crash on the first instance. After that, it seemed stable.

HEAD is now at 9c12b9aac Gracefully handle WebView Crashes

Steps (repeat 2-6 until crash):

  1. Modify displayCardAnswer() to crash chrome
  2. Open Android "Current App" screen and swipe Anki away to kill it
  3. Open Anki
  4. Open a deck with cards
  5. Display Answer
  6. Anki Crashes
2020-03-31 09:28:27.989 6955-6955/com.ichi2.anki A/chromium: [FATAL:crashpad_client_linux.cc(552)] Render process (7023)'s crash wasn't handled by all associated  webviews, triggering application crash.
2020-03-31 09:28:27.989 6955-6955/com.ichi2.anki A/libc: Fatal signal 5 (SIGTRAP), code -6 (SI_TKILL) in tid 6955 (com.ichi2.anki), pid 6955 (com.ichi2.anki)

No clue about the cause.

Fix:

  1. Open Anki
  2. While on the deck screen, switch to Chrome
  3. Press 'Back' in Chrome
  4. See Log Line: 2020-03-31 11:45:10.978 24674-24674/com.ichi2.anki E/chromium: [ERROR:aw_browser_terminator.cc(125)] Renderer process (24741) crash detected (code -1).
  5. Back to Anki
  6. Review as normal, crashes occur and are fixed by onRenderProcessGone

Originally posted by @david-allison-1 in https://github.com/ankidroid/Anki-Android/issues/5780#issuecomment-606481534

贡献者指南