New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 644450 link

Starred by 23 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Certain Flexbox layout causes 100% CPU usage upon rendering - entire tab freezes

Reported by nto...@salesforce.com, Sep 6 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36

Steps to reproduce the problem:
Load one of the following page and the CPU usage of the tab will go to 100% and the page will never render:

Standards Mode:

<!DOCTYPE html>
<html>
<head>
    <title>Chrome 53 Rendering Bug - Standards Mode</title>
    <style>
        .main {
            height: 100%;
            position: absolute;
        }
        .region {
            display: flex;
            height: 100%;
        }
        .component {
            display: flex;
            flex-flow: column;
            height: 100%;
        }
        .content {
            flex: auto;
            position: relative;
            overflow: auto;
        }
        .text {
            position: absolute;
        }
    </style>
</head>
<body>
    <div class="main">
        <div class="region">
            <div>
                <div class="component">
                    <p>test</p>
                    <div class="content">
                        <p class="text">test2</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Quirks Mode:

<html>
<head>
    <title>Chrome 53 Rendering Bug - Quirks Mode</title>
    <style>
        .main {
            display: flex;
        }
        .region {
            overflow: auto;
        }
        .component {
            display: flex;
            flex-flow: column;
            height: 100%;
        }
        .content {
            flex: auto;
            position: relative;
            overflow: auto;
        }
        .text {
            position: absolute;
        }
    </style>
</head>
<body>
    <div class="main">
        <div class="region">
            <div class="component">
                <p>test</p>
                <div class="content">
                    <p class="text">test2</p>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

What is the expected behavior?

What went wrong?
I haven't been able to get any additional information about this problem because as soon as the browser renders the bad layout the entire tab is totally useless - including dev tools.

Crashed report ID: 

How much crashed? Just one tab

Is it a problem with a plugin? No 

Did this work before? Yes Chrome 52 Stable

Chrome version: 53.0.2785.89  Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 22.0 r0

I've observed this issue in:

Chrome 53 Stable:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36

The latest Canary:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2852.0 Safari/537.36
 
Components: Blink>Layout>Flexbox
Reproducible on Windows 10 in
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.113 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2860.0 Safari/537.36
Labels: -Stability-Crash Stability-Hang
> This may be related to https://bugs.chromium.org/p/chromium/issues/detail?id=644635

Actually that one is not really related -- Flexbox already has the optimization that the other bug is adding to tables. I'll investigate this as soon as I can.

Comment 5 by szager@chromium.org, Sep 14 2016

Labels: -Pri-2 Pri-1
Owner: szager@chromium.org
Comment #2 is probably correct, this is probably another case of layout in an infinite loop due to overflow:auto and multi-pass layout.  I'll take this.

Comment 6 by pan...@gmail.com, Sep 15 2016

Hi @szager,

I've try to dump my frozen chrome.exe and start a debugging session. Here's what I've got (in the attachment)

My fear is that if this is not the same area as what you're looking at, it might be another bug that I'm seeing. 
chrome_debug.png
104 KB View Download

Comment 7 by pan...@gmail.com, Sep 15 2016

And this is the call stack
crash_callstack.txt
21.9 KB View Download
As mentionned in https://bugs.chromium.org/p/chromium/issues/detail?id=646889, I think both might be the same issue. In that case, Crash ID crash/c1602df500000000 happened with this issue.

Comment 9 by szager@chromium.org, Sep 15 2016

Status: Started (was: Unconfirmed)
Thanks @panitw, I have reproduced the bug and I am actively working on it.
Project Member

Comment 10 by bugdroid1@chromium.org, Sep 15 2016

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

commit 906252430fe0108cf163f1fd9c2e96aa283f9cb5
Author: szager <szager@chromium.org>
Date: Thu Sep 15 23:28:31 2016

Freeze scrollbars for relayout if overflow:auto added scrollbars.

Under very specific circumstances, LayoutBlockFlow::layoutBlock will
loop infinitely in this stanza:

    while (!done)
        done = layoutBlockFlow(...);

... due to fluctuations in the existence of overflow:auto scrollbars
in descendants.  Any layout type that does multi-pass layout is
especially susceptible to this, hence this bug affecting flexbox,
and another recent bug affecting tables: crbug.com/64635.

This fix supercedes the existing fix for the table bug, and it
should fix any other variations of this bug involving multi-pass
layout and overflow:auto.

BUG= 644450 
R=cbiesinger@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2345103002
Cr-Commit-Position: refs/heads/master@{#419035}

[add] https://crrev.com/906252430fe0108cf163f1fd9c2e96aa283f9cb5/third_party/WebKit/LayoutTests/scrollbars/overflow-auto-infinite-loop.html
[modify] https://crrev.com/906252430fe0108cf163f1fd9c2e96aa283f9cb5/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
[modify] https://crrev.com/906252430fe0108cf163f1fd9c2e96aa283f9cb5/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Labels: Merge-Request-53 Merge-Request-54
Requesting merge to M53 and M54: this is breaking production sites.

This patch also fixes  crbug.com/644635 
Per chat with szager@ holding off approval merge to M53 until change is baked/verified in Canary/Dev/Beta(See https://bugs.chromium.org/p/chromium/issues/detail?id=644635#c27 for more details).

Comment 13 by dimu@chromium.org, Sep 16 2016

Labels: -Merge-Request-53 Merge-Review-53 Hotlist-Merge-Review
[Automated comment] Request affecting a post-stable build (M53), manual review required.

Comment 14 by dimu@chromium.org, Sep 16 2016

Labels: -Merge-Request-54 Merge-Approved-54 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M54 (branch: 2840)

Comment 15 by dimu@chromium.org, Sep 16 2016

Labels: -Merge-Request-53 Merge-Review-53 Hotlist-Merge-Review
[Automated comment] Request affecting a post-stable build (M53), manual review required.

Comment 16 by e...@chromium.org, Sep 17 2016

Cc: szager@chromium.org
 Issue 646889  has been merged into this issue.
Could you please confirm whether this change is baked/verified in Canary and safe to merge?If yes, merge your change to M54 (branch: 2840) before 4.00 PM PST by Tuesday ( 09/20) so that we could take this for next Beta Release.
Works for me in Canary 55.0.2866.0!
Project Member

Comment 19 by sheriffbot@chromium.org, Sep 20 2016

This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Any word on backporting this to v53? We're hitting this bug on production sites.
I can also confirm that this fix works for me in Canary 55.0.2866.0. Thank you @szager for the resolution.
Project Member

Comment 22 by bugdroid1@chromium.org, Sep 20 2016

Labels: -merge-approved-54 merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6130f81a4d918145830f585ab715b51266d16e50

commit 6130f81a4d918145830f585ab715b51266d16e50
Author: szager <szager@chromium.org>
Date: Tue Sep 20 17:21:07 2016

Freeze scrollbars for relayout if overflow:auto added scrollbars.

Under very specific circumstances, LayoutBlockFlow::layoutBlock will
loop infinitely in this stanza:

    while (!done)
        done = layoutBlockFlow(...);

... due to fluctuations in the existence of overflow:auto scrollbars
in descendants.  Any layout type that does multi-pass layout is
especially susceptible to this, hence this bug affecting flexbox,
and another recent bug affecting tables: crbug.com/64635.

This fix supercedes the existing fix for the table bug, and it
should fix any other variations of this bug involving multi-pass
layout and overflow:auto.

Cherry-picked from https://codereview.chromium.org/2345103002

BUG= 644450 
TBR=cbiesinger@chromium.org,eae@chromium.org
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2345103002
Review-Url: https://codereview.chromium.org/2359523002
Cr-Original-Commit-Position: refs/heads/master@{#419035}
Cr-Commit-Position: refs/branch-heads/2840@{#442}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[add] https://crrev.com/6130f81a4d918145830f585ab715b51266d16e50/third_party/WebKit/LayoutTests/scrollbars/overflow-auto-infinite-loop.html
[modify] https://crrev.com/6130f81a4d918145830f585ab715b51266d16e50/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
[modify] https://crrev.com/6130f81a4d918145830f585ab715b51266d16e50/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

This fix will go into the next M54 (beta) release, which should be in the next day or two.

If everything looks good in beta, then I'll merge the change into M53, and it will go into the next stable release -- I'm not sure when that will be, it's unlikely that we would push out a stable release just for this fix.

Comment 24 by gempe...@gmail.com, Sep 20 2016

Hi, sorry if additional confirmations aren't useful at this point, but: I had an internal site that was freezing on M53 stable, and is working fine Canary 55.0.2866.0. Thanks for the fix!
Cc: nyerramilli@chromium.org
Labels: TE-Verified-M54 TE-Verified-54.0.2840.34
Tested the issue on Win10, Mac OS X 10.11.6 using Chrome Beta # 54.0.2840.34 using the attached html - page rendered normally.

Attached screencast for reference and adding TE-Verified labels.
644450.html
925 bytes View Download
644450_Mac.mov
4.4 MB Download

Comment 26 by derk...@gmail.com, Sep 22 2016

This also affects a product of my company which no longer works in Chrome on Mac and Android.
The latest Beta has fixed it on Mac.
Please consider releasing a fixed Stable for Mac and Android as soon as possible.
Thank you.
Cc: amineer@chromium.org
Labels: OS-Android
Per comment #26, this also affects on Android.
Labels: -Merge-Review-53 Merge-Approved-53
Merge approved for M53 branch 2785.
Re comment #26: this bug only affects platforms with non-overlay scrollbars.  It doesn't affect Android, and it only affects Mac if the system setting for overlay scrollbars is set to disabled.
Upon further examination, I see that I was wrong in comment #29: this bug does affect platforms with overlay scrollbars, because the logic to determine whether scrollbars occupy space in the layout is incorrect.
Project Member

Comment 31 by bugdroid1@chromium.org, Sep 23 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/68324ed3a9aa9037b105a947b99a7dfe756180c8

commit 68324ed3a9aa9037b105a947b99a7dfe756180c8
Author: szager <szager@chromium.org>
Date: Fri Sep 23 04:54:15 2016

Freeze scrollbars for relayout if overflow:auto added scrollbars.

Under very specific circumstances, LayoutBlockFlow::layoutBlock will
loop infinitely in this stanza:

    while (!done)
        done = layoutBlockFlow(...);

... due to fluctuations in the existence of overflow:auto scrollbars
in descendants.  Any layout type that does multi-pass layout is
especially susceptible to this, hence this bug affecting flexbox,
and another recent bug affecting tables: crbug.com/64635.

This fix supercedes the existing fix for the table bug, and it
should fix any other variations of this bug involving multi-pass
layout and overflow:auto.

Cherry-picked from https://codereview.chromium.org/2345103002

BUG= 644450 
TBR=cbiesinger@chromium.org,eae@chromium.org
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2354263006
Cr-Commit-Position: refs/branch-heads/2785@{#917}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[add] https://crrev.com/68324ed3a9aa9037b105a947b99a7dfe756180c8/third_party/WebKit/LayoutTests/scrollbars/overflow-auto-infinite-loop.html
[modify] https://crrev.com/68324ed3a9aa9037b105a947b99a7dfe756180c8/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Labels: TE-Verified-53.0.2785.146 TE-Verified-M53
Tested the issue on Mac 10.11.6 using chrome version 53.0.2785.146 with the attached html from comment #25.Page rendered fine without any crash.

Please find the attached screen cast for the same.

Adding TE-Verified labels.

Thanks,
644450.mp4
672 KB View Download
Is there any update on the ETA for this to be rolled into the next stable release? Thanks.
The change has been merged to the stable branch, but I don't have an update on when a stable release will occur.  I'll post to this bug as soon as I know.
This patch is now pushing out to stable channel in version 53.0.2785.143 for Desktop (Win,Mac & Linux).
No crashes happen with the latest Chrome update, thanks.
Status: Fixed (was: Started)
Marking fixed, since the fix is now in all branches.
 Issue 649714  has been merged into this issue.
Project Member

Comment 39 by bugdroid1@chromium.org, Oct 27 2016

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

commit 6130f81a4d918145830f585ab715b51266d16e50
Author: szager <szager@chromium.org>
Date: Tue Sep 20 17:21:07 2016

Freeze scrollbars for relayout if overflow:auto added scrollbars.

Under very specific circumstances, LayoutBlockFlow::layoutBlock will
loop infinitely in this stanza:

    while (!done)
        done = layoutBlockFlow(...);

... due to fluctuations in the existence of overflow:auto scrollbars
in descendants.  Any layout type that does multi-pass layout is
especially susceptible to this, hence this bug affecting flexbox,
and another recent bug affecting tables: crbug.com/64635.

This fix supercedes the existing fix for the table bug, and it
should fix any other variations of this bug involving multi-pass
layout and overflow:auto.

Cherry-picked from https://codereview.chromium.org/2345103002

BUG= 644450 
TBR=cbiesinger@chromium.org,eae@chromium.org
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2345103002
Review-Url: https://codereview.chromium.org/2359523002
Cr-Original-Commit-Position: refs/heads/master@{#419035}
Cr-Commit-Position: refs/branch-heads/2840@{#442}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[add] https://crrev.com/6130f81a4d918145830f585ab715b51266d16e50/third_party/WebKit/LayoutTests/scrollbars/overflow-auto-infinite-loop.html
[modify] https://crrev.com/6130f81a4d918145830f585ab715b51266d16e50/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
[modify] https://crrev.com/6130f81a4d918145830f585ab715b51266d16e50/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Sign in to add a comment