mozilla/valence

Debugger is broken on nightly

Closed this issue · 5 comments

past commented

STR:

  1. Open http://htmlpad.org/debugger in chrome
  2. Connect to the tab and open the debugger
  3. No sources appear and this error is displayed in the browser console:
    Error writing response to: sources protocol.js:1020
    TypeError: v.map is not a function
    Stack trace:
    types.addArrayType/<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:194:24
    RetVal<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:524:12
    Response<.write/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:677:1
    Response<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:675:23
    actorProto/</handler/sendReturn@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1018:24
    Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:887:23
    this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:766:7
    this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:707:39
    Promise*this.PromiseWalker.scheduleWalkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:707:7
    this.PromiseWalker.schedulePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:729:7
    Promise.prototype.then@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:427:5
    actorProto/</handler/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1038:18
    Actor<._queueResponse@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:915:20
    actorProto/</handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1037:9
    Connection<.onPacket<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://fxdevtools-adapters-at-mozilla-dot-org/lib/chromium/server.js:51:7
    TaskImpl_run@resource://gre/modules/Task.jsm:314:40
    TaskImpl@resource://gre/modules/Task.jsm:275:3
    createAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:249:14
    LocalDebuggerTransport.prototype.send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:569:11
    makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
    makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
    protocol.js:902
    Error getting sources: TypeError: v.map is not a function debugger-controller.js:1236:0

@jlongster does this seem related to one of your recent changes?

This is caused by the sources packet, something about the return value can't be written to the connection. Seems like it's returning null or something.

I can't think of anything that changed on our end with this. It's acting more like something has changed with Chrome's interaction. I still don't know protocol.js too well, so I'm slow to debug. I'll try to get it fixed tomorrow.

If I log the actors that are being returned from the sources packets, they are [Actor chromium_source/null],[Actor chromium_source/null] which looks bad. There's null values in there.

This is one of those times when I take a drink and wonder how this world exists at all. If I change this line: https://github.com/mozilla/valence/blob/master/lib/chromium/thread.js#L657 so that it forcefully returns an array instead, like return [...this._sources.values()];, it works. How did this ever work?

Maybe protocol.js changed, I dunno.

past commented

Bug 1174168 has landed.