Open Bug 2011566 Opened 17 days ago Updated 4 days ago

Frequent Linux devtools/client/inspector/test/browser_inspector_picker-page-reload.js | single tracking bug

Categories

(DevTools :: Inspector, defect, P1)

defect

Tracking

(firefox-esr140 unaffected, firefox147 unaffected, firefox148 unaffected, firefox149 affected)

Tracking Status
firefox-esr140 --- unaffected
firefox147 --- unaffected
firefox148 --- unaffected
firefox149 --- affected

People

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

References

(Regression)

Details

(Keywords: intermittent-failure, intermittent-testcase, regression, Whiteboard: [collect_confirm_failure])

Attachments

(1 obsolete file)

Filed by: chorotan [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=544582068&repo=autoland&task=ALEpvgOOR7-jZrKbI2KTcA.0
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/ALEpvgOOR7-jZrKbI2KTcA/runs/0/artifacts/public/logs/live_backing.log


[task 2026-01-20T23:36:10.727+00:00] 23:36:10     INFO - TEST-PASS | devtools/client/inspector/test/browser_inspector_picker-page-reload.js | The highlighter is shown on the expected node
[task 2026-01-20T23:36:10.727+00:00] 23:36:10     INFO - Try to close the toolbox via a key shortcut
[task 2026-01-20T23:36:10.728+00:00] 23:36:10     INFO - Buffered messages finished
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - TEST-UNEXPECTED-FAIL | devtools/client/inspector/test/browser_inspector_picker-page-reload.js | A promise chain failed to handle a rejection: Protocol error (SecurityError): Permission denied to access property "document" on cross-origin object from: server0.conn0.watcher2.process84//domwalker81 (resource://devtools/server/actors/thread.js:466:9) - stack: onPacket/<@resource://devtools/shared/protocol/Front.js:404:31
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - DevTools RDP*request@resource://devtools/shared/protocol/Front.js:320:14
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:57:19
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - pick@resource://devtools/client/fronts/walker.js:453:18
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - exports.safeAsyncMethod/<@resource://devtools/shared/async-utils.js:62:25
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - #onInspectorFrontAvailable@resource://devtools/client/inspector/node-picker.js:72:18
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - async*_emit@resource://devtools/shared/event-emitter.js:216:36
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - emit@resource://devtools/shared/event-emitter.js:153:10
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - manage@resource://devtools/shared/protocol/Front.js:161:36
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - async*getFront@resource://devtools/shared/protocol/types.js:568:18
[task 2026-01-20T23:36:10.734+00:00] 23:36:10     INFO - getFront@resource://devtools/client/fronts/targets/target-mixin.js:250:15
[task 2026-01-20T23:36:10.735+00:00] 23:36:10     INFO - _onTargetAvailable@resource://devtools/client/inspector/shared/walker-event-listener.js:65:42
[task 2026-01-20T23:36:10.735+00:00] 23:36:10     INFO - _emit@resource://devtools/shared/event-emitter.js:216:36
[task 2026-01-20T23:36:10.735+00:00] 23:36:10     INFO - emitAsync@resource://devtools/shared/event-emitter.js:157:17
[task 2026-01-20T23:36:10.735+00:00] 23:36:10     INFO - _onTargetAvailable@resource://devtools/shared/commands/target/target-command.js:272:33
[task 2026-01-20T23:36:10.735+00:00] 23:36:10     INFO - async*_emit@resource://devtools/shared/event-emitter.js:216:36
[task 2026-01-20T23:36:10.735+00:00] 23:36:10     INFO - emit@resource://devtools/shared/event-emitter.js:153:10
[task 2026-01-20T23:36:10.735+00:00] 23:36:10     INFO - _onTargetAvailable@resource://devtools/client/fronts/watcher.js:68:10
[task 2026-01-20T23:36:10.736+00:00] 23:36:10     INFO - _emit@resource://devtools/shared/event-emitter.js:216:36
[task 2026-01-20T23:36:10.736+00:00] 23:36:10     INFO - emit@resource://devtools/shared/event-emitter.js:153:10
[task 2026-01-20T23:36:10.736+00:00] 23:36:10     INFO - onPacket@resource://devtools/shared/protocol/Front.js:370:13
[task 2026-01-20T23:36:10.736+00:00] 23:36:10     INFO - onPacket@resource://devtools/client/devtools-client.js:516:13
[task 2026-01-20T23:36:10.736+00:00] 23:36:10     INFO - send/<@resource://devtools/shared/transport/local-transport.js:75:25
[task 2026-01-20T23:36:10.736+00:00] 23:36:10     INFO - exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:103:22
[task 2026-01-20T23:36:10.736+00:00] 23:36:10     INFO - DevToolsUtils.executeSoon*exports.executeSoon@resource://devtools/shared/DevToolsUtils.js:71:21
[task 2026-01-20T23:36:10.737+00:00] 23:36:10     INFO - send@resource://devtools/shared/transport/local-transport.js:63:21
[task 2026-01-20T23:36:10.737+00:00] 23:36:10     INFO - send@resource://devtools/server/devtools-server-connection.js:88:20
[task 2026-01-20T23:36:10.737+00:00] 23:36:10     INFO - _sendEvent@resource://devtools/shared/protocol/Actor.js:81:15
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - Actor/<@resource://devtools/shared/protocol/Actor.js:55:16
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - _emit@resource://devtools/shared/event-emitter.js:216:36
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - emit@resource://devtools/shared/event-emitter.js:153:10
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - notifyTargetAvailable@resource://devtools/server/actors/watcher.js:388:12
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - #onTargetAvailable@resource://devtools/server/connectors/js-process-actor/DevToolsProcessParent.sys.mjs:173:13
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - receiveMessage@resource://devtools/server/connectors/js-process-actor/DevToolsProcessParent.sys.mjs:366:39
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - JSActor query*onNewTargetActor@resource://devtools/server/connectors/js-process-actor/ContentProcessWatcherRegistry.sys.mjs:252:38
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - createWindowGlobalTargetActor@resource://devtools/server/connectors/js-process-actor/target-watchers/window-global.sys.mjs:462:33
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - onWindowGlobalCreated@resource://devtools/server/connectors/js-process-actor/target-watchers/window-global.sys.mjs:325:38
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - observe@resource://devtools/server/connectors/js-process-actor/target-watchers/window-global.sys.mjs:526:26
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - Rejection date: Tue Jan 20 2026 23:36:09 GMT+0000 (Coordinated Universal Time) - false == true
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - resource://testing-common/PromiseTestUtils.sys.mjs:assertNoUncaughtRejections:266
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - chrome://mochikit/content/browser-test.js:handleTask:1341
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1399
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1546
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1289
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1063
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - Leaving test 
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - GECKO(1494) | JavaScript error: , line 0: NotFoundError: No such JSProcessActor 'DevToolsProcess'
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - GECKO(1494) | JavaScript error: , line 0: NotFoundError: No such JSProcessActor 'DevToolsProcess'
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - GECKO(1494) | JavaScript error: , line 0: NotFoundError: No such JSProcessActor 'DevToolsProcess'
[task 2026-01-20T23:36:10.738+00:00] 23:36:10     INFO - GECKO(1494) | JavaScript error: , line 0: NotFoundError: No such JSProcessActor 'DevToolsProcess'
[task 2026-01-20T23:36:10.739+00:00] 23:36:10     INFO - GECKO(1494) | JavaScript error: , line 0: NotFoundError: No such JSProcessActor 'DevToolsProcess'
[task 2026-01-20T23:36:10.740+00:00] 23:36:10     INFO - GECKO(1494) | JavaScript error: , line 0: NotFoundError: No such JSProcessActor 'DevToolsProcess'
[task 2026-01-20T23:36:10.740+00:00] 23:36:10     INFO - GECKO(1494) | JavaScript error: , line 0: NotFoundError: No such JSProcessActor 'DevToolsProcess'
[task 2026-01-20T23:36:10.741+00:00] 23:36:10     INFO - Removing tab.


:ochameau, since you are the author of the regressor, bug 2003810, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(poirot.alex)

Set release status flags based on info from the regressing bug 2003810

Severity: S4 → --
Priority: P5 → --
Summary: Intermittent devtools/client/inspector/test/browser_inspector_picker-page-reload.js | single tracking bug → Frequent Linux devtools/client/inspector/test/browser_inspector_picker-page-reload.js | single tracking bug

Worth noting that the test fails exactly with the error that the bug was aiming to solve:

Protocol error (SecurityError): Permission denied to access property "document" on cross-origin object from: server0.conn0.watcher2.process84//domwalker81 (resource://devtools/server/actors/thread.js:466:9)

We should take a look soon since the patch was uplifted already.
Note that it only seems to fail on debug + tsan (slow platforms?) which we could disable? But we first need to understand if there is something to improve with the original patch.

80% of failures on TSAN, the rest on debug, we can't keep the trees orange for too long, so we should take a decision here.

Given the nature of the fix, it is completely possible that there is a period of time where document becomes a cross origin object before we destroy our target, and therefore before we nullify the window property.

I'm wondering if we could just change the getter for window to also check Cu.isRemoteProxy on the fly and return null when relevant?

Alex will check if the time where the navigation happens and document becomes cross origin is earlier than the destruction of the window global.
In parallel we could swap the conditions at https://searchfox.org/firefox-main/rev/a771bf78b90de89e0ea9d17caaa64ffa240ecd7e/devtools/server/actors/thread.js#498-502

hideOverlay() {
  if (this._canShowOverlay() && this._pauseOverlay) {
    this.pauseOverlay.hide();
  }
}

to see if that fixes the intermittent, since the error seems to come from a call to this._canShowOverlay().

Assignee: nobody → poirot.alex
Severity: -- → S3
Priority: -- → P1

We may probably hit the following theoritical race condition.

The inner window object should be updated when calling nsGlobalWindowOuter::SetNewDocument and executing its following instruction:
https://searchfox.org/firefox-main/rev/0fc599421fc27ac61c501f277cb440777f85b18a/dom/base/nsGlobalWindowOuter.cpp#2283

mInnerWindow = newInnerWindow;

at line 2283.
But that's only later at line 2487 of that same method that we ultimately destroy the target actor:
https://searchfox.org/firefox-main/rev/0fc599421fc27ac61c501f277cb440777f85b18a/dom/base/nsGlobalWindowOuter.cpp#2484-2490

// We no longer need the old inner window.  Start its destruction if
// its not being reused and clear our reference.
if (doomCurrentInner) {
  currentInner->FreeInnerObjects();
}
currentInner = nullptr;

By calling FreeInnerObjects which would trigger inner-window-destroyed and destroying the target.

So there is this theoritical given time period between these two lines where we may have changed the window reference to a cross process/origin object and the target actor is still not destroyed.

Unfortunately, there doesn't seem to be any explicit event we could use, that is exposed to privileged JS.
We may observe new globals via Spidermonkey API, when we instantiate the new global:
https://searchfox.org/firefox-main/rev/0fc599421fc27ac61c501f277cb440777f85b18a/dom/base/nsGlobalWindowOuter.cpp#2257-2263

// Every script context we are initialized with must create a
// new global.
rv = CreateNativeGlobalForInner(
    cx, newInnerWindow, aDocument, &newInnerGlobal,
    ComputeIsSecureContext(aDocument),
    newInnerWindow->IsSharedMemoryAllowedInternal(
        aDocument->NodePrincipal()));

There is the onNavigation call done at what looks like a perfect moment in time for us, but that's only calling media C++ classes and not exposed to JS:
https://searchfox.org/firefox-main/rev/0fc599421fc27ac61c501f277cb440777f85b18a/dom/base/nsGlobalWindowOuter.cpp#2175-2177

if (currentInner && currentInner->mNavigator) {
  currentInner->mNavigator->OnNavigation();
}

There seems to be mostly one relevant callsite for this method on navigation:
https://searchfox.org/firefox-main/rev/0fc599421fc27ac61c501f277cb440777f85b18a/layout/base/nsDocumentViewer.cpp#1730,1775
But couldn't spot anything useful either.

Flags: needinfo?(poirot.alex)

I was able to reproduce locally and confirm that the target actor's destroy method is called after the throwing method in thread.js.

I'm not sure we want to go that far, but I tried introducing an event just for this one devtools need. Let's see if that address tsan failure:
https://treeherder.mozilla.org/jobs?repo=try&revision=af921fd79a63a3fd2d8874c2d466cbd8aa1c296d

The patches so far don't seem to address the issue, I suggest to disable on tsan and debug (we might want to uplift that to beta/release) and we can keep investigating.

Comment on attachment 9541208 [details]
Bug 2011566 - [devtools] Disable browser_inspector_picker-page-reload.js on linux debug and tsan r=#devtools!

Revision D281159 was moved to bug 2013479. Setting attachment 9541208 [details] to obsolete.

Attachment #9541208 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: