Closed Bug 1596323 Opened 5 years ago Closed 4 years ago

Set a thread to directory root, close then reopen debugger fails to show the directory root

Categories

(DevTools :: Debugger, defect, P3)

72 Branch
defect

Tracking

(firefox74 fixed)

RESOLVED FIXED
Firefox 74
Tracking Status
firefox74 --- fixed

People

(Reporter: chujunlu, Assigned: chujunlu)

Details

Attachments

(2 files)

Attached video reopenDebugger.mp4

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36

Steps to reproduce:

1.Open http://dbg-workers.glitch.me/ and open debugger
2.Right click at "Main Thread" in source panel
3.Click "Set directory root"
4.Close debugger
5.Reopen debugger

Actual results:

Root header shows "thread19".
Message "This page has no sources" displays.

Expected results:

Root header shows "Main Thread".
Its sources are shown.

When we set a thread to directory root, item.path, which is equal to thread.actor in a thread's case, is used as the project directory root and stored in prefs. When debugger is closed and opened again, thread.actor will be different. But the debugger state is initialized with an old directory root. e.g. directory root is server0.conn0.child1/thread19. Thread is now server0.conn1.child1/thread19. Then we check root against threadActors to get thread.name and sources. It will fail.

To get expected results, a naive thought I had was when initialized source state, if prefs.projectDirectoryRoot is a thread.actor, we bump up connX by 1, that was the only change I saw in thread.actor. This solution sounds error-prone.

I also thought about removing this behavior for threads, meaning when we set a thread to root, we don't store the root in prefs. When we reopen the debugger, it doesn't show a thread as root.

Setting a child directory under a thread to root, and reopen debugger won't cause the same issue, since thread.actor is removed from a child's path, and we only use what's left as root.

Let me know what's your take on this.

The priority flag is not set for this bug.
:jlast, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jlaster)

Thanks for the report and detailed analysis!

I can easily reproduce on my machine (Win10, Firefox Nightly) using your STRs.

Honza

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Priority: -- → P3
Flags: needinfo?(jlaster)

When we set a thread to directory root, item.path, which is equal to thread.actor in a thread's case, is used as the project directory root and stored in prefs. When debugger is closed and opened again, thread.actor will be different. But the debugger state is initialized with an old directory root. For example, directory root is server0.conn0.child1/thread19. Thread is now "server0.conn1.child1/thread19."

Assignee: nobody → chujunlu
Status: NEW → ASSIGNED

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:chujunlu, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(chujunlu)

Jason, could you please look at the patch, thanks.
Honza

Yep, sorry chujun

Pushed by jlaster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d2b4e791acf5
Do not store root in prefs when set a thread actor to project root r=jlast

Thanks Jason!

Flags: needinfo?(chujunlu)
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 74
QA Whiteboard: [qa-74b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: