Closed Bug 1975277 Opened 7 months ago Closed 6 months ago

The Web Developer Tools panel has crashed.

Categories

(DevTools :: Object Inspector, defect)

Firefox 140
defect

Tracking

(firefox141 fixed, firefox142 fixed)

RESOLVED FIXED
142 Branch
Tracking Status
firefox141 --- fixed
firefox142 --- fixed

People

(Reporter: thomhehl, Assigned: ochameau)

References

Details

Attachments

(2 files)

Error in Web Developer Tools:

Error: Protocol error (TypeError): can't access property "document", this.targetActor.window is null from: server0.conn2.watcher3 (resource://devtools/server/actors/webconsole/listeners/document-events.js:68:11)

Client Packet:

{
  "type": "watchResources",
  "resourceTypes": [
    "document-event"
  ],
  "to": "server0.conn2.watcher3"
}

Server Packet:

{
  "from": "server0.conn2.watcher3",
  "error": "TypeError",
  "message": "can't access property \"document\", this.targetActor.window is null",
  "fileName": "resource://devtools/server/actors/webconsole/listeners/document-events.js",
  "lineNumber": 68,
  "columnNumber": 11
}

Server Stack:

listen@resource://devtools/server/actors/webconsole/listeners/document-events.js:68:11
watch@resource://devtools/server/actors/resources/document-event.js:97:19
watchResources@resource://devtools/server/actors/resources/index.js:367:15
addOrSetSessionDataEntry@resource://devtools/server/actors/targets/session-data-processors/resources.js:19:21
addOrSetSessionDataEntry@resource://devtools/server/actors/targets/base-target-actor.js:86:23
#addOrSetSessionDataEntry@resource://devtools/server/connectors/js-process-actor/DevToolsProcessChild.sys.mjs:398:21
receiveMessage@resource://devtools/server/connectors/js-process-actor/DevToolsProcessChild.sys.mjs:323:46

Stacktrace:

onPacket/<@resource://devtools/shared/protocol/Front.js:404:31
DevTools RDP*request@resource://devtools/shared/protocol/Front.js:320:14
generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:57:19
_startListening@resource://devtools/shared/commands/resource/resource-command.js:1047:31

Thomas, Do you recall on what page this failed, if you are comfortable sharing it? This exception may relate to a specific behavior of that page.

Flags: needinfo?(thomhehl)

Actually, I found a way to reproduce this intermittently via the following extreme test page:
data:text/html,<iframe src="data:text/html,foo"></iframe><script>setInterval(()=>{let i = document.querySelector("iframe"); if (i) {i.remove()}else{i=document.createElement("iframe"); i.src="data:text/html,foo"+new Date().getTime();document.body.appendChild(i);}},10);</script>
DevTools fails opening when an iframe is being destroying in middle of its initialization sequence.

I looks like a possible regression of bug 1892411, but it was landed only in Firefox 141, whereas the two duplicated reports we got were reported against 140...

Flags: needinfo?(thomhehl)
Duplicate of this bug: 1975374

The target actor is correctly destroyed and unregistered on inner-window-destroyed event.
But there is a small slice of time just before that where the related docshell
no longer exposes a window object.

We can't ignore the exception in the parent process, from the JSProcessActor.sendQuery
method call as the related content process isn't destroyed, only the window global is.
We may start holding a stable reference to window on the target actor once
we get rid of non-EFT codepaths.

Assignee: nobody → poirot.alex
Attachment #9498442 - Attachment description: WIP: Bug 1975277 - [devtools] Prevent crashing devtools on destroying iframes. → Bug 1975277 - [devtools] Prevent crashing devtools on destroying iframes. r=#devtools
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by apoirot@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/256c6a7b2cac https://hg.mozilla.org/integration/autoland/rev/8a02d1275dde [devtools] Prevent crashing devtools on destroying iframes. r=devtools-reviewers,bomsy
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
Duplicate of this bug: 1977287
QA Whiteboard: [qa-triage-done-c143/b142]
Duplicate of this bug: 1979274
Duplicate of this bug: 1979276
Severity: -- → S2

The target actor is correctly destroyed and unregistered on inner-window-destroyed event.
But there is a small slice of time just before that where the related docshell
no longer exposes a window object.

We can't ignore the exception in the parent process, from the JSProcessActor.sendQuery
method call as the related content process isn't destroyed, only the window global is.
We may start holding a stable reference to window on the target actor once
we get rid of non-EFT codepaths.

Original Revision: https://phabricator.services.mozilla.com/D256013

Attachment #9503234 - Flags: approval-mozilla-release?

firefox-release Uplift Approval Request

  • User impact if declined: Users might not be able to open DevTools on pages using iframes
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: -
  • Risk associated with taking this patch: pretty low
  • Explanation of risk level: this is only adding a guard in DevTools code to prevent an exception. We don't have test nor this is verified as the issue occured randomly and might depend on hardware
  • String changes made/needed: -
  • Is Android affected?: yes
Duplicate of this bug: 1979871
Attachment #9503234 - Flags: approval-mozilla-release? → approval-mozilla-release+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: