Issue metadata
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:
,
Jun 14 2018
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.
,
Jun 14 2018
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.
,
Jun 28 2018
The NextAction date has arrived: 2018-06-28
,
Jul 17
Seems to be a feature request for devtools. Although I don't think this is entirely feasible currently.
,
Aug 13
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?
,
Sep 21
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 |
|||||||||||||||||||||
Comment 1 by krajshree@chromium.org
, Jun 14 2018