Closed Bug 1559761 Opened 5 years ago Closed 5 years ago

Intermittent devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js | Test timed out -

Categories

(DevTools :: Debugger, defect, P5)

defect

Tracking

(firefox-esr60 unaffected, firefox-esr68 unaffected, firefox68 unaffected, firefox69 unaffected, firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- unaffected
firefox68 --- unaffected
firefox69 --- unaffected
firefox70 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: gsvelto)

References

(Regression)

Details

(Keywords: intermittent-failure, regression, Whiteboard: [stockwell fixed:backout])

Attachments

(1 file)

Filed by: malexandru [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=252155714&repo=autoland
Full log: https://queue.taskcluster.net/v1/task/UkWheGB5T9a8JRztL2od1g/runs/0/artifacts/public/logs/live_backing.log


08:56:29 INFO - GECKO(1080) | [Child 3104, Main Thread] WARNING: NS_ENSURE_SUCCESS(mStatus, *this) failed with result 0x80004005: file z:/build/build/src/obj-firefox/dist/include\nsIURIMutator.h, line 489
08:56:29 INFO - TEST-START | devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js
08:56:29 INFO - GECKO(1080) | ++DOCSHELL 07A85400 == 3 [pid = 3464] [id = {077e8545-6492-48a0-b413-87631bf4d015}]
08:56:29 INFO - GECKO(1080) | ++DOMWINDOW == 7 (07B18280) [pid = 3464] [serial = 249] [outer = 00000000]
08:56:29 INFO - GECKO(1080) | [Child 3464, Main Thread] WARNING: No active window: file z:/build/build/src/js/xpconnect/src/XPCJSContext.cpp, line 662
08:56:29 INFO - GECKO(1080) | ++DOMWINDOW == 8 (07A88400) [pid = 3464] [serial = 250] [outer = 07B18280]
08:56:29 INFO - [1084, Main Thread] WARNING: No active window: file z:/build/build/src/js/xpconnect/src/XPCJSContext.cpp, line 662
08:56:30 INFO - GECKO(1080) | ++DOMWINDOW == 9 (0AC9D800) [pid = 3464] [serial = 251] [outer = 07B18280]
08:56:30 INFO - GECKO(1080) | ++DOCSHELL 0F00F000 == 10 [pid = 1716] [id = {ed3b6d90-35b8-435d-9888-1bb94c873256}]
<...>
08:57:59 INFO - Console message: [JavaScript Warning: "Removed unsafe attribute. Element: svg. Attribute: xmlns." {file: "resource://devtools/client/debugger/src/components/Editor/ColumnBreakpoint.js" line: 27}]
08:57:59 INFO - Buffered messages logged at 08:56:34
08:57:59 INFO - Toolbox opened and focused
08:57:59 INFO - Waiting on sources: simple-worker.js
08:57:59 INFO - Waiting for state change: source simple-worker.js exists
08:57:59 INFO - Finished waiting for state change: source simple-worker.js exists
08:57:59 INFO - Finished waiting on sources: simple-worker.js
08:57:59 INFO - Buffered messages logged at 08:56:35
08:57:59 INFO - Waiting for state change: selected source
08:57:59 INFO - Finished waiting for state change: selected source
08:57:59 INFO - Waiting for state change: selected source
08:57:59 INFO - Finished waiting for state change: selected source
08:57:59 INFO - Buffered messages finished
08:57:59 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js | Test timed out -
08:58:00 INFO - Removing tab.
08:58:00 INFO - Waiting for event: 'TabClose' on [object XULElement].
08:58:00 INFO - Got event: 'TabClose' on [object XULElement].
08:58:00 INFO - GECKO(1080) | [Child 3104, Main Thread] WARNING: No active window: file z:/build/build/src/js/xpconnect/src/XPCJSContext.cpp, line 662
08:58:00 INFO - Tab removed and finished closing
08:58:00 INFO - GECKO(1080) | --DOCSHELL 0F013000 == 8 [pid = 1716] [id = {9664e348-b26b-42eb-823e-e07a9371f5ad}] [url = chrome://devtools/content/debugger/index.html]
08:58:00 INFO - GECKO(1080) | --DOCSHELL 0F00F000 == 7 [pid = 1716] [id = {ed3b6d90-35b8-435d-9888-1bb94c873256}] [url = about:devtools-toolbox]
08:58:00 INFO - GECKO(1080) | JavaScript error: resource://testing-common/PromiseTestUtils.jsm, line 110: uncaught exception: Object
08:58:00 INFO - Console message: [JavaScript Error: "uncaught exception: Object" {file: "resource://testing-common/PromiseTestUtils.jsm" line: 110}]
08:58:00 INFO - TEST-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js | Assertion count 1 is greater than expected range 0-0 assertions. -
08:58:01 INFO - GECKO(1080) | MEMORY STAT | vsize 1096MB | vsizeMaxContiguous 293MB | residentFast 422MB | heapAllocated 103MB
08:58:01 INFO - TEST-OK | devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js | took 91157ms
08:58:01 INFO - GECKO(1080) | ++DOCSHELL 00969400 == 2 [pid = 3464] [id = {6c156ff3-772c-45b1-b29d-219e7cdf3f02}]
08:58:01 INFO - GECKO(1080) | ++DOMWINDOW == 3 (07B18700) [pid = 3464] [serial = 252] [outer = 00000000]
08:58:01 INFO - GECKO(1080) | [Child 3464, Main Thread] WARNING: No active window: file z:/build/build/src/js/xpconnect/src/XPCJSContext.cpp, line 662
08:58:01 INFO - GECKO(1080) | [Child 3464, Main Thread] WARNING: No active window: file z:/build/build/src/js/xpconnect/src/XPCJSContext.cpp, line 662
08:58:01 INFO - checking window state
08:58:01 INFO - GECKO(1080) | ++DOMWINDOW == 4 (07A82C00) [pid = 3464] [serial = 253] [outer = 07B18700]
08:58:01 INFO - TEST-START | devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers.js

Component: General → Debugger

We're hitting an assertion in the layout code here. I can't be sure but it looks like a memory-pressure event has just been sent so I wonder if it might have triggered some odd race in the layout code.

Daniel, is it possible that the memory-pressure observer in the presentation shell here triggered the assertion in the log?

Flags: needinfo?(gsvelto) → needinfo?(dholbert)

This bug is filed on the timeout, not the assertion. The assertion is a red herring -- it happens even in successful testruns, e.g. this one:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=252155713&repo=autoland&lineNumber=52841

So, you want to be looking into why we're timing out, not why we're asserting.

Flags: needinfo?(dholbert) → needinfo?(gsvelto)

(The assertion may be a sign of something subtly wrong, but it's likely unrelated to the test timeout. We actually hit it 220 times in the successful log that I linked in comment 3.)

Thanks a lot for clearing that up Daniel! Time for more digging, I'll leave the NI? open

The test seems to be getting stuck here:

https://searchfox.org/mozilla-central/rev/8ed8474757695cdae047150a0eaf94a5f1c96dbe/devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js#19

The previous line executes correctly but we don't get past this line:

https://searchfox.org/mozilla-central/rev/8ed8474757695cdae047150a0eaf94a5f1c96dbe/devtools/client/debugger/test/mochitest/helpers.js#808

So the issue is happening somewhere when adding the breakpoint. I'm now running the test using rr chaos mode to see if it's a race and I can trigger it locally. Note that it might not be a race per se, it might be possible that the memory-pressure event reclaims some weakly held object that the test is relying upon.

I managed to reproduce the issue on my machine using rr's chaos mode so it's definitely a race and a fairly narrow one because it required over 25 iterations to hit it. Apparently the memory-pressure event here is coming just at the right time to cause the code to hit the race. Unfortunately having little knowledge of how the debugger works I can't guess why adding a breakpoint in this manner can cause the test to get stuck.

Flags: needinfo?(gsvelto)

Daniel can you assign someone else here?

Flags: needinfo?(dholbert)

Sure - I think gsvelto is already investigating this, so he probably makes sense as the assignee. gsvelto, I hope you don't mind me setting it as assigned to you.

Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Flags: needinfo?(dholbert)

I think someone from devtools would be able to fix this faster than me since I have very little knowledge of the debugger's internals. What's happening here is that my patch in bug 1558554 affected the timing of this test and caused a race to be triggered in the code setting a breakpoint. This can be reproduced by running the test with rr in chaos mode so it's a timing race; I could rule out that this was caused by the GC/CC running at the same time as the test. I can have a look to try and identify the race but it would mean digging in code I'm unfamiliar with so it might take a while.

FYI this is the full command to reproduce the issue on Linux (it can take a few minutes and you can speed it up by using xvfb-run to run it headless):

env MOZ_QUIET=1 ./mach mochitest --run-until-failure --debugger=rr --debugger-args="record --chaos" devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers-early-breakpoint.js

Attached file Second race

While testing with rr I also run into another race that causes the test to fail, this time after a breakpoint is removed. I've attached the stacktrace.

(In reply to Gabriele Svelto [:gsvelto] from comment #10)

I think someone from devtools would be able to fix this faster than me since I have very little knowledge of the debugger's internals.

Perhaps yulia or jlast, both of whom have worked on this test before?

(I have zero knowledge of the debugger's internals, too.)

Flags: needinfo?(ystartsev)
Flags: needinfo?(jlaster)

Yulia, this looks like it began when the thread client refactor landed. Would you mind helping investigate?

The test tests worker breakpoint registration which is something that was designed to happen before code would execute. It looks like it is almost exclusively win32-debug, which is likely a slow platform. My guess is that the thread refactoring removed the startup invariant, which prevented races like this.

It looks like this may have largely been resolved: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b763cbbd30ec9c6f058266a40608dff2ccec9b32

Potentially by brian's fixes to rr functionality https://bugzilla.mozilla.org/show_bug.cgi?id=1484818.

Flags: needinfo?(ystartsev)
Regressed by: 1561092
Whiteboard: [stockwell disable-recommended] → [stockwell fixed:backout]
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(jlaster)
Resolution: --- → FIXED
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: