Intermittent leakcheck large nsGlobalWindowInner | browser/components/aiwindow/ui/test/browser/browser.toml
Categories
(Core :: Machine Learning: Frontend, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr140 | --- | unaffected |
| firefox149 | --- | unaffected |
| firefox150 | --- | affected |
| firefox151 | --- | affected |
People
(Reporter: intermittent-bug-filer, Unassigned)
References
(Regression)
Details
(Keywords: intermittent-failure, regression, test-verify-fail, Whiteboard: [stockwell unknown])
Attachments
(1 obsolete file)
Filed by: asilaghi [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=554572290&repo=autoland&task=K8qXtzROSguPOAd1mSgv9Q.0
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/K8qXtzROSguPOAd1mSgv9Q/runs/0/artifacts/public/logs/live_backing.log
Reftest URL: https://hg.mozilla.org/mozilla-central/raw-file/default/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/K8qXtzROSguPOAd1mSgv9Q/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1
[task 2026-03-19T14:53:14.904+00:00] 14:53:14 INFO - TEST-INFO | leakcheck | tab leaked 2 xpc::CompartmentPrivate
[task 2026-03-19T14:53:14.910+00:00] 14:53:14 INFO - TEST-UNEXPECTED-FAIL | leakcheck large nsGlobalWindowInner | browser/components/aiwindow/ui/test/browser/browser.toml
[task 2026-03-19T14:53:14.910+00:00] 14:53:14 INFO - leakcheck | Processing leak log file /tmp/tmp8tx75xfn.mozrunner/runtests_leaks_forkserver_pid6910.log
[task 2026-03-19T14:53:14.910+00:00] 14:53:14 INFO - TEST-PASS | leakcheck | forkserver no leaks detected!
| Comment hidden (Intermittent Failures Robot) |
Comment 3•5 months ago
|
||
:npodgurski, since you are the author of the regressor, bug 2023911, could you take a look?
For more information, please visit BugBot documentation.
Comment 4•5 months ago
|
||
Hi, I'm not too familiar with this process - digging a bit I suspect it may be related to the changes made in bug 2023911 to file firefox/browser/components/aiwindow/ui/test/browser/browser_smartwindow_telemetry.js - Maybe there's a window or tab in one of those tests that wasn't fully cleaned up. I have a few open patches already https://phabricator.services.mozilla.com/D289293 https://phabricator.services.mozilla.com/D288707 that target this file so I could look to resolve it there. Although I'm unable to reproduce that exact error/log locally
Comment 5•5 months ago
|
||
(In reply to npodgurski from comment #4)
Hi, I'm not too familiar with this process - digging a bit I suspect it may be related to the changes made in bug 2023911 to file
firefox/browser/components/aiwindow/ui/test/browser/browser_smartwindow_telemetry.js- Maybe there's a window or tab in one of those tests that wasn't fully cleaned up. I have a few open patches already https://phabricator.services.mozilla.com/D289293 https://phabricator.services.mozilla.com/D288707 that target this file so I could look to resolve it there. Although I'm unable to reproduce that exact error/log locally
Have you tried a debug build? Leak checking only runs in debug builds.
| Comment hidden (Intermittent Failures Robot) |
Comment 7•5 months ago
|
||
Bug 1984528 is another symptom of massive leakiness in this directory.
Comment 9•5 months ago
|
||
Set release status flags based on info from the regressing bug 2023911
| Comment hidden (Intermittent Failures Robot) |
Updated•5 months ago
|
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
Comment 23•4 months ago
|
||
Have you tried a debug build? Leak checking only runs in debug builds.
Yes, even on debug builds I am unable to reproduce this on the latest nightly
| Comment hidden (Intermittent Failures Robot) |
Comment 25•4 months ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #7)
Bug 1984528 is another symptom of massive leakiness in this directory.
Was again in my bugmail, so I spent a few tokens and here is what AI says about this bug (apparently a tests-only problem). I do not know any of this code, so leaving this here:
The root cause is that several tests in this file open AI windows without stubbing
openAIEngine.build. When a chat message is submitted,submitChatMessagecalls#fetchAIResponseas fire-and-forget (no await) [1]. Inside that flow,#addConversationTitle[2] fires off another un-awaitedopenAIEngine.build("title_generation", ...). In test environments without RemoteSettings data for that feature, the engine build promise hangs indefinitely. The pending promise's closure capturesthis(the AIWindow element), which prevents the content window's nsGlobalWindowInner from being GC'd.The
stubEngineNetworkBoundarieshelper [3] exists specifically to fix this — it stubsopenAIEngine.buildso non-chat features resolve immediately. Its JSDoc even calls out#addConversationTitleby name. However, neither the three tests added by the regressor nor the olderwithServerhelper [4] use it.withServeronly stubsgetFxAccountTokenand sets up a mock HTTP server, leavingopenAIEngine.buildunstubbed.Before the regressor, the test file had 8 tests opening AI windows (5 with no engine stubbing, 3 via
withServer). The regressor added 3 more windows, making the intermittent race between "engine build hangs" and "leak checker runs GC" more likely to trigger.The fix would be to switch the tests that use
withServer(or nothing) tostubEngineNetworkBoundariesinstead, which was designed for exactly this purpose.[1] https://searchfox.org/firefox-main/rev/a5b4b687e31a4b9b5a27b602fdfa97aff2d941ca/browser/components/aiwindow/ui/components/ai-window/ai-window.mjs#1082
[2] https://searchfox.org/firefox-main/rev/a5b4b687e31a4b9b5a27b602fdfa97aff2d941ca/browser/components/aiwindow/ui/components/ai-window/ai-window.mjs#1227
[3] https://searchfox.org/firefox-main/rev/a5b4b687e31a4b9b5a27b602fdfa97aff2d941ca/browser/components/aiwindow/ui/test/browser/head.js#194
[4] https://searchfox.org/firefox-main/rev/a5b4b687e31a4b9b5a27b602fdfa97aff2d941ca/browser/components/aiwindow/ui/test/browser/head.js#980
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
Comment 33•4 months ago
|
||
withServer used to leave openAIEngine.build unstubbed, so background
async chains kicked off by submitChatMessage (notably #addConversationTitle
-> openAIEngine.build("title_generation", ...)) would hang indefinitely
in test environments without RemoteSettings data, pinning the AIWindow's
content nsGlobalWindowInner past CC/GC.
Fold withServer into stubEngineNetworkBoundaries (with "chat" passthrough)
so callers get the same network-boundary stubbing without changing shape,
and plumb the resulting buildStub through the withServer task callback so
existing tests that wanted to inspect openAIEngine.build calls can do so
through the helper's stub instead of installing their own sb.spy (which
would collide with the stub the helper now installs).
Updated•4 months ago
|
| Comment hidden (Intermittent Failures Robot) |
Updated•4 months ago
|
Updated•4 months ago
|
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
Description
•