Hang monitor not working |
||||||
Issue descriptionChrome Version : 58.0.3029.78 OS Version: 9334.52.0 URLs (if applicable) : What steps will reproduce the problem? 1. Load a web page that just busy-loops, eg. paste this into jsbin.com: var x=0; while(x<0) x++; What is the expected result? Expect to see the tab hang and eventually (before too long) get the kill/wait dialog. What happens instead of that? Just hangs apparently forever consuming 100% CPU I believe this also makes us more blind to hang bugs which should be generating crash reports but aren't (eg. issue 716093).
,
Apr 27 2017
,
Apr 27 2017
,
Apr 27 2017
avi@ was the last one in this code. Not sure if his changes got merged to 58.
,
Apr 27 2017
,
Apr 27 2017
Please confirm you don't have DevTools open for that tab.
,
Apr 27 2017
I'm assuming you meant an infinite loop in your first comment (var x=0;while(x<0) x++; doesn't loop). A modified version: <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title></title> </head> <body> <button onclick="var x=0;while(1) x++;">clickme</button> </body> </html> works as it should in 59.0.3071.25, showing a hang dialog. Will dig further. (Please confirm your repro setup as in comment 6.)
,
Apr 27 2017
Seems to be working for me on Linux (M58 and ToT)
,
Apr 27 2017
Timeout is 30s on desktop... https://cs.chromium.org/chromium/src/content/common/content_constants_internal.cc?l=16
,
Apr 27 2017
Right sorry, yes an infinite loop (x>=0 - typo because I couldn't copy/paste out of my hung renderer). And yes it was reproducing without devtools open. But I think maybe I wasn't waiting long enough, or getting impatient switching between tabs? If I click on the page and sit there with the tab open long enough then yes I can now see the hang monitor. Is the timeout reset when I switch tabs? I also can't close the tab while the renderer is hung (even when there is no unload handler or anything). Is that a bug?
,
Apr 27 2017
There are two basic rules for the hang timer. First, a page in the background is allowed to hang as much as it wants; the user won't notice it is hung. Second, if a user isn't trying to interact with a page the user won't notice it is hung. So the hang timer begins once a user gives a page an input event. If 30 seconds elapse from the first input event, and there are still outstanding input events, and the page hasn't gone into the background, the hang dialog will show. So yes, you need to click on the page and yes, the timer is reset when you switch tabs. A failure to be able to close the page is unexpected. The close timer is one that I moved to be independent, and I rebuilt it for 59 (59.0.3030.0). I just tried in 59, and a hung page closes instantly. If you can repro this is 59, that would be great. Unfortunately I'm not comfortable asking for a merge of this code; it's tricky.
,
Apr 27 2017
Thanks for the details Avi! I confirmed that the tab closing issue was only on 58. 59 seems fine (up to a second or two delay). So it seems all is fine afterall, sorry for the noise!
,
Apr 27 2017
No problem at all! Far better to check on something suspicious and find it working ok than ignore something and hope it's fixed. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by rbyers@chromium.org
, Apr 27 2017Owner: dtapu...@chromium.org