Installing an OpenSearch engine can hang forever if a GC happens while the hidden browser loads about:blank
Categories
(Firefox :: Search, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
Details
Attachments
(1 external file)
parseInHiddenBrowser in toolkit/components/search/OpenSearchLoader.sys.mjs waits for the hidden browser's about:blank load with a JS progress listener. BrowsingContextWebProgress holds its listeners only through weak references, and nothing else holds this one. If a GC runs before the load's STATE_STOP reaches the parent, the listener is collected, the promise never resolves, and the "Add search engine" action silently does nothing.
This is the cause of the "Test exceeded time limit" failures of browser_searchbar_addEngine.js and browser_oneOff.js on the -standalone configs, where startup GCs are still running during the test. Forcing a GC right after loadURI reproduces it every time.
The fix keeps the listener in a module-level Set until its load finishes.
| Assignee | ||
Comment 1•3 days ago
|
||
Should also fix browser/components/search/test/browser/browser_426329.js on ccov.
| Assignee | ||
Comment 2•3 days ago
|
||
A GC before the hidden browser's about:blank load finished could collect the
listener, and then the engine install hung.
Comment 4•2 days ago
|
||
| bugherder | ||
Description
•