Closed Bug 2058727 Opened 1 month ago Closed 1 month ago

ASRouterTriggerListeners has broken uri.host check ( NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.host] )

Categories

(Firefox :: Messaging System, defect, P2)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: Gijs, Assigned: yazan, NeedInfo)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

ASRouterTriggerListeners seems to want to check uri.host but doesn't realize that some URLs don't have hosts.

Stack:

 NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.host]
    checkURLMatch resource:///modules/asrouter/ASRouterTriggerListeners.sys.mjs:95
    onLocationChange resource:///modules/asrouter/ASRouterTriggerListeners.sys.mjs:545
    callListeners chrome://browser/content/tabbrowser/tabbrowser.js:1385
    _callProgressListeners chrome://browser/content/tabbrowser/tabbrowser.js:1405
    _callProgressListeners chrome://browser/content/tabbrowser/tabbrowser.js:9415
    onLocationChange chrome://browser/content/tabbrowser/tabbrowser.js:9907
tabbrowser.js:1390:23
    callListeners chrome://browser/content/tabbrowser/tabbrowser.js:1390
    _callProgressListeners chrome://browser/content/tabbrowser/tabbrowser.js:1405
    _callProgressListeners chrome://browser/content/tabbrowser/tabbrowser.js:9415
    onLocationChange chrome://browser/content/tabbrowser/tabbrowser.js:9907

This is from https://searchfox.org/firefox-main/rev/d5c0bb96ad84524b445ee72323a4c91176d20b4c/browser/components/asrouter/modules/ASRouterTriggerListeners.sys.mjs#95 - there is a try...catch for the earlier host read, but not here. Presumably this fails when switching from a non-host to a host URI. Otherwise I don't know what the consequences of this exception are.

Assignee: nobody → yalmacki
Blocks: fxms-infra
Priority: -- → P2

The severity field is not set for this bug.
:dmosedale, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(dmosedale)
Pushed by yalmacki@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/520993a420ef https://hg.mozilla.org/integration/autoland/rev/a968f2a63c96 Guard against nsIURI.host throwing on originalLocation in checkURLMatch. r=omc-reviewers,emcminn
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
QA Whiteboard: [qa-triage-done-c157/b156]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: