Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Issue 2433873003: Fix crash when calling ScrollAnchor::clear from PaintLayer's destructor (Closed)

Created:
4 years, 2 months ago by ymalik
Modified:
4 years, 2 months ago
Reviewers:
skobes
CC:
chromium-reviews, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, dshwang, jchaffraix+rendering, blink-reviews-paint_chromium.org, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix crash when calling ScrollAnchor::clear from PaintLayer's destructor ScrollAnchor::clear walks up the PaintLayer chain from the anchor (or its scroller's LayoutBox if anchor is null). It unconditionally clears the isScrollAnchorObject bit because the assumption is that if any ancestor scroller had this LayoutObject as its anchor, it will be cleared anyway. This only applies to clears caused by scrolling. For example, say that you have a nested scroller (#nested) and a main frame scroller (#main). Say that the nested scroller has a div (#div) that has its own PaintLayer (see the test added in this CL). Say that both #main and #nested are anchored to #something inside #nested. If #nested is removed, ScrollAnchor::clear will first be called on #div's PLSA. This will do nothing for #div (since it doesn't have an anchor), but will clear the scroll anchor for #main (and not #nested because layoutObject->parent() is null since #div is detached from the tree). After a call to ScrollAnchor::clear on the #div's PLSA, the IsScrollAnchorObject bit on #something is cleared. But, #nested still holds a reference to #something because LayoutObject::willBeRemovedFromTree check whether the IsScrollAnchorObject bit is set before clearing referencing scrollers. Then ScrollAnchor::clear will be called on #nested's PLSA and we will be working with a stale anchor. BUG=656314 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Committed: https://crrev.com/889397888480b49f01ed18a04ce9eb05f30ca2b5 Cr-Commit-Position: refs/heads/master@{#426314}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -4 lines) Patch
M third_party/WebKit/Source/core/layout/ScrollAnchor.h View 2 chunks +7 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ScrollAnchor.cpp View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp View 1 chunk +40 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (8 generated)
ymalik
4 years, 2 months ago (2016-10-19 15:31:15 UTC) #3
ymalik
4 years, 2 months ago (2016-10-19 15:31:25 UTC) #4
skobes
lgtm Great analysis :)
4 years, 2 months ago (2016-10-19 15:46:29 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2433873003/1
4 years, 2 months ago (2016-10-19 17:10:35 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/51977)
4 years, 2 months ago (2016-10-19 19:50:06 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2433873003/1
4 years, 2 months ago (2016-10-19 21:46:45 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 2 months ago (2016-10-19 22:45:43 UTC) #14
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:12:33 UTC) #16
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/889397888480b49f01ed18a04ce9eb05f30ca2b5
Cr-Commit-Position: refs/heads/master@{#426314}

Powered by Google App Engine
This is Rietveld 408576698