Closed Bug 2097416 Opened 3 days ago Closed 2 days ago

Installing an OpenSearch engine can hang forever if a GC happens while the hidden browser loads about:blank

Categories

(Firefox :: Search, defect)

defect

Tracking

()

RESOLVED FIXED
163 Branch
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.

Should also fix browser/components/search/test/browser/browser_426329.js on ccov.

A GC before the hidden browser's about:blank load finished could collect the
listener, and then the engine install hung.

Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/69b746fe423f https://hg.mozilla.org/integration/autoland/rev/5b952b04a179 Keep the OpenSearch hidden browser progress listener alive until its load finishes, r=search-reviewers,scunnane.
Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
QA Whiteboard: [search][qa-triage-done-c163/b162]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: