Note: There are a few cases of duplicates in user autocompletion which are being worked on.

"Unresponsive Script" warning blames/stops the wrong script




JavaScript Engine
7 years ago
3 years ago


(Reporter: Wladimir Palant, Unassigned)




Firefox Tracking Flags

(Not tracked)


(Whiteboard: DUPEME, URL)


(1 attachment)



7 years ago
Created attachment 453997 [details]
Testcase (Don't open unless you are prepared to kill your browser!)

A user filed an Adblock Plus bug under claiming that Adblock Plus goes into an infinite loop on a particular website and cannot be stopped. What really happened: the website went into an infinite loop and kept creating new DOM nodes. These triggered content policies, with Adblock Plus taking significantly more time than the tight loop that triggered it. Consequently the script that received the blame was pretty much always Adblock Plus. Stopping it didn't help the user because it only affected the current content policies call, not the actual infinite loop.

The issue described by RSnake under is similar, there the warning assigns the blame to NoScript rather than the loop that caused the problem.

It is possible to reproduce this issue without any extensions, see testcase. There the endless loop only changes an attribute on the body tag, the script in the DOMAttrModified event handler does much work however. The warning will always blame the DOMAttrModified event handler and suggest stopping it. This doesn't do anything to stop the endless loop however.

It seems that the handling needs to be different if the stack has native frames between JavaScript frames. I guess that the warning should identify all the frames that are followed by a native frame in addition to identifying the last JavaScript frame on stack. What's more important, it should also be able to stop these frames somehow.

Not marking as security sensitive, this kind of attacks has been widely publicized already.

Comment 1

7 years ago
Pretty sure there's an existing bug about the origin tracking on slow script being broken (e.g. through event handlers, etc).
Whiteboard: DUPEME

Comment 2

7 years ago
I searched - maybe it has some non-obvious title.
For better dupe-matching, the RSnake demo described above is at
Duplicate of this bug: 589116
bz, regarding comment 1 (dupe) are you thinking of 
 bug 78089 "A script on this page is causing mozilla to run slowly" message is too vague and badly worded
 Bug 397394 - unresponsive script should identify culpable tab

and bug 573310 states the script itself isn't running long, but the firefox stuff it calls is running too long?

I didn't find anything else. although bug 470765 about improving diag, but is is mostly WFM


3 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.