New issue
Advanced search Search tips

Issue 852700 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Sep 21
Components:
EstimatedDays: ----
NextAction: 2018-06-28
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Invalid for loop causes crash

Reported by matthias...@gmail.com, Jun 14 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

Steps to reproduce the problem:
Try to execute the following code:

let values = [];
for (let i = 0; i <= 120; i + 5) {
    values.push(i);
}

What is the expected behavior?
An exception should be thrown

What went wrong?
Chrome crashes after being frozen for a while with 'Render process gone' message in DevTools.

Did this work before? N/A 

Chrome version: 66.0.3359.181  Channel: n/a
OS Version: 10.0
Flash Version:
 
Labels: Needs-Milestone

Comment 2 by rtoy@chromium.org, Jun 14 2018

Labels: Needs-Feedback
NextAction: 2018-06-28
Status: Untriaged (was: Unconfirmed)
Why do you think an exception should be thrown?  The expression "i+5" should be evaluated as expected and i isn't changed, so this is an infinite loop and chrome probably crashes because it runs out of memory pushing 0 to the array.
Because it's nearly impossible to find such a loop in a large codebase if the browser crashes. Therefore an exception would be much appreciated. However, this is probably rather a feature request and not a bug.
The NextAction date has arrived: 2018-06-28
Components: -Blink Platform>DevTools
Seems to be a feature request for devtools. Although I don't think this is entirely feasible currently.
Owner: kozy@chromium.org
Status: Assigned (was: Untriaged)
Thanks for the request.  I don't think it's feasible to break/throw on any long-running piece of code.  In this case, perhaps you want to do 'Sources' > 'Pause script execution', stop all execution, and investigate?

When I did the repro locally, I expected to get our 'Paused before potential out-of-memory crash', but the tab crashed instead.
kozy@, do you know when our OOM checker is supposed to break?
Status: WontFix (was: Assigned)
Unfortunately we do not support all different kind of OOM since we can not instrument all of them.
In this case I suggest to pause execution if page is unresponsible, then you can kill current loop by long click on resume button and click terminate execution: https://twitter.com/ak_239/status/979767841573359618

Sign in to add a comment