[meta] JS Debugger doesn't pause the debuggee

RESOLVED DUPLICATE of bug 1074448

Status

P2
normal
RESOLVED DUPLICATE of bug 1074448
3 years ago
4 months ago

People

(Reporter: jimb, Unassigned)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
This is a meta-bug to be blocked by all the cases we find of the JS debugger failing to pause the debuggee.

To preserve run-to-completion semantics, when the DevTools JS debugger has paused a page (at a breakpoint; single-stepping; etc.), all other attempts to run code in the debuggee (event handlers; callbacks; Promise resolutions; etc.) should be delayed until the paused invocation has completed --- even as the devtools JS debugger UI spins a nested event loop to allow its own UI to run, and to provide access to other tabs.

Firefox, or more properly Gecko, provides no single bottleneck for delaying or dropping these invocations. There are many, many reasons the browser may try to invoke JavaScript, and each must be handled in a way that respects its particular requirements. At present, we use nsIDOMWindowUtils' suppressEventHandling and suspendTimeouts, but those don't cover everything.
(Reporter)

Comment 1

3 years ago
For bug 912337, Shu has written a patch to implement the Debugger.DebuggeeWouldRun exception, which is thrown when something tries to run code in a paused debuggee. A pref causes this to be merely a warning, not an error; this pref defaults to warning. This patch gives us a way to catch all the cases that the nsIDOMWindowUtils methods aren't handling.

This has already yielded a large list of pause violations. They're just source locations at the moment. If we could get full JS stacks from them, that would be a big step forward in helping us identify violations.

Updated

3 years ago
Priority: -- → P2
We already have a meta bug for tracking where we break run-to-completion semantics; I think we should reuse it here.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1074448
(Reporter)

Comment 3

3 years ago
(In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #2)
> We already have a meta bug for tracking where we break run-to-completion
> semantics; I think we should reuse it here.

Ah, thanks. My search didn't turn that up.
(In reply to Jim Blandy :jimb from comment #3)
> (In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #2)
> > We already have a meta bug for tracking where we break run-to-completion
> > semantics; I think we should reuse it here.
> 
> Ah, thanks. My search didn't turn that up.

Run-to-completion was arguably a very bad name for that bug :-P

Updated

4 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.