Closed Bug 1645997 Opened 4 years ago Closed 4 years ago

Crash in [@ mozilla::dom::WindowContext::TopWindowContext]

Categories

(Core :: DOM: Security, defect, P1)

Unspecified
Windows 10
defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox77 --- unaffected
firefox78 --- unaffected
firefox79 --- fixed

People

(Reporter: achronop, Assigned: timhuang)

References

(Regression)

Details

(Keywords: crash, regression, Whiteboard: [domsecurity-active])

Crash Data

Attachments

(1 file)

This bug is for crash report bp-6e389eff-7965-42e7-ba59-d40280200615.

Top 10 frames of crashing thread:

0 xul.dll mozilla::dom::WindowContext::TopWindowContext docshell/base/WindowContext.cpp:60
1 xul.dll mozilla::PermissionDelegateHandler::GetPermission extensions/permissions/PermissionDelegateHandler.cpp:254
2 xul.dll mozilla::MediaManager::IsActivelyCapturingOrHasAPermission dom/media/MediaManager.cpp:4041
3 xul.dll mozilla::PeerConnectionMedia::GetPrefObfuscateHostAddresses const media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp:338
4 xul.dll mozilla::PeerConnectionMedia::GatherIfReady media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp:449
5 xul.dll mozilla::PeerConnectionImpl::OnSetDescriptionSuccess media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp:2281
6 xul.dll mozilla::PeerConnectionImpl::SetLocalDescription media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp:1356
7 xul.dll mozilla::dom::PeerConnectionImpl_Binding::setLocalDescription dom/bindings/PeerConnectionImplBinding.cpp:236
8 xul.dll mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions> dom/bindings/BindingUtils.cpp:3219
9 xul.dll js::InternalCallOrConstruct js/src/vm/Interpreter.cpp:578

I believe this is a regression from 1587743 because crash started right after it landed, and because those patches make use of WindowContext::TopWindowContext().

Flags: needinfo?(tihuang)

Set release status flags based on info from the regressing bug 1587743

Assignee: nobody → tihuang
Status: NEW → ASSIGNED
Flags: needinfo?(tihuang)
Severity: -- → S2
Priority: -- → P1
Whiteboard: [domsecurity-active]

I suspect that we call the WindowContext::TopWindowContext() on a nullptr. This means the document where we get the windowContext is detached from a window. This could happen, I will write a patch to fix this.

We used the Document::GetWindowContext() to get the window context
related to the doucment. But, this could return a nullptr if the
document is detached from the window or the docuemnt is destoried.

We move to use the BrowsingContext instead which won't return a nullptr
in these cases.

See Also: → 1646608
Pushed by tihuang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/08c6683cd6be
Use BrowsingContext to get the top-level window context in PermissionDelegateHandler.cpp r=baku
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: