Open Bug 1837480 Opened 1 year ago Updated 1 year ago

Debugger automatically continues execution when moving mouse and hovering over source code

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned, NeedInfo)

References

Details

I've seen this happening quite often already that the debugger doesn't wait until the next or continue button is clicked but automatically continues the execution sporadically. So far I have seen that when debugging code from the Remote Protocol, here specifically in the content process.

A recording of this problem can be found at:
https://www.dropbox.com/s/73hbpo1xkmwbtpk/debugger.mov?dl=0

And here the related browser log when running a browser chrome test:

 0:06.76 GECKO(30963) JavaScript warning: resource://devtools/server/actors/utils/event-loop.js, line 82: debuggee 'resource:///actors/AboutReaderChild.sys.mjs:205' would run
 0:06.76 INFO Console message: [JavaScript Warning: "debuggee 'resource:///actors/AboutReaderChild.sys.mjs:205' would run" {file: "resource://devtools/server/actors/utils/event-loop.js" line: 82}]
 0:31.90 PASS Got expected amount of internalIds in serializationInternalMap - 0 == 0 -
 0:31.90 PASS Got expected structure - {"type":"window"} deepEqual {"type":"window"} -
 0:31.90 INFO Checking 'node' with none ownershipType
 0:32.04 GECKO(30963) JavaScript warning: resource://devtools/server/actors/object.js, line 64: debuggee 'resource://gre/modules/ContentDOMReference.sys.mjs:1' would run
 0:32.04 INFO Console message: [JavaScript Warning: "debuggee 'resource://gre/modules/ContentDOMReference.sys.mjs:1' would run" {file: "resource://devtools/server/actors/object.js" line: 64}]
 0:33.12 GECKO(30963) console.error: (new Error("Polling for changes failed: Unexpected content-type \"text/plain;charset=US-ASCII\".", "resource://services-settings/remote-settings.sys.mjs", 324))
 0:33.51 GECKO(30963) 30965> console.error: (new Error("Polling for changes failed: Unexpected content-type \"text/plain;charset=US-ASCII\".", "resource://services-settings/remote-settings.sys.mjs", 324))
 0:35.61 GECKO(30963) JavaScript warning: resource://devtools/server/actors/object.js, line 230: debuggee 'resource://gre/modules/ContentDOMReference.sys.mjs:75' would run
 0:35.61 INFO Console message: [JavaScript Warning: "debuggee 'resource://gre/modules/ContentDOMReference.sys.mjs:75' would run" {file: "resource://devtools/server/actors/object.js" line: 230}]
 0:37.00 GECKO(30963) JavaScript warning: resource://devtools/server/actors/object.js, line 230: debuggee 'resource://gre/modules/ContentDOMReference.sys.mjs:75' would run
 0:37.00 INFO Console message: [JavaScript Warning: "debuggee 'resource://gre/modules/ContentDOMReference.sys.mjs:75' would run" {file: "resource://devtools/server/actors/object.js" line: 230}]

Looking at the video we can notice that source tabs keep being renamed, added, all named source + a number, meaning we are in eval'd code.

Here we are debugging code which is evaluated in content processes thanks to SpecialPowers.spawn, which might explain why we see that.
And we also know that we have slightly regressed our behavior for pausing frames with EFT (cf bug 1833637).

Edit: would be interesting to try to set devtools.every-frame-target.enabled to false and see if that helps.

Whiteboard: [devtools-triage]

Quick need info: can you share the STRs now that the test landed in tree.

While watching the video during triage, Nicolas noticed that the main thread gets selected at the end, and that's where the UI becomes "unpaused", but the thread where you paused should still be "paused". We should definitely improve the UI here to make it clearer that there is a paused thread. We also need to investigate why we switch to the main thread for no reason here.

Flags: needinfo?(hskupin)
Whiteboard: [devtools-triage]

Sorry for the delay here. The command to run to get this reproduced is the following:

./mach test remote/webdriver-bidi/test/browser/browser_RemoteValueDOM.js --jsdebugger

Before just set a debugger statement in line 187 within that test file. Running the test press continue once, and then once or twice to step over. Moving the mouse around afterward usually triggers the bug immediately for me.

Flags: needinfo?(hskupin)

Bug 1835629 fixed issues around the popup preview trigerring breakpoints.
I tried comment 3 STR with recent m-c and couldn't reproduce.

Henrik, could you confirm this is now fixed?

Depends on: 1835629
Flags: needinfo?(hskupin)

I just tested with a build from today and the problem is still persistent when I follow my steps from comment 3.

Flags: needinfo?(hskupin)

Alex will take another look

Severity: -- → S3
Flags: needinfo?(poirot.alex)
Priority: -- → P3

As it looks like adding breakpoints anywhere within the MarionetteCommandsChild actor implementation triggers this bug. It's even not necessary to click or step-through before. Just moving the mouse around or waiting a bit is enough, but also makes it very hard to debug that code.

You need to log in before you can comment on or make changes to this bug.