Closed Bug 574598 Opened 14 years ago Closed 12 years ago

Firefox hangs on a page with slow running script

Categories

(Core :: General, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: nizamov.shawkat, Unassigned)

References

()

Details

(Keywords: hang, Whiteboard: [testday-20120831])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4

Just try that link - Firefox 3.6.4 hangs on that page!
I tried to disable Flash plugin - firefox still hangs. 

Reproducible: Always

Steps to Reproduce:
1. open link http://code.activestate.com/recipes/474083-get-the-path-of-the-currently-executing-python-scr/
2. see firefox hanging 
3.
Actual Results:  
firefox hangs

Expected Results:  
see what is actually written on that web page
Oops! Firefox hangs not exactly on opening that URL, but on clicking that URL from Google. So, to reproduce this big :

1) open google
2) search for "python find program directory"
3) look for the 4th or 5th link, pointing to code.activestate.com/.../474083-get-the-path-of-the-currently-executing-python-scr/
4) exact link by google is  http://www.google.com/url?sa=t&source=web&cd=4&ved=0CDcQFjAD&url=http%3A%2F%2Fcode.activestate.com%2Frecipes%2F474083-get-the-path-of-the-currently-executing-python-scr%2F&rct=j&q=python+find+program+directory+&ei=cF0kTPSiMIyCOKzU4N0C&usg=AFQjCNFQTilc4Im-GsOOhAPvVzIff54N-g&sig2=HGibwPes9D3GRP0d26p91Q
5) click on that link  
6) see how Firefox hangs
Firefox in Safe mode also hangs.
That's not a hang - there's a script running that consumes a lot of cpu (searchhi.js), which tries to highlight the search words that you used on Google. But after 10 seconds, the warning dialog comes up, and you can stop it.
Sorry, in my case this is exactly a hang, I can wait more than 10 minutes and there is no any dialogs. But this may be already another problem.
Version: unspecified → 3.6 Branch
Jo, so is this a bug with us or their script?
Note that it never hanged for me, I'm not sure why nizamov.shawkat@gmail.com experienced that.

With Mozilla 4.0.1, there's no slow-script warning either. Either the activestate.com changed something in their script, or Firefox 4.0 is now faster, and doesn't complain anymore. I guess the former.

nizamov.shawkat@gmail.com : it's it ok for you to close this bug ? Do you still see the problem ?
Yes, I still observe erratic behaviour with Firefox 4.0.1, on 2 PC's on both Windows XP 32-bit and Ubuntu 64-bit. On both systems after opening the redirection URL (from Comment #1, step 4, not from the original bugreport!) firefox shows up a part of activestate page, then it freezes for a few seconds, then it become responsive for a few seconds again and then freezes forever. Monitoring system resource I noticed that it uses 100% CPU and steadily grows up in memory till several gigabytes. On Linux then it would be killed by OOM-killer. On Windows it shows a window with message like "Firefox crashed, send a bug report back to Mozilla?". I answered "Yes", so another bugreport should be registered somewhere on Mozilla's servers. After then Firefox restarts, restores windows and guess what  - it still hangs on both systems! I do not know why others can not reproduce it while I can on both computers that are available for me right now. Just followed the link from Comment#1.
You never said that it crashed, only that it was hung. In that case, can you tell us the crash-id ? You can find it back in <about:crashes>.
Here it is:

https://crash-stats.mozilla.com/report/index/bp-902d8f4b-5dd3-4cea-961d-3974b2110531

Hungs were occuring with 3.6.4, now I am using 4.0.1. 
On Linux it really hungs, but gets silently killed by OS. On Windows it now generates a crash report. 

My environment is quite generic, the only thing that I could suspect is that we have to use a squid based proxy to access internet. Unfortunately, I can not check the case without proxy. Anyway I hardly believe that this could cause such problems.
That crash signature doesn't contain any useful information. Any other crash id's listed?

On Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17 ID:20110420140830 I get the slow running script dialog after ~10 seconds.

On Mozilla/5.0 (Windows NT 5.1; rv:7.0a1) Gecko/20110610 Firefox/7.0a1 ID:20110610030736 I am getting a fairly long hang (>30 seconds) and then finally get the slow running script warning:

A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

Script: http://code.activestate.com/static/js/searchhi.js:43
Do you observe a memory consumption increase too? In my case Firefox eats all the memory before being killed.
I do see a spike to over 400 Mb.

Nizamov -> That crash signature doesn't contain any useful information. Any other crash id's listed in about:crashes?
Nizamov -> That crash signature doesn't contain any useful information. Any other crash id's listed in about:crashes?
Hi!

I tried to reproduce the crashes, but Firefox silently upgraded from version 4.0 to version 5.0 on both PC's that I use. Now I also observe the same behavior with Firefox 5.0 as you - after a hang for a few seconds (5-15) I see the slow running script warning, on both Linux and WinXp. 

So, the bottom line is that bug was present in Firefox versions including 4.0 and have gone in Firefox 5.0. Probably, bugreport could be now closed, it is not relevant anymore.
Neither crash ID has any usable stack data. Do you have any others?

I always get the slow running script dialog, but no crash.

If no other crash ids, the best bet is to get a stacktrace with WinDGB -> https://developer.mozilla.org/en/How_to_get_a_stacktrace_with_WinDbg
Version: 3.6 Branch → 5 Branch
Attached file backtrace
I noticed that crash generally occurs on the second attempt to open that page. Can you try opening it twice, closing the corresponding tab before second attempt?
Still getting a ~30 second hang with Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110723 Firefox/8.0a1 ID:20110723030814 and then get the slow running script dialog.

Same results with closing the tab, opening a new tab, and revisiting the URL.
Summary: Firefox 3.6.4 hangs on this page → Firefox hangs on a page with slow running script
Version: 5 Branch → Trunk
http://code.activestate.com/static/js/searchhi.js
...
        }
        if (pn.className != "searchword") {
          // word has not already been highlighted!
          var nv = node.nodeValue;
          var ni = tempNodeVal.indexOf(tempWordVal);
          // Create a load of replacement nodes
          var before = document.createTextNode(nv.substr(0, ni));
          var docWordVal = nv.substr(ni, word.length);
          var after = document.createTextNode(nv.substr(ni + word.length));
          var hiwordtext = document.createTextNode(docWordVal);
          var hiword = document.createElement("span");
          hiword.className = "searchword";
          hiword.appendChild(hiwordtext);
          pn.insertBefore(before, node);
          pn.insertBefore(hiword, node);
          pn.insertBefore(after, node);
          pn.removeChild(node); <================== Line 44 with the slow Script Warning
          searchhi.found += 1;
        }
...

The Crashes - when happening - would be just OOMs, no?
Btw, the URL is killing Opera Next/GC 14 too (CPU-wise).
Keywords: hang
Product: Firefox → Core
QA Contact: general → general
I cannot reproduce the bug using today's Nightly and Windows 7.

Could you please try again with a newer Firefox version? Thanks!
Whiteboard: [testday-20120831]
hi @Gabriela.
I am having windows 7 and firefox version is 14.0.1
Facebook ticker problem is resolved.
but, still there is some random error.
It occurs after continuous usage for hours, I can't track the exact event when the hang occurs.
Hi, many thanks for your update!
Whenever it hangs, please obtain the Crash ID from about:crashes and paste it here.
Hello,

I can not reproduce this bug anymore (FF 14 on WinXP and Linux). There is even no slow script warning, url/page is opened and rendered as fast as it could be generally expected. Probably, the bug is fixed meanwhile, however, it can be attributed to the changes in my systems too.
Hi, many thanks for the update!

I will close this bug as works for me, please reopen should you have more issues.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: