ankidroid / ankidroid/Anki-Android

WebView Renderer OOM - kills application if triggered on startup

Đang mở
#5,883 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bug Help Wanted Keep Open Priority-High
Ngôn ngữ chính
Kotlin
Star
11.8k
Fork
2.9k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
171

Mô tả

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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.