Closed Bug 1676618 Opened 7 months ago Closed 4 months ago

JS Debugger frequently fails to attach to mochitests

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(firefox86 fixed)

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: standard8, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

What were you doing?

  1. Add a debugger; statement just before this line on current master: https://searchfox.org/mozilla-central/source/toolkit/components/search/tests/xpcshell/head_search.js#34
  2. Run one of the search tests
./mach mochitest browser/components/search/test/browser/browser_searchbar_focus_timing.js --jsdebugger

What happened?

The javascript debugger often fails to connect and start debugging.

This morning, it happened around 5-10 times in a row, then suddenly kicked in. I then retried it after a couple of minutes, and it was successful for a few runs, and then started failing again.

I think I have also seen this on xpcshell-tests a week or so ago.

What should have happened?

The js debugger should have connected properly.

Anything else we should know?

Please see attached for a log. In particular, in the failing cases, I'm seeing these error messages appearing just before the test starts:

 0:06.45 GECKO(15721) > console.error: (new Error("Resource \"server1.conn0.contentProcess15730/source15\" already exists, cannot insert {\"id\":\"server1.conn0.contentProcess15730/source15\",\"actor\":\"server1.conn0.contentProcess15730/source15\",\"thread\":\"server1.conn0.contentProcess15730/thread3\",\"source\":\"sourceURL-resource://gre/modules/ComponentUtils.jsm\",\"isBlackBoxed\":false,\"sourceMapBaseURL\":\"resource://gre/modules/ComponentUtils.jsm\",\"sourceMapURL\":null,\"url\":\"resource://gre/modules/ComponentUtils.jsm\",\"breakpointPositions\":{},\"breakableLines\":null}", "resource://devtools/client/debugger/src/utils/resource/core.js", 42))
 0:06.46 GECKO(15721) JavaScript warning: resource://devtools/shared/builtin-modules.js, line 196: debuggee 'resource://devtools/shared/base-loader.js:289' would run
 0:06.56 GECKO(15721) > JavaScript error: resource://devtools/client/debugger/src/utils/resource/core.js, line 42: Error: Resource "server1.conn0.contentProcess15732/source6" already exists, cannot insert {"id":"server1.conn0.contentProcess15732/source6","actor":"server1.conn0.contentProcess15732/source6","thread":"server1.conn0.contentProcess15732/thread3","source":"sourceURL-resource://gre/modules/ComponentUtils.jsm","isBlackBoxed":false,"sourceMapBaseURL":"resource://gre/modules/ComponentUtils.jsm","sourceMapURL":null,"url":"resource://gre/modules/ComponentUtils.jsm","breakpointPositions":{},"breakableLines":null}
 0:07.34 GECKO(15721) > JavaScript error: resource://devtools/client/debugger/src/utils/resource/core.js, line 42: Error: Resource "server1.conn0.contentProcess15730/source158" already exists, cannot insert {"id":"server1.conn0.contentProcess15730/source158","actor":"server1.conn0.contentProcess15730/source158","thread":"server1.conn0.contentProcess15730/thread3","source":"sourceURL-resource:///actors/ContentSearchChild.jsm","isBlackBoxed":false,"sourceMapBaseURL":"resource:///actors/ContentSearchChild.jsm","sourceMapURL":null,"url":"resource:///actors/ContentSearchChild.jsm","breakpointPositions":{},"breakableLines":null}

I'm not convinced about those errors - I've just had them on a successful run as well...

> JavaScript error: resource://devtools/client/debugger/src/utils/resource/core.js, line 42: Error: Resource "server1.conn0.contentProcess20266/source31" already exists, cannot insert {"id":"server1.conn0.contentProcess20266/source31","actor":"server1.conn0.contentProcess20266/source31","thread":"server1.conn0.contentProcess20266/thread3","source":"sourceURL-resource://devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm","isBlackBoxed":false,"sourceMapBaseURL":"resource://devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm","sourceMapURL":null,"url":"resource://devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm","breakpointPositions":{},"breakableLines":null}
 0:06.37 GECKO(20259) > JavaScript error: resource://devtools/client/debugger/src/utils/resource/core.js, line 42: Error: Resource "server1.conn0.contentProcess20266/source57" already exists, cannot insert {"id":"server1.conn0.contentProcess20266/source57","actor":"server1.conn0.contentProcess20266/source57","thread":"server1.conn0.contentProcess20266/thread3","source":"sourceURL-resource://devtools/client/jsonview/Sniffer.jsm","isBlackBoxed":false,"sourceMapBaseURL":"resource://devtools/client/jsonview/Sniffer.jsm","sourceMapURL":null,"url":"resource://devtools/client/jsonview/Sniffer.jsm","breakpointPositions":{},"breakableLines":null}
 0:06.41 GECKO(20259) JavaScript warning: resource://devtools/shared/builtin-modules.js, line 196: debuggee 'resource://devtools/shared/base-loader.js:289' would run
 0:06.44 GECKO(20259) > JavaScript error: resource://devtools/client/debugger/src/utils/resource/core.js, line 42: Error: Resource "server1.conn0.contentProcess20266/source121" already exists, cannot insert {"id":"server1.conn0.contentProcess20266/source121","actor":"server1.conn0.contentProcess20266/source121","thread":"server1.conn0.contentProcess20266/thread3","source":"sourceURL-resource://devtools/server/actors/webconsole.js","isBlackBoxed":false,"sourceMapBaseURL":"resource://devtools/server/actors/webconsole.js","sourceMapURL":null,"url":"resource://devtools/server/actors/webconsole.js","breakpointPositions":{},"breakableLines":null}
 0:06.67 GECKO(20259) > JavaScript error: resource://devtools/client/debugger/src/utils/resource/core.js, line 42: Error: Resource "server1.conn0.contentProcess20266/source131" already exists, cannot insert {"id":"server1.conn0.contentProcess20266/source131","actor":"server1.conn0.contentProcess20266/source131","thread":"server1.conn0.contentProcess20266/thread3","source":"sourceURL-resource://gre/modules/PrivateBrowsingUtils.jsm","isBlackBoxed":false,"sourceMapBaseURL":"resource://gre/modules/PrivateBrowsingUtils.jsm","sourceMapURL":null,"url":"resource://gre/modules/PrivateBrowsingUtils.jsm","breakpointPositions":{},"breakableLines":null}
 0:07.70 GECKO(20259) > JavaScript error: resource://devtools/client/debugger/src/utils/resource/core.js, line 42: Error: Resource "server1.conn0.contentProcess20266/source160" already exists, cannot insert {"id":"server1.conn0.contentProcess20266/source160","actor":"server1.conn0.contentProcess20266/source160","thread":"server1.conn0.contentProcess20266/thread3","source":"sourceURL-resource:///actors/ContentSearchChild.jsm","isBlackBoxed":false,"sourceMapBaseURL":"resource:///actors/ContentSearchChild.jsm","sourceMapURL":null,"url":"resource:///actors/ContentSearchChild.jsm","breakpointPositions":{},"breakableLines":null}

Thanks for the report!

I can reproduce the bug using STRs from comment #0

It works for me for one of the DevTools tests
STR

  1. Add debugger; keyword at this line https://searchfox.org/mozilla-central/rev/02cb78667e87ccc42fea5edc6f3f2dd2edd6ecd5/devtools/client/netmonitor/test/browser_net_api-calls.js#23
  2. Run mach test devtools/client/netmonitor/test/browser_net_api-calls.js --jsdebugger
  3. The debugger opens and hits the breakpoint.

Honza

Severity: -- → S3
Priority: -- → P3

I am consistently getting this this morning when adding a debugger; statement before https://searchfox.org/mozilla-central/source/devtools/client/framework/test/browser_toolbox_error_count.js#29 and running

./mach test devtools/client/framework/test/browser_toolbox_error_count.js --jsdebugger

Looks like getting rid of the checks at https://searchfox.org/mozilla-central/rev/c54c71ecbd9e64cafc0df3b596e206ac4072cb91/devtools/client/debugger/src/utils/resource/core.js#49-60 makes the debugger statements work again. Question is, are those checks necessary (probably?) and if yes why do we get in there too many times.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Blocks: 1687645
Attachment #9197960 - Attachment is obsolete: true
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0435260ce644
[devtools] Do not create legacy listeners twice for same target r=ochameau,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

Note that this is broken again, I'm going to look at this in Bug 1687645.

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