Closed Bug 294146 Opened 20 years ago Closed 19 years ago

browser hangs when seeing this page after 5 sec (when using DHTML)

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mgueury, Unassigned)

References

()

Details

(Keywords: perf, qawanted, testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

There is a page than hangs Firefox and Mozilla in all version I tried.

You will see nothing for now. But please begin by going here:
> http://users.skynet.be/mgueury/mozilla/bug/2005_04_01_hang_racing/test2.html

After 5 secs, a pop up will come showing step 3. Then click OK. Everything is 
fine.

Now install, please install my extension (I am the author)

Windows (version 0.5.9)
http://htmlvalidator.sourceforge.net/mozilla/tidy_firefox_win_059.xpi
Linux (version 0.5.9)
http://htmlvalidator.sourceforge.net/mozilla/tidy_firefox_linux_059.xpi
MacOsX (version 0.5.9)
http://htmlvalidator.sourceforge.net/mozilla/tidy_firefox_macos_059.xpi

Windows (version 0.59) For firefox 1.1 beta
http://htmlvalidator.sourceforge.net/mozilla/tidy_firefox_11_win_059.xpi

Go the the same page. It is Ok, until that the step3 appears, press OK.
It hangs.


Reproducible: Always

Steps to Reproduce:
1. Install the extension (see above)
2. Maybe disable it first. Right click on the icon in the status bar and choose
   disable. 
3. Go here:
http://users.skynet.be/mgueury/mozilla/bug/2005_04_01_hang_racing/test2.html
4. Reenable the extension (icon, right click, enable)
5. Exit the browser.
6. Reopen it.
7. Go to the page, wait 5 sec. DO NOT press the OK button for step3.
8. Open the javascript debugger.
   -> go to race_menu.js line 236. 
  ...
                btf.writeln('<option value="results">Results</option>');
  ...
  Put a breakpoint at this line or some lines before.
9. Press ok.
   Debug until that line. You will see that when this line is executed, the 
   browser hangs.

-> Debug in you C environment. You will see that the JS Engine is in a 
   infinite loop.

---------------------------------------------------------------------------
(Parenthesis)
I know what code I need comment in my extension to solve the issue.
If you used the extension, you will have seen that the HTML of the page
is validated in real time. For this I read the cache of the HTML
of Firefox. If I comment the reading of the HTML it then works.
But if I can not read the HTML, my extension is useless.

If you want, you can see the code I need to comment here:
>
http://cvs.sourceforge.net/viewcvs.py/htmlvalidator/validator/tidy_extension/jar/content/tidyBrowser.js?rev=1.2&view=markup

It is these lines:

------------------------------------------------------
    try
    {
      // Use the cache key to distinguish POST entries in the cache (see
nsDocShell.cpp)
      var cacheChannel =
channel.QueryInterface(Components.interfaces.nsICachingChannel);
      cacheChannel.cacheKey = shEntry.cacheKey;
    } 
    catch(e) 
    {
    }

    var stream = channel.open();

    const scriptableStream =
Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
...
------------------------------------------------------



Actual Results:  
In short,
- Time 0: the browser open the page. The page contains several frames.
- Time 0: a timer is set in javascript to be executed in 5 sec.
          This is line 135 in race_menu.js
- Time 0: the validation is done of the page and all frames
          (If I comment this, it works)
- Time 5: the timer executes
          the popup with step3 appears. Press OK
          it start to rewrite one of the frame in Dynamic HTML this 
          race_menu.js line 236, 
          after executing it, the browser hangs

  If you run in a Firefox debugging environemnt, dedugging the code
  show that it loops infinitely in the JS engine code.


Expected Results:  
Not hangs

If you need any information, or help for me, I would do all what I can to help.
But I do not know/understand that part of the code. I would implement any
work-around if it works. But currently, I did not found a single one. 
This is the only bug of my extension. So, I can spend a lot of time to solve it.

Thanks by advance
Attached file Testcase HTML files
You can install the testcase on your own web server if you want.
This is the testcase you can find here on the web:
> http://users.skynet.be/mgueury/mozilla/bug/2005_04_01_hang_racing/test2.html

This is a simplified version of the site who caused the issue.
- To reproduce the issue, the files needs to be accessed in HTTP.
- Simply on a file system, it works.
- The problematic code is in javascript/race_menu.js

Thanks by advance
Keywords: perf, testcase
Keywords: qawanted
WFM with current trunk build.
I tried it with:
http://htmlvalidator.sourceforge.net/mozilla/tidy_firefox_win_062.xpi
I couldn't install the extension link you gave me for For firefox 1.1 beta.
I've tried it on 2 different machines to see if I could see the bug, both are WFM.
Hello Martijn,

The version that works with the last version of Firefox 1.1 post alpha 2 is
0.63. This is due to some change in Firefox code.

You can get it here (for windows):
> http://htmlvalidator.sourceforge.net/mozilla/tidy_firefox_win_063.xpi

You can find more info about the extension here: 
> http://users.skynet.be/mgueury/mozilla/download.html

Thanks

Good news, when trying with Firefox 1.0.6 it still hangs but I tested too with
one of the last nightly build of 1.1.

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050801
Firefox/1.0+

And it seems to work ! I try several time and the behavior was consistent
hang with 1.0.6 and works with 1.1 post alpha2 !

Well, if it works in the latest trunk build, then this very likely will become
resolved WORKSFORME.
per comments, wfm.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: