Open Bug 1157820 Opened 9 years ago Updated 2 years ago

Fix Debug Script button in Slow Script warning

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(firefox40 affected)

Tracking Status
firefox40 --- affected

People

(Reporter: luke, Unassigned)

References

Details

Attachments

(2 files)

(This is more of a feature request b/c this doesn't work in non-e10s.)

It appears that, if you have an ilooping script, the only way to break in the debugger is to wait for the slow-script dialog and then click 'Debug Script'.  If the Debugger is already open, the UI is responsive (mmm, e10s), but clicking the Pause button has no effect.  Similarly, if you try to open the Debugger (before the slow script dialog), nothing is displayed until the slow-script dialog.

Fixing this (so that you could pause at any time) would be useful not just for debugging ilooping scripts (which in theory you can just wait out until the Slow Script dialog), but also in the case of big janks that aren't iloops, just a single turn of the event loop that takes a long time and you want to pause to see what's going on so you can step through it.
I personally would call it a bug when clicking pause isn't instant.

Setting dom.max_child_script_run_time = 1 is best you get at moment.
Can also try using profiler to determine where to place breakpoints.
Blocks: dte10s
tracking-e10s: --- → -
Product: Firefox → DevTools

Luke are these two related 1157816?

tracking-e10s: - → ---
Flags: needinfo?(luke)

IIUC, bug 1157816 was more of a simple bug report whereas I think this is a feature request. I just tried locally and it still seems to be the case that, while a script is ilooping or taking a long time, pressing 'pause' doesn't have any effect.

Flags: needinfo?(luke)
Type: defect → enhancement
Attached image image.png

The "Slow script" UI changed since the bug report and so I am attaching a screenshot.

The "Debugger" button is no longer there, and so I'll turn this report into an enhancement.

Honza

Has STR: --- → yes
Priority: -- → P3
Summary: [e10s] could the Debugger UI work for an ilooping content script before the 'Debug Script' button? → Introduce Debugger button into the Slow Script button again

For what it's worth, the 'Debug' button got removed in bug 1119442, more specifically in https://hg.mozilla.org/mozilla-central/rev/3e035332fbd3264c5701bbd092315427cd987b57. And the code to debug hanging scripts is still there.

Sebastian

I just saw that there is still a 'Debug Script' button in the Developer Edition, though it doesn't seem to work.

I tried it with the following simple test case:

data:text/html,<script>while(true){x=1;}</script>

So Honza, I think this can still be seen as a bug report. Maybe adding an option back to the release version of Firefox could be handled in a separate bug.

Sebastian

Flags: needinfo?(odvarko)

Thanks Sebastian, I switched back to "defect" and updated the bug title.

Honza

Type: enhancement → defect
Flags: needinfo?(odvarko)
Summary: Introduce Debugger button into the Slow Script button again → Fix Debug Script button in Slow Script warning

This quite severely impacts debugging in my experience. I hit this sometimes working on a complex project, and not only is the UX of having to wait for the "stop it" button to show up when I already understood its stuck annoying, the fact that I have no way of interrupting the script inside of the infinite loop means I can't troubleshoot it at all! I just know it's hanging somewhere, but there is no way to check where (let alone why).
If I hit "pause" in the debugger panel and then "stop it" in the popup, it just pauses in a random unrelated piece of code a little while later (probably in the next event listener triggered).

This is one of the very few reasons I still need to have chromium around, because every time I encounter one of these hangs and it is not immediately obvious where it is, I have to break that out and retrigger the bug there. Luckily so far I've only had to deal with easy to reproduce cases, but if a less reliable environment this might even mean having to switch to Chromium for good.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: