New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 764693 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 684202
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

JavaScript Endless-loop prevents closing of tab and browser

Reported by mbrau...@googlemail.com, Sep 13 2017

Issue description

Chrome Version (from the about:version page):Version 61.0.3163.79 (Offizieller Build) (64-Bit)
Is this the most recent version:
OS + version: Linux vdhh-ubuntu-mb 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
CPU architecture (32-bit / 64-bit): 64-bit
Window manager:Unity
URLs (if relevant):
Behavior in Linux Firefox: InternalError: too much recursion
Behavior in Windows Chrome (if you have access to it):

What steps will reproduce the problem?
A page with this javascript:

$(document).ready(function() {
	if(window.history && history.pushState){ // check for history api support
		window.addEventListener('load', function(){
			// create history states
			history.pushState(-1, null); // back state
			history.pushState(0, null); // main state
			history.pushState(1, null); // forward state
			history.go(-1); // start in main state
					
			this.addEventListener('popstate', function(event, state){
				// check history state and fire custom events
				if(state = event.state){
					event = document.createEvent('Event');
					event.initEvent(state > 0 ? 'next' : 'previous', true, true);
					this.dispatchEvent(event);
					// reset state
					history.go(-state);
					return false;
				}
			}, false);
		}, false);
	}
});

and a click on the back button has as result, that neither tab nor browser are closeable.

What is the expected result?
Exeption: to manny recusions


What happens instead?
endless loop

Please provide any additional information below. Attach a screenshot
and backtrace if possible.

For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Labels: Needs-Triage-M61 Needs-Bisect Needs-Feedback
Can you provide a sample testfile for the ease of repro and finding regression.
Ok, i see it's not only this code. Some more of our business page code and this code causes the problem. I have to discus it with my co-workers. But here is a of the behaviour Firefox 55.0.2 (64-Bit) vs. Chrome Version 61.0.3163.79 (Offizieller Build) (64-Bit)
bug_chrome.png
286 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Sep 14 2017

Cc: ligim...@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "ligimole@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: susanjuniab@chromium.org
Labels: Needs-Feedback
mbraun81@ thanks for the issue.

Tried this issue on Ubuntu 14.04 using the latest Stable 61.0.3163.79 with the below steps.

1. launched Chrome and opened Devtools.
2. Clicked on Console, and executed the above given javascript.
3. Can see some Uncaught TypeError and can close the tab and the browser. No endless loop is observed after the javascript is run in the console.

Please find the attached screen shot and confirm if anything is missed here.
Request you to please provide us the screen cast for the better understanding of the issue.

Thanks..
764693.png
131 KB View Download
Labels: -Needs-Bisect
Removing from the bisect queue since we are not able to repro.
Components: UI>Browser>Navigation

Comment 7 by creis@chromium.org, Oct 25 2017

Mergedinto: 684202
Owner: pfeldman@chromium.org
Status: Duplicate (was: Unconfirmed)
I haven't tried the actual code shown here, but it's a known issue that a JS loop will prevent a tab from closing if DevTools is open.  Closing DevTools is the workaround.
(That problem is discussed in  issue 684202 .)

Sign in to add a comment