Breakpoints are still triggered after being deleted
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(firefox-esr115 unaffected, firefox-esr128 fixed, firefox129 wontfix, firefox130 fixed, firefox131 fixed)
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | fixed |
firefox129 | --- | wontfix |
firefox130 | --- | fixed |
firefox131 | --- | fixed |
People
(Reporter: 1250079251, Assigned: jdescottes)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(5 files)
648.36 KB,
video/x-matroska
|
Details | |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Steps to reproduce:
I debugged in a new environment created in about:profiles
I debugged tab-stash via about:debugging.
I set a breakpoint at /assets/oops-notification.js:2263 and removed it
tab-stash-3.0.1: https://addons.mozilla.org/en-US/firefox/addon/tab-stash/
Actual results:
But when I removed the breakpoint, it was still triggered by Firefox.
Expected results:
Deleted breakpoints should not be triggered
Reporter | ||
Comment 1•4 months ago
|
||
Steps missing from Steps to reproduce:
- Create a new tab
This action will trigger the breakpoint
Comment 2•4 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Assignee | ||
Comment 3•4 months ago
|
||
Had a similar issue when testing webextensions previously, will try to reproduce.
Assignee | ||
Comment 4•4 months ago
|
||
My issue was different: Bug 1869495.
But I do reproduce with the STRs here. You don't even have to hit the breakpoint, just add and remove, then add a tab.
Assignee | ||
Comment 5•4 months ago
|
||
async function removeBreakpoint(location) {
delete breakpoints[makeBreakpointServerLocationId(location)];
const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
if (!hasWatcherSupport) {
// Without watcher support, unconditionally forward removeBreakpoint to all threads.
return forEachThread(async thread => thread.removeBreakpoint(location));
}
const breakpointsFront =
await commands.targetCommand.watcherFront.getBreakpointListActor();
await breakpointsFront.removeBreakpoint(location);
// Call removeBreakpoint for threads linked to targets
// not managed by the watcher.
return forEachThread(async thread => {
if (
!commands.targetCommand.hasTargetWatcherSupport(
thread.targetFront.targetType
)
) {
return thread.removeBreakpoint(location);
}
return Promise.resolve();
});
}
For webextension targets, we only call
const breakpointsFront =
await commands.targetCommand.watcherFront.getBreakpointListActor();
await breakpointsFront.removeBreakpoint(location);
Not sure I completely remember the situation for webextensions though.
I don't see any call actually processing the removed data entries, but maybe I'm looking at the wrong spot?
Comment 6•4 months ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #5)
For webextension targets, we only call
const breakpointsFront = await commands.targetCommand.watcherFront.getBreakpointListActor(); await breakpointsFront.removeBreakpoint(location);
Not sure I completely remember the situation for webextensions though.
I don't see any call actually processing the removed data entries, but maybe I'm looking at the wrong spot?
In theory, it should be going through this code:
https://searchfox.org/mozilla-central/rev/e637cd67f98ed4272d13a96db9a7674689122dcb/devtools/server/connectors/js-process-actor/DevToolsProcessChild.sys.mjs#393-417
Is targetActors
empty for some reason?
Assignee | ||
Comment 7•4 months ago
|
||
The issue is when removing the breakpoint, and it seems we don't have any special code to handle webextensions there:
https://searchfox.org/mozilla-central/rev/e637cd67f98ed4272d13a96db9a7674689122dcb/devtools/server/connectors/js-process-actor/DevToolsProcessChild.sys.mjs#455-476
#removeSessionDataEntry(watcherActorID, type, entries) {
const watcherDataObject =
ContentProcessWatcherRegistry.getWatcherDataObject(watcherActorID, true);
// When we unwatch resources after targets during the devtools shutdown,
// the watcher will be removed on last target type unwatch.
if (!watcherDataObject) {
return;
}
// Maintain the copy of `sessionData` so that it is up-to-date when
// a new worker target needs to be instantiated
lazy.SessionDataHelpers.removeSessionDataEntry(
watcherDataObject.sessionData,
type,
entries
);
for (const targetActor of watcherDataObject.actors) {
targetActor.removeSessionDataEntry(type, entries);
}
}
Comment 8•4 months ago
|
||
Good catch! That must cause various issues, beyond breakpoints...
Assignee | ||
Comment 9•4 months ago
|
||
Will try to write some tests while fixing this.
Assignee | ||
Comment 10•4 months ago
|
||
Fix removing breakpoints in webextension toolboxes and watcher targets, add tests to cover both scenarios
Assignee | ||
Updated•4 months ago
|
Assignee | ||
Comment 11•4 months ago
|
||
Depends on D218084
Comment 12•3 months ago
|
||
Comment 13•3 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a57fba6a542b
https://hg.mozilla.org/mozilla-central/rev/a6ccaa04f182
Assignee | ||
Updated•3 months ago
|
Assignee | ||
Comment 14•3 months ago
|
||
The fix has now landed on our Nightly channel. If possible, could you try the latest Nightly and verify this is fixed?
Comment 15•3 months ago
|
||
Set release status flags based on info from the regressing bug 1648499
Comment 16•3 months ago
|
||
Did you want to nominate this for uplift? Fx130 goes to RC next week.
Assignee | ||
Comment 17•3 months ago
|
||
Oh right I forgot about this during mozweek.
It would be great to uplift it if possible, this can be quite annoying when debugging webextensions and workers.
Assignee | ||
Comment 18•3 months ago
|
||
Comment on attachment 9416815 [details]
Bug 1908095 - [devtools] removeSessionDataEntry for webextension toolboxes and watcher targets
Beta/Release Uplift Approval Request
- User impact if declined: Unable to remove breakpoints when debugging webextensions or workers
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Devtools only change, which is applying the same logic to handle devtools session data (including breakpoints) for webextension/worker targets in the same way as for regular web targets.
- String changes made/needed:
- Is Android affected?: No
Comment 19•3 months ago
|
||
Comment on attachment 9416815 [details]
Bug 1908095 - [devtools] removeSessionDataEntry for webextension toolboxes and watcher targets
Approved for 130.0b8.
Updated•3 months ago
|
Comment 20•3 months ago
|
||
uplift |
Updated•3 months ago
|
Comment 21•3 months ago
|
||
Comment on attachment 9416815 [details]
Bug 1908095 - [devtools] removeSessionDataEntry for webextension toolboxes and watcher targets
Approved for 128.2esr.
Updated•3 months ago
|
Comment 22•3 months ago
|
||
uplift |
Comment 23•3 months ago
|
||
Backed out from Esr128 for causing failures at browser_dbg-features-breakpoints.js.
Backout link: https://hg.mozilla.org/releases/mozilla-esr128/rev/b59270108b4e16f03a6272a47d3b819fdad66c4d
Failure log: https://treeherder.mozilla.org/logviewer?job_id=471105823&repo=mozilla-esr128&lineNumber=8906
Comment 24•3 months ago
|
||
Feel free to wontfix this for ESR128 if it's not a trivial fix-up.
Assignee | ||
Comment 25•3 months ago
|
||
I imagine the patch itself is fine, and it's rather the test update which might be missing some other intermediary patches?
Let's see if the test fails without the updates here. If not, I think we can probably remove the part which tests workers from the test patch, there is already a test for webextensions, and both use the same codepath, so I think it would give enough coverage.
Assignee | ||
Comment 26•3 months ago
|
||
I verified on NIGHTLY
Reporter | ||
Comment 27•3 months ago
|
||
cool! The bug is gone!
Assignee | ||
Comment 28•3 months ago
|
||
Actually the implementation for workers was a bit different in 128, but it should be easy to adapt.
Assignee | ||
Comment 29•3 months ago
|
||
Fix removing breakpoints in webextension toolboxes and watcher targets, add tests to cover both scenarios
Implementation update to fit 128 ESR
Assignee | ||
Comment 30•3 months ago
|
||
Depends on D219752
Assignee | ||
Comment 31•3 months ago
•
|
||
Did a try push with my changes on top of ESR128 https://treeherder.mozilla.org/jobs?repo=try&revision=be37f112f849da8a8d24f99fd09e38b473c69dbe, hopefully this can tell us if the adapted version can work.
There was an error in my first patch, new try push at https://treeherder.mozilla.org/jobs?repo=try&revision=b2c00ca39a5c211eed24af05f6f91bc360167b10
Assignee | ||
Comment 32•3 months ago
|
||
Ryan: Could we use D219752 and D219753 for the ESR 128 uplift? The tests seem to be fine on my last try push
Updated•3 months ago
|
Updated•3 months ago
|
Comment 33•3 months ago
|
||
Sure, thanks for doing the rebase!
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Comment 34•3 months ago
|
||
uplift |
Updated•3 months ago
|
Description
•