Tracer breaks on tab navigation / reload

RESOLVED FIXED in Firefox 34



Developer Tools: Debugger
5 years ago
4 years ago


(Reporter: Jake Bailey, Assigned: Jakub Jurovych)


(Blocks: 1 bug)

Firefox 34
Mac OS X
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment, 2 obsolete attachments)



5 years ago
After navigation, the Debugger API hooks for attached trace actors are no longer called. The trace actor can only be used on the new page by detaching and re-attaching the client, causing the actor to initialize a new Debugger instance.


5 years ago
Blocks: 887024

Comment 1

5 years ago

It might make sense to replace DebuggerProgressListener with a more general ProgressListener, which emits events instead of the threadActor-specific behavior. Thread actors and extra actors interested in tabNavigated events could listen to these events.
The current listener is a result of merging the debugger's and console's listeners to have a single point where tabNavigated protocol events are fired. Can't the trace actor also add it's own housekeeping stuff in there?

If you meant that we should have actors attach listeners to the progress listener for decoupling purposes, that would work too, but note that there are quite a few corner cases in that code that we must make sure are still handled properly.

Comment 3

5 years ago
That's what I meant, yeah. It seems a little awkward to just add traceActor housekeeping there since it's added as an extra actor.
Duplicate of this bug: 949922
I think we might want to just end up moving the tracer actor into script.js, as much as I hate to say it. Would also make bug 949754 and bug 949762 easier.
Assignee: nobody → nfitzgerald
Actually I think this is a Debugger API bug. I don't think onEnterFrame gets called after page reloads.
(In reply to Nick Fitzgerald [:fitzgen] from comment #6)
> Actually I think this is a Debugger API bug. I don't think onEnterFrame gets
> called after page reloads.


This bug is leaving me completely bewildered. We shouldn't need to instantiate new Debugger objects for each reload. I have no idea why our onEnterFrame isn't being called after refreshes.
Component: Developer Tools → Developer Tools: Debugger
Summary: Trace actor needs to be detached/reattached after tab navigation → Tracer breaks on tab navigation / reload
Hmmm, refreshing, stopping the tracer and restarting it, you still don't get anything.
Created attachment 8356342 [details] [diff] [review]

Finally figured out the issue. Needed to update the |TraceActor|'s || and call |this.globalManager.findGlobals| every time a new window is created.

This patch has the tracer tests passing when run individually, but when run as part of the whole debugger mochitest suite they fail. Blech.
Attachment #8350425 - Attachment is obsolete: true
Getting a bunch of weird dead object errors, and the tab actor is missing its browser property, but exit isn't being called...
Priority: -- → P3
Assignee: nfitzgerald → nobody

Comment 12

4 years ago
Created attachment 8452805 [details] [diff] [review]

I have tried to update the patch and resolve conflicts. The tests seem to pass, but tracer still doesn't work correctly.

Right now, tracer will run only on a page where DevTools was opened for the first time. This results in some interesting behaviors:

 1. Go to page A.
 2. Open DevTools.
 3. Run tracer, it works.
 1. Go to page A.
 2. Open DevTools.
 3. Go to page B in a NEW tab.
 4. Open DevTools.
 5. Run tracer on page B, it doesn't work.
 6. Run tracer on page A, it works.
 1. Go to page A.
 2. Open DevTools.
 3. Go to page B in the SAME tab.
 4. Run tracer, it doesn't work.
 5. Go back to page A.
 6. Tracer is already running and works.

When the first "traces" packet is sent (the first packet after "startedTrace"), I get this error:
> DBG-SERVER: Got an exception: metadata is undefined
> ThreadActor.prototype.globalManager.onNewGlobal@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/script.js:714:9
> ClickEventHandler.handleEvent@chrome://browser/content/content.js:265:9
Tracer stops working after a refresh. When I refresh the page and start the tracer, "traces" packets are no longer being sent, just this error shows up.

I also got this error once, but cannot reproduce it anymore:
> Handler function threw an exception: TypeError: this.traceClient is undefined
> Stack: Tracer.prototype.startTracing@chrome://browser/content/devtools/debugger-controller.js:1509:5
> TracerView.prototype<._onStartTracing@chrome://browser/content/devtools/debugger-panes.js:1227:5
> makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14
> TracerView.prototype<._onToggleTracing@chrome://browser/content/devtools/debugger-panes.js:1208:7
> makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14

I will continue working on this tomorrow.
Attachment #8356342 - Attachment is obsolete: true
Assignee: nobody → jjurovych
In bug 1039952 I'm refactoring the way we manage debuggee globals, and after that lands I think fixing this will be a lot easier.
Depends on: 1039952

Comment 14

4 years ago
Looks like Bug 1039952 fixed this.
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
QA Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.