Closed Bug 1884686 Opened 1 year ago Closed 1 year ago

Crash in [@ nsDocShell::GetBrowsingContext | nsDocumentViewer::PermitUnload]

Categories

(Core :: DOM: Navigation, defect)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox124 --- wontfix
firefox125 --- fixed
firefox126 --- fixed

People

(Reporter: mccr8, Assigned: smaug)

References

Details

(Keywords: crash)

Crash Data

Attachments

(2 files)

Crash report: https://crash-stats.mozilla.org/report/index/9647b345-2f19-4f38-968b-cba910240311

Reason: SIGSEGV / SEGV_MAPERR

Top 10 frames of crashing thread:

0  libxul.so  RefPtr<mozilla::dom::BrowsingContext>::get const  mfbt/RefPtr.h:314
0  libxul.so  RefPtr<mozilla::dom::BrowsingContext>::operator mozilla::dom::BrowsingContext* const&  mfbt/RefPtr.h:327
0  libxul.so  nsDocShell::GetBrowsingContext  docshell/base/nsDocShell.cpp:13533
0  libxul.so  nsDocumentViewer::PermitUnload  layout/base/nsDocumentViewer.cpp:1146
1  libxul.so  nsDocShell::InternalLoad  docshell/base/nsDocShell.cpp
2  libxul.so  nsDocShell::LoadHistoryEntry  docshell/base/nsDocShell.cpp:12018
3  libxul.so  nsDocShell::LoadHistoryEntry  docshell/base/nsDocShell.cpp:11939
4  libxul.so  nsDocShell::LoadURI  docshell/base/nsDocShell.cpp:783
5  libxul.so  mozilla::dom::BrowsingContext::LoadURI  docshell/base/BrowsingContext.cpp:1967
6  libxul.so  nsSHistory::LoadURIOrBFCache  docshell/shistory/nsSHistory.cpp:1403

While the bogus looking stacks with OffTheBooksMutex::Unlock in them from bug 1842606 are still present, while looking at this signature, it seems like this nsDocumentViewer::PermitUnload variation is much more common now.

It looks like the crash is on this line of nsDocumentViewer::PermitUnload:

RefPtr<BrowsingContext> bc = mContainer->GetBrowsingContext();

This looks like a missing null check on mContainer. I see two other places that do this call without an obvious null check, so maybe those need to be fixed, too.

Out of the 2687 crashes with this signature in the last 3 months, 2093 of them have PermitUnload in the proto signature (about 78%).

See Also: → 1884689

One bug 1884689 is deployed, the signature will change.

Crash Signature: [@ nsDocShell::GetBrowsingContext] → [@ nsDocShell::GetBrowsingContext] [@ nsDocShell::GetBrowsingContext | nsDocumentViewer::PermitUnload]
Summary: Crash in [@ nsDocShell::GetBrowsingContext] from nsDocumentViewer::PermitUnload → Crash in [@ nsDocShell::GetBrowsingContext | nsDocumentViewer::PermitUnload]

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

For more information, please visit BugBot documentation.

Flags: needinfo?(boris.chiou)

I'd like to move this into DOM related component, per the call stack in comment 0 (e.g. browsing context and nsSHistory).

Component: Layout → DOM: Navigation
Flags: needinfo?(boris.chiou)

Oh, this is Fenix. Non-SHIP, non-Fission.

Assignee: nobody → smaug

Yeah, I think we just miss some null checks.

Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2ef6aa240e2a null check DocumentViewer::mContainer before using it, r=mccr8
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch

Please nominate this for Beta uplift when you get a chance.

Flags: needinfo?(smaug)
Attachment #9394443 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: crashes
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: -
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Simple null check based on crash reports
  • String changes made/needed: NA
  • Is Android affected?: yes
Attachment #9394443 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: needinfo?(smaug)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: