| Summary: | [WinCairo] Crash while MediaPlayerPrivateMediaFoundation::removeListener in the async callback thread | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||||
| Component: | Platform | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | achristensen, don.olmstead, eric.carlson, ews-watchlist, glenn, jer.noble, philipj, pvollan, sergio, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Fujii Hironori
2022-04-18 23:50:09 PDT
I don't know how to reproduce this crash and what is the reason. But, looking at the code, it seems that there is a problem. On the main thread, m_mediaPlayer is cleared with locking m_mutex. > void MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted() > { > Locker locker { m_mutex }; > > m_mediaPlayer = nullptr; > } However, m_mediaPlayer is accessed without locking the mutex in the async callback thread. > MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback() > { > if (m_mediaPlayer) > m_mediaPlayer->removeListener(this); > } One more problem. IMFAsyncCallback should use InterlockedIncrement and InterlockedDecrement for ref-counting. Implementing the Asynchronous Callback - Win32 apps | Microsoft Docs https://docs.microsoft.com/en-us/windows/win32/medfound/implementing-the-asynchronous-callback Created attachment 458406 [details]
Patch
Committed r293765 (250244@main): <https://commits.webkit.org/250244@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458406 [details]. |