Crash in [@ mozilla::WMFCDMProxyCallback::AddRef]
Categories
(Core :: Audio/Video, defect)
Tracking
()
People
(Reporter: aosmond, Assigned: alwu)
References
(Regression)
Details
(4 keywords, Whiteboard: [adv-main139+r])
Crash Data
Attachments
(2 external files)
Crash report: https://crash-stats.mozilla.org/report/index/da515645-b518-4413-bcf8-e91860250411
Reason:
EXCEPTION_ACCESS_VIOLATION_WRITE
Top 10 frames:
0 xul.dll std::_Atomic_integral<unsigned long long, 8>::fetch_add(const unsigned long l... /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/atomic:1619
0 xul.dll mozilla::ThreadSafeAutoRefCnt::operator++() xpcom/base/nsISupportsImpl.h:388
0 xul.dll mozilla::WMFCDMProxyCallback::AddRef() dom/media/eme/mediafoundation/WMFCDMProxyCallback.h:19
0 xul.dll mozilla::RefPtrTraits<mozilla::WMFCDMProxyCallback>::AddRef(mozilla::WMFCDMPr... mfbt/RefPtr.h:48
0 xul.dll RefPtr<mozilla::WMFCDMProxyCallback>::ConstRemovingRefPtrTraits<mozilla::WMFC... mfbt/RefPtr.h:408
0 xul.dll RefPtr<mozilla::WMFCDMProxyCallback>::RefPtr(mozilla::WMFCDMProxyCallback*) mfbt/RefPtr.h:108
0 xul.dll mozilla::WMFCDMProxyCallback::OnSessionMessage(mozilla::MFCDMKeyMessage const&) dom/media/eme/mediafoundation/WMFCDMProxyCallback.cpp:29
1 xul.dll mozilla::MFCDMChild::RecvOnSessionKeyMessage(mozilla::MFCDMKeyMessage const&) dom/media/ipc/MFCDMChild.cpp:441
2 xul.dll mozilla::PMFCDMChild::OnMessageReceived(IPC::Message const&) ipc/ipdl/PMFCDMChild.cpp:953
3 xul.dll mozilla::PRemoteDecoderManagerChild::OnMessageReceived(IPC::Message const&) ipc/ipdl/PRemoteDecoderManagerChild.cpp:577
| Reporter | ||
Comment 1•1 year ago
|
||
MFCDMChild::Shutdown clears the pointer on one thread and then dispatches to the manager thread:
https://searchfox.org/mozilla-central/rev/1f65969e57c757146e3e548614b49d3a4168eeb8/dom/media/ipc/MFCDMChild.cpp#131
Meanwhile MFCDMChild IPDL messages are received on the manager thread:
https://searchfox.org/mozilla-central/rev/1f65969e57c757146e3e548614b49d3a4168eeb8/dom/media/ipc/MFCDMChild.cpp#441
It is possible IPDL messages could end up running on a dangling pointer instead of just the nullptr race from this crash report.
We should guard mProxyCallback with mMutex, or only clear/set it from the manager thread. If it is always not null otherwise, I would advise clearing it in ActorDestroy so that we know it can only be cleared after all outstanding IPDL messages have been processed. That way we can avoid needing checks in every IPDL message for mProxyCallback being valid.
Comment 2•1 year ago
|
||
Set release status flags based on info from the regressing bug 1818790
| Reporter | ||
Comment 3•1 year ago
|
||
I think it is pretty easy to fix, but want to double check that if we were to move clearing mProxyCallback to the manager thread, whether that could cause other state machine issues by violating some assumptions about receiving/processing messages after shutdown was initiated?
Comment 4•1 year ago
|
||
I'll mark this sec-moderate because it sounds like a theoretical race. I only see two crashes with this signature in the last 6 months. Feel free to increase it to sec-high if you are more concerned about it than that.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 5•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 6•1 year ago
|
||
The severity field is not set for this bug.
:jimm, could you have a look please?
For more information, please visit BugBot documentation.
Comment 7•1 year ago
|
||
Set release status flags based on info from the regressing bug 1818790
Comment 9•1 year ago
|
||
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D245505
Updated•1 year ago
|
Comment 11•1 year ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: Crash
- Code covered by automated testing: no
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: n/a
- Risk associated with taking this patch: Low, this is fixing an obvious object lifetime issue
- Explanation of risk level: Classic problem well understood, classic fix
- String changes made/needed: none
- Is Android affected?: no
Updated•1 year ago
|
Updated•1 year ago
|
Comment 12•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•11 months ago
|
Description
•