New issue
Advanced search Search tips

Issue 831248 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

synchronous compositor: Deadlock in draw on scroll

Project Member Reported by boliu@chromium.org, Apr 10 2018

Issue description

From b/74560183. This call holds a lock, and can call back into the app:
https://cs.chromium.org/chromium/src/content/browser/android/synchronous_compositor_sync_call_bridge.cc?rcl=e20ec0676c3adbdb4fb37acc17e692cb397f8ed0&l=187

If app then calls back to draw, then that deadlocks because same thread tries to acquire the same lock.

Simple fix is to just not wrap the UpdateState in the lock.
 

Comment 1 by boliu@chromium.org, Apr 10 2018

Status: Assigned (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8ca578ccfc770f1886100850452d9a94d47d06fa

commit 8ca578ccfc770f1886100850452d9a94d47d06fa
Author: Bo Liu <boliu@chromium.org>
Date: Tue Apr 10 19:27:41 2018

sync compositor: Do not hold lock for UpdateState

UpdateState can call back into app, which then call back into webview to
draw again, which causes a deadlock.

Also it's a bad pattern to have locks leak outside of a class anyway.

Bug:  831248 
Change-Id: I6e88fec0fdf38695074988b1cc52ebeecf45a206
Reviewed-on: https://chromium-review.googlesource.com/1005718
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549611}
[modify] https://crrev.com/8ca578ccfc770f1886100850452d9a94d47d06fa/content/browser/android/synchronous_compositor_sync_call_bridge.cc

Comment 4 by boliu@chromium.org, Apr 10 2018

Labels: Merge-Request-66
Project Member

Comment 5 by sheriffbot@chromium.org, Apr 10 2018

Labels: -Merge-Request-66 Merge-Review-66 Hotlist-Merge-Review
This bug requires manual review: We are only 6 days from stable.
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), josafat@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 6 by cmasso@google.com, Apr 10 2018

Labels: -Hotlist-Merge-Review -Merge-Review-66 Merge-Approved-66
Merge approved upon verification of the fix in canary
boliu@,

I see that you had mentioned in the b/74560183 that u repro'ed ANR by Simulating the stack in a simple app.

We were not able to repro it in our testing. So, are there any steps, where we can repro & verify on fixed build?

Comment 8 by boliu@chromium.org, Apr 10 2018

Trying to scroll using this shell apk will immediately lock up without the fix.

Note that apk is only for reproducing this ANR and nothing else. Even with the fix, it's super slow, and still might crash.
SystemWebViewShell.apk
713 KB Download

Comment 9 by battun@chromium.org, Apr 11 2018

Fix issue verified on latest Pixel 2 XL, from the steps #3 in b/74560183.

Thanks!
 
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 11 2018

Labels: -merge-approved-66 merge-merged-3359
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06de90b777451321f6ca696edf3ec59d2137830e

commit 06de90b777451321f6ca696edf3ec59d2137830e
Author: Bo Liu <boliu@chromium.org>
Date: Wed Apr 11 17:24:15 2018

[Merge M66] sync compositor: Do not hold lock for UpdateState

UpdateState can call back into app, which then call back into webview to
draw again, which causes a deadlock.

Also it's a bad pattern to have locks leak outside of a class anyway.

Bug:  831248 
Change-Id: I6e88fec0fdf38695074988b1cc52ebeecf45a206
Reviewed-on: https://chromium-review.googlesource.com/1005718
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549611}(cherry picked from commit 8ca578ccfc770f1886100850452d9a94d47d06fa)
Reviewed-on: https://chromium-review.googlesource.com/1007743
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/branch-heads/3359@{#682}
Cr-Branched-From: 66afc5e5d10127546cc4b98b9117aff588b5e66b-refs/heads/master@{#540276}
[modify] https://crrev.com/06de90b777451321f6ca696edf3ec59d2137830e/content/browser/android/synchronous_compositor_sync_call_bridge.cc

Comment 11 by boliu@chromium.org, Apr 11 2018

Status: Fixed (was: Assigned)

Sign in to add a comment