Closed Bug 1911529 Opened 2 months ago Closed 2 months ago

MOZ_DIAGNOSTIC_ASSERT(equal) (aLoadState should contain the same URI passed to this function.)

Categories

(Core :: Networking, defect, P1)

defect

Tracking

()

VERIFIED FIXED
131 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox129 --- unaffected
firefox130 + verified
firefox131 --- verified

People

(Reporter: jjaschke, Assigned: valentin)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [necko-triaged][necko-priority-queue])

Crash Data

Attachments

(2 files)

The diagnostic assert introduced in Bug 1901139 is responsible for some crash reports.

Steps to reproduce:

Duplicate of this bug: 1911530

Copying crash signatures from duplicate bugs.

Crash Signature: [@ nsWindowWatcher::OpenWindowInternal]

:edgar, since you are the author of the regressor, bug 1901139, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(echen)

Taking over since Edgar is on leave.

Marking S2 for now, fix incoming likely today.

Severity: -- → S2
Flags: needinfo?(echen)

The issue in this specific test case seems to be that the URL in the link contains a /./: https://github.com/coder/coder/edit/main/docs/./enterprise.md

The mentioned assert seems to compare the URI with a coalesced version of the URL (where the /./ has been replaced with /), which fails. I guess the bug here is in nsIURI::Equals(), but I'll do a quick fix in here to make sure the current issue is fixed and can be uplifted.

It seems that there's a bug in the path coalescing code coming from bug 1904582.
As far as I can tell the problem is with the basename's mLen field - when comparing a normalized url vs a reparsed url the two lengths don't match so equals returns false.

Assignee: nobody → valentin.gosu
Component: DOM: Navigation → Networking
Priority: -- → P1
Whiteboard: [necko-triaged]
Whiteboard: [necko-triaged] → [necko-triaged][necko-priority-queue]

mBasename.mLen is only supposed to cover the length of the name apart from
the extension. When there is an extension, we must subtract 1 + the length of
the extension in order to get the correct basename length.

[Tracking Requested - why for this release]:
Incorrect URL parsing may trigger asserts and return the wrong basename for a file.

Regressed by: 1904582
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/6bce1ffcd280 nsStandardURL::mBasename.mLen isn't properly updated when coalescing r=necko-reviewers,kershaw
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch

mBasename.mLen is only supposed to cover the length of the name apart from
the extension. When there is an extension, we must subtract 1 + the length of
the extension in order to get the correct basename length.

Original Revision: https://phabricator.services.mozilla.com/D218529

Attachment #9418020 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Incorrect URL parsing may trigger asserts and return the wrong basename for a file.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Follow instructions in bug 1911529 comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: This code is covered by tests and fuzzing.
  • String changes made/needed: none
  • Is Android affected?: yes
Flags: qe-verify+
Attachment #9418020 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Issue is reproducible on a 2024-08-05 Nightly build on Windows 10.
Verified as fixed on Firefox 130.0b2 and Firefox Nightly 131.0a1 on Windows 10, Ubuntu 22, macOS 14.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: