Closed Bug 1855544 Opened 2 years ago Closed 2 years ago

Loading any IP address URL triggers warning-spam: "WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x804B0051 (NS_ERROR_HOST_IS_IP_ADDRESS): file toolkit/components/antitracking/URLQueryStringStripper.cpp:340"

Categories

(Core :: Privacy: Anti-Tracking, defect)

defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

STR:

  1. Start a debug build of Firefox from a terminal.
  2. Visit any IP address as a URL. e.g. https://127.0.0.1/ which is localhost (it's fine if you don't have a HTTP/HTTPS server listening), or https://1.1.1.1/ (a website for a public cloudflare service)
  3. Check the output in your terminal.

ACTUAL RESULTS:
Warning-spam like the following:
[Parent 124822, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x804B0051 (NS_ERROR_HOST_IS_IP_ADDRESS): file toolkit/components/antitracking/URLQueryStringStripper.cpp:340

EXPECTED RESULTS:
No such warning.

I happened to notice this since it's particularly spammy for talos tests, which repeatedly load a resource located on a localhost-IP-address web server. If you run ./mach talos-test -a tsvgx in a debug build, then this warning gets spammed for every "cycle" (i.e. every pageload, of which there are many). But it's easier to repro by just directly loading 127.0.0.1 or any IP address.

Similar to bug 1755018, let's just build on the precise exception that we added there, to avoid warning for this NS_ERROR_HOST_IS_IP_ADDRESS failure-mode.

Depends on: 1755018

This patch doesn't change behavior.

When we hit this code with an ip-address URI, our call to GetBaseDomain() fails
with NS_ERROR_HOST_IS_IP_ADDRESS. This makes sense, since IP addresses aren't
domain names and don't have a "base domain" that could be extracted.

Rather than taking the NS_ENSURE_SUCCESS warning-spam-inducing return path for
this scenario, let's take the other equivalent no-warning return path.

Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a8000b089c66 Don't log a debug warning when URLQueryStringStripper::CheckAllowList is given an ip-address URI. r=pbz,anti-tracking-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: