Closed Bug 220892 Opened 21 years ago Closed 21 years ago

Mozilla freezes immediately when loading this URL.

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 2000
defect
Not set
critical

Tracking

()

VERIFIED DUPLICATE of bug 13350

People

(Reporter: md-moz, Unassigned)

References

()

Details

(Keywords: hang)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20030925
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20030925

Mozilla freezes immediately when loading this URL.  I waited several minutes,
then used task manager to kill mozilla.
I get exactly the same result with firebird and MS-internet explorer.
However, it works with text based browsers links and lynx in cygwin on the same pc.
Note: lynx reports a warning after I allow it to accept a cookie: 
"Bad partial reference! - Stripping lead dots."

Reproducible: Always

Steps to Reproduce:
1. Just enter the URL then hit <enter>
2.
3.

Actual Results:  
Mozilla freezes immediately when loading this URL.

Expected Results:  
display the web page!!!

Disabling cookies does not help either.
I can confirm this on 

Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4) Gecko/20030624

Side note: there seems to be furious (layout?) activity while it hangs - memory
consumption changes rapidly while in this state. It seems like megabytes of
memory are allocated and deallocated again. I can't make out a repeating
pattern, though.
I can confirm this on 

Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4) Gecko/20030624

Side note: there seems to be furious (layout?) activity while it hangs - memory
consumption changes rapidly while in this state. It seems like megabytes of
memory are allocated and deallocated again. I can't make out a repeating
pattern, though.
It's a js problem (infinite loop) in js/src/jsinterp.c, js_Interpret(JSContext
*, long *).  pc is never reaching endpc for some reason - it's dropping back
down to a lower number before reaching endpc.

Setting it to endpc in the debugger breaks out of the loop, and the page
completes rendering.
-> JS engine, it seems
Assignee: general → rogerl
Status: UNCONFIRMED → NEW
Component: Browser-General → JavaScript Engine
Ever confirmed: true
QA Contact: general → PhilSchwartau
*** Bug 220699 has been marked as a duplicate of this bug. ***
Opera 7.20 had the same problem, I aborted after 70 seconds of loading, then the
page was shortly displayed, and replaced by an errormessage wrong URL or
something like this.

I then loaded the URL with preceding view-source:, got no problem.
view-source:http://www.ucihs.uci.edu/com/samueli/faculty/sThyagaRajan.html
For your convenience the links to the js-files:
http://www.ucihs.uci.edu/scripts/constants.js
http://www.ucihs.uci.edu/scripts/vars.js
http://www.ucihs.uci.edu/scripts/default.js

and the JS from the source file:
<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
/*
call the loadMenu() function to correctly display all frames for this site
*/ 
function highlightFlashMenu()
{
	window.setTimeout("loadMenusAndFrames( 'leftFrame', 'menu', 0, '_Level0',
'menu01' )", TIMEOUT );
}

/*##############################################################################
CHANGE THE CONSTANTS AND VARIABLE BELOW THIS LINE TO CUSTOMIZE FOR EACH PAGE
##############################################################################*/

// CONSTANT FRAMESET_DIR is the directory name under which the frameset file resides
//
// it is IGNORED if its value is set to 	IGNORE_DIR
//
var FRAMESET_DIR = "demo";

var FRAMESET_PAGE = "index.html";
var TOP_FRAME_PAGE = "top.html";
var LEFT_FRAME_PAGE = "menu.html";
var MAIN_FRAME_PAGE = self.location.pathname.substring(
self.location.pathname.lastIndexOf( "/" ) + 1 );

// this variable should be changed for each new site; You can pick something
// random that you deem would not be used by another site using this same
// script
var HIDDEN_FRAME = "demo33847Frame";  

// -->
</script>
<script language="JavaScript" type="text/javascript"
src="../../../../scripts/checkForFrame.js"></script>

<script language="JavaScript" type="text/javascript">
<!--
function verifyPageLoad()
{
	normalizeFrame();

	// now make sure the menu movie is in the right frame
	highlightFlashMenu();
}
// -->
</script>

This can be the culprit: can it be that this loads itself?

http://www.ucihs.uci.edu/scripts/checkForFrame.js
.....

It starts a /*** comment, has -------, <!-- --> and lots of //comments, text, js
, then:
				
2) Immediately after the above script, place a reference to this script on the
page where you placed the above script.  For example, if this page is located in
the scripts folder under the site root, then make the following reference:
			
<script language="JavaScript" type="text/javascript"
src="scripts/checkForFrame.js"></script>
			
and then ends the comment with *****/ and has some code.

Keywords: hang
When I debug http://www.ucihs.uci.edu/scripts/checkForFrame.js
in Mozilla's Tools > Web Development > JavaScript Debugger, I get
into an infinite loop here:


while( curDir != FRAMESET_DIR )
{
  fileDirFromRoot = framesetLoc.substring(
          framesetLoc.lastIndexOf( urlSeparator ) + 1 ) + "/" + fileDirFromRoot;
  
  framesetLoc = framesetLoc.substring(
                0, framesetLoc.lastIndexOf( urlSeparator ) );

  curDir = framesetLoc.substring(
           framesetLoc.lastIndexOf( urlSeparator ) + 1, framesetLoc.length );
}


Here is how the values of each of these three variables progressed
as I stepped through the loop;

0001: fileDirFromRoot
$[0] = [string] ""
0001: framesetLoc
$[1] = [string] "/com/samueli/faculty"
0001: curDir
$[2] = [string] "faculty"


0001: fileDirFromRoot
$[0] = [string] "faculty/"
0001: framesetLoc
$[1] = [string] "/com/samueli"
0001: curDir
$[0] = [string] "samueli"


0001: fileDirFromRoot
$[0] = [string] "samueli/faculty/"
0001: framesetLoc
$[0] = [string] "/com"
0001: curDir
$[1] = [string] "com"


0001: fileDirFromRoot
$[2] = [string] "com/samueli/faculty/"
0001: framesetLoc
$[0] = [string] ""
0001: curDir
$[1] = [string] ""


0001: fileDirFromRoot
$[0] = [string] "/com/samueli/faculty/"
0001: framesetLoc
$[1] = [string] ""
0001: curDir
$[2] = [string] ""


0001: fileDirFromRoot
$[0] = [string] "//com/samueli/faculty/"
0001: curDir
$[1] = [string] ""
0001: curDir
$[2] = [string] ""


0001: fileDirFromRoot
$[2] = [string] "///com/samueli/faculty/"
0001: framesetLoc
$[3] = [string] ""
0001: curDir
$[4] = [string] ""


and so on and so on. The loop never terminates because the 
variable |curDir|, now empty, will never be equal to the
test condition |FRAMESET_DIR|, which is non-empty.


Reassigning to Tech Evangelism so the site can be contacted -
Assignee: rogerl → english-us
Component: JavaScript Engine → English US
Product: Browser → Tech Evangelism
QA Contact: PhilSchwartau → english-us
Version: Trunk → unspecified
this really isn't evang since it causes the same problem in IE, Opera and
Mozilla for each of the faculty members I tested. I wrote to cms@uci.edu and
told them, but am inclined to invalid this.

Phil, shouldn't we behave better and throw a warning dialog about this script is
causing the browser to hang?
Status: NEW → ASSIGNED
Target Milestone: --- → Nov
Bob: you're right, I didn't notice that IE hangs here, too.

The problem this site causes is covered by
bug 13350 "DOM needs to police JS infinite loops, schedule garbage collection"

Should we reassign this bug to DOM Level 0 and resolve it as a duplicate?
ok. done.

*** This bug has been marked as a duplicate of 13350 ***
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Component: English US → DOM Level 0
Product: Tech Evangelism → Browser
Resolution: --- → DUPLICATE
Target Milestone: Nov → ---
Version: unspecified → Trunk
Marking Verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.