New issue
Advanced search Search tips

Issue 595725 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Default parameter + generator with devtools open crashes process

Reported by gma...@gmail.com, Mar 17 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Steps to reproduce the problem:
See [this jsbin](http://jsbin.com/seridu/edit?js,console,output

```
function* sayThrice(val = {}) {
	let cntr = 1;
	console.log(`${cntr++} - ${val.msg}`)
	yield
	console.log(`${cntr++} - ${val.msg}`)
	yield
	console.log(`${cntr++} - ${val.msg}`)
}

const runIt = it => {
	while(!it.next().done) {}
}

runIt(
	sayThrice({msg: "hi there"})
)
```

Running the above with devtools open crashes the browser. 

It works fine without devtools open.

It works fine if I *don't* use a default parameter and default it in the old-school way `val || (val = {})`

What is the expected behavior?
For everything not to crash and die a horrible death

What went wrong?
Seems like some sort of infinite loop that triggers when generators and default parameters work in conjunction

Did this work before? No 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: 10
Flash Version: Shockwave Flash 21.0 r0

Didn't work because we didn't have default parameters before now.
 

Comment 1 by gma...@gmail.com, Mar 17 2016

Screencast: http://screencast.com/t/ItYUzdTaeGgw 

This is not specific to jsbin - I discovered this in an application

Comment 2 by gma...@gmail.com, Mar 17 2016

Getting reports that it works fine on Mac

Comment 3 by gma...@gmail.com, Mar 17 2016

Ok, this is definitely some sort of heisenbug.

* The issue occurs reliably in my main machine browser.
* Fails to occur (in jsbin) in my win10 development VM (same version of chrome)
* But I initially discovered it in my project *inside* the VM.
* After closing and re-opening devtools I can no longer replicate it inside my project
* I can still replicate it outside my project on windows 8

Comment 4 by gma...@gmail.com, Mar 17 2016

Ok, here we go. Adding debugger; to the generator seems to reliably crash for everyone http://jsbin.com/seridu/8/edit?js,console,output

Comment 5 by gma...@gmail.com, Mar 21 2016

Just as an interesting side note - until this bug is fixed that means you can

     setInterval(...the code above..., 100)

and this will crash the site if anyone opens devtools on your page.
Cc: pfeldman@chromium.org
Components: -Blink Platform>DevTools
Labels: -OS-Windows OS-All
Status: Fixed (was: Unconfirmed)
This appears to be working fine in Chrome Canary, so a fix is incoming. 

Sign in to add a comment