Open Bug 1383997 Opened 6 years ago Updated 4 months ago

Dev Tools eventually stop opening - this.walker is null during NodeActor destroy()

Categories

(DevTools :: Inspector, defect, P3)

56 Branch
defect

Tracking

(firefox57 fix-optional)

Tracking Status
firefox57 --- fix-optional

People

(Reporter: shobson, Unassigned)

Details

After a day of opening and closing the Dev Tools in the same tab they stop opening. I can't open them with the keyboard shortcut or the menu items.

They will open in other tabs. If I close the tab and open a new one at the same URL they will open.

This has happened to me more than once but I can't narrow down steps to reproduce further than 'use them in the same tab all day' (multiple urls in that tab over the course of the day).
Do you see any errors in the Browser Console when it stops opening?
Flags: needinfo?(shobson)
I didn't know to check, I'll try next time. Do I just open the "Browser Console" option from the menu and look in there?
Flags: needinfo?(shobson)
(In reply to Stephanie Hobson [:shobson] from comment #2)
> I didn't know to check, I'll try next time. Do I just open the "Browser
> Console" option from the menu and look in there?

Yes, exactly. With any luck there will be an error message in there when you try to open the tools which could help track down the problem.
Priority: -- → P3
Browser Console output:


Got a removal of an actor we didn't know about: server1.conn7.child1/domnode704  inspector.js:785
Got a removal of an actor we didn't know about: server1.conn7.child1/domnode861  inspector.js:785
Loading failed for the <script> with source “https://www.youtube.com/yts/jsbin/player-vflUtw7jb/en_US/captions.js”.  watch:1
Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.  (unknown)
Empty string passed to getElementById().  github-bbcbec65710b47b8168b7b6c1071a8d682334e8c4c04e3b815a9528437cd7dd0.js:6:27036
Attempt to set a forbidden header was denied: Connection  2790872998-bc_manager_core.js:73:107
Attempt to set a forbidden header was denied: Connection  2790872998-bc_manager_core.js:73:107
error occurred while processing 'detach: TypeError: this.walker is null
Stack: get conn@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/inspector.js:223:5
parent@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:749:5
destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:834:18
destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:925:5
destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/inspector.js:232:5
destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:851:9
destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:925:5
destroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/styles.js:81:5
destroy@resource://gre/modules/commonjs/toolkit/load  main.js:1662
"onPacket threw an exception: Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"error occurred while processing 'detach: TypeError: this.walker is null\nStack: get conn@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/inspector.js:223:5\nparent@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:749:5\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:834:18\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:925:5\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/inspector.js:232:5\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:851:9\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:925:5\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/styles.js:81:5\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:851:9\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:925:5\ndestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/inspector.js:2733:5\nremoveActor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/common.js:261:7\nAPDestroy@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/common.js:224:7\nremoveActorPool/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1577:27\nremoveActorPool@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1577:9\n_detach@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/tab.js:897:7\nonDetach@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/tab.js:939:10\nonPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1799:15\nreceiveMessage@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:761:7\nLine: 223, column: 5"}
Stack: onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/client/main.js:944:9
send/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:570:13
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14
Line: 944, column: 9"  ThreadSafeDevToolsUtils.js:80
OpenGL compositor Initialized Succesfully.
Version: 2.1 INTEL-10.25.13
Vendor: Intel Inc.
Renderer: Intel(R) Iris(TM) Graphics 6100
FBO Texture Target: TEXTURE_2D
Attempt to set a forbidden header was denied: Connection  2790872998-bc_manager_core.js:73:107
OpenGL compositor Initialized Succesfully.
Version: 2.1 INTEL-10.25.13
Vendor: Intel Inc.
Renderer: Intel(R) Iris(TM) Graphics 6100
FBO Texture Target: TEXTURE_2D
Attempt to set a forbidden header was denied: Connection  2790872998-bc_manager_core.js:73:107
TelemetryStopwatch: requesting elapsed time for nonexisting stopwatch. Histogram: "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS", key: "null"  TelemetryStopwatch.jsm:363
Content Security Policy: Ignoring “'unsafe-inline'” within script-src: ‘strict-dynamic’ specified  (unknown)
Content Security Policy: Ignoring “https:” within script-src: ‘strict-dynamic’ specified  (unknown)
Content Security Policy: Directive ‘frame-src’ has been deprecated. Please use directive ‘child-src’ instead.  (unknown)
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_NOINTERFACE: Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIWebProgress.DOMWindow]  WebNavigationContent.js:208
Content Security Policy: The page’s settings observed the loading of a resource at self (“script-src 'nonce-ZPAVg1j9rw3lhET6DdYDtFmUKXA' 'strict-dynamic' 'unsafe-eval' 'unsafe-inline' https:”). A CSP report is being sent. Source: onsubmit attribute on INPUT element.  0
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
TelemetryStopwatch: requesting elapsed time for nonexisting stopwatch. Histogram: "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS", key: "null"  TelemetryStopwatch.jsm:363
Use of Mutation Events is deprecated. Use MutationObserver instead.  rs=AHGWq9CiAl7M7EeRXWO6SQ39hfvF4sy38Q%20line%2052%20%3E%20eval:241:212
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
GET XHR https://clients6.google.com/voice/v1/users/@me/account [HTTP/2.0 401 Unauthorized 28ms]
Content Security Policy: Ignoring “http:” within script-src: ‘strict-dynamic’ specified  (unknown)
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
Attempt to set a forbidden header was denied: Connection  2790872998-bc_manager_core.js:73:107
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
Loading failed for the <script> with source “https://3.client-channel.google.com/client-channel/js/1843161809-lcs_client_bin.js”.  client:1
The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.  hscv
ReferenceError: buzz is not defined  client:4:15
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
Content Security Policy: Ignoring “'unsafe-inline'” within script-src or style-src: nonce-source or hash-source specified  (unknown)
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]  network-monitor.js:658
Thanks, that is very helpful!

Based on the inspector trace here, somehow the call to NodeActor.destroy() is triggering a call to NodeActor.conn, which gets this from the WalkerActor (this.walker). The only place I see of where this.walker is explicitly nulled out is further on in the destroy function (https://github.com/mozilla/gecko-dev/blob/ad093e98f42338effe2e2513e26c3a311dd96422/devtools/server/actors/inspector.js#L232), so presumably the NodeActor is being instantiated with a null walker. But that doesn't make sense since the only place I know of where a NodeActor is being created is from the WalkerActor which passes `this` in to assign to `this.walker`: https://github.com/mozilla/gecko-dev/blob/ad093e98f42338effe2e2513e26c3a311dd96422/devtools/server/actors/inspector.js#L1048.

Also interesting that this is all kicked off by the PageStyleActor being destroyed at: https://github.com/mozilla/gecko-dev/blob/ad093e98f42338effe2e2513e26c3a311dd96422/devtools/server/actors/styles.js#L81.

This would be easier to debug if it was easily reproducible but this should give us enough to get started.
Component: Developer Tools → Developer Tools: Inspector
Priority: P3 → --
Summary: Dev Tools eventually stop opening → Dev Tools eventually stop opening - this.walker is null during NodeActor destroy()
And this is all wrapped up in the fact that we should try not to fail so badly if we get an error during detach (the toolbox should at least reopen if possible).

This can be simulated by adding `throw 'foo'` in NodeActor.destroy() here: https://github.com/mozilla/gecko-dev/blob/ad093e98f42338effe2e2513e26c3a311dd96422/devtools/server/actors/inspector.js#L233. Then open the Inspector and close the toolbox.  Should see a trace like:

"onPacket threw an exception: Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"error occurred while processing 'detach: foo"}
Stack: onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/client/main.js:944:9
send/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:570:13
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14
Line: 944, column: 9"

It appears the toolbox doesn't reopen after this because target.destroy() never resolves, so the toolbox doesn't finish officially closing. Alex, do you have bandwidth to look into this problem?
Flags: needinfo?(poirot.alex)
Priority: -- → P3
Product: Firefox → DevTools
Flags: needinfo?(poirot.alex)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.