New issue
Advanced search Search tips

Issue 765959 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 15
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Hang Recovery only allows me to kill the page, not stop the long running script

Reported by joshpatt...@outlook.com, Sep 17 2017

Issue description

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

Steps to reproduce the problem:
Run this:

<html>
<body>
<script>
alert('hi');
</script>
hi world
<script>
var i = 0;
while (i || !i) {
 i++;
 }
 </script>
 </body>
 </html>

What is the expected behavior?
Firefox and Internet Explorer both allow me to kill the script and finish loading the content.

Edge pops up an info bar that allows me to "recover" (i.e. reload) the page.

Chrome just gives me the option to kill the page.

What went wrong?
Is there no way to kill the script instead of the whole page?

Crashed report ID: 

How much crashed? Just one tab

Is it a problem with a plugin? No 

Did this work before? N/A 

Chrome version: 60.0.3112.113  Channel: n/a
OS Version: 10.0
Flash Version: 

Full disclosure, I'm a dev on the oculus browser team, a chromium based browser.
 
It looks like the V8 engine has an api to kill execution:
https://cs.chromium.org/chromium/src/v8/src/api.cc?type=cs&q=terminateExecution&sq=package:chromium&l=8563

Still a n00b so don't have a complete mental model, but if V8 is in it's own proc it might be possible to have the browser proc signal.

If V8 is in the render proc then I'm guess thats harder as the render proc is hung

Comment 2 by ajha@chromium.org, Sep 18 2017

Cc: ajha@chromium.org
Labels: -Stability-Crash Stability-Hang M-63 Needs-Milestone
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on the latest canary(63.0.3218.0) on Windows-10. Similar behavior is seen on older chrome version: 50.0.2624.0 as well.Attached is the test file. No warning dialog as such was see on Windows Chrome like FF/IE/Chrome Mac/Chrome Linux 

Note: FF shows an infobar with Stop and Wait buttons. IE shows 'Stop script' button. Mac and Linux on Chrome showed 'Page Unresponsive' dialog with 'Kill' and 'Wait' buttons.  
765959.html
145 bytes View Download
Components: UI>Browser>Navigation
Cc: a...@chromium.org

Comment 5 by a...@chromium.org, Feb 12 2018

Components: -UI>Browser>Navigation Blink>JavaScript
Labels: OS-Android OS-Chrome OS-Linux OS-Mac
That's an interesting API.

In Chromium, V8 lives directly in the render process and AFAIK on the main thread, so it's not quite that easy. This is a little beyond my expertise, though.

V8 team, is there a reasonable way of doing this today?
Components: -Blink>JavaScript Blink>JavaScript>API
Status: Available (was: Untriaged)
Cc: haraken@chromium.org jochen@chromium.org
V8 does offer termination through its API. You can, from a watchdog thread, call v8::Isolate::TerminateExecution, and later, v8::Isolate::CancelTerminateExecution.


However, this only works well with only V8 on the stack. Many places in Blink do not expect a call to V8 to return with an exception. So if you fire a termination while V8 calls into Blink and from there back into V8, you might see a crash when the second V8 call returns to Blink.
Status: WontFix (was: Available)
There has been no progress on this issue hence I mark it as WontFix.
Feel free to reopen if there is more to add.

Sign in to add a comment