Bug 235264 - SharedMemory::Handle::takeOwnershipOfMemory should assert that null handle is not being used
Summary: SharedMemory::Handle::takeOwnershipOfMemory should assert that null handle is...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-15 03:51 PST by Kimmo Kinnunen
Modified: 2022-01-27 12:17 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2022-01-15 03:51:33 PST
SharedMemory::Handle::takeOwnershipOfMemory should assert that null handle is not being used

Taking ownership of a memory that doesn't exist is a programming error.


ASSERTION FAILED: m_port
/Volumes/Data/worker/macOS-AppleSilicon-Big-Sur-Debug-Build-EWS/build/Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp(102) : void WebKit::SharedMemory::Handle::takeOwnershipOfMemory(WebKit::MemoryLedger) const
1   0x13ca169bc WTFCrash
2   0x103b95400 WebKit::Daemon::Decoder::~Decoder()
3   0x103bf8a18 WebKit::SharedMemory::Handle::takeOwnershipOfMemory(WebKit::MemoryLedger) const
4   0x10491c7b0 WebKit::RemoteAudioSourceProviderManager::RemoteAudio::setStorage(WebKit::SharedMemory::Handle const&, WebCore::CAAudioStreamDescription const&, unsigned long long)
5   0x10491c5d0 WebKit::RemoteAudioSourceProviderManager::audioStorageChanged(WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle const&, WebCore::CAAudioStreamDescription const&, unsigned long long)
6   0x1032dc808 void IPC::callMemberFunctionImpl<WebKit::RemoteAudioSourceProviderManager, void (WebKit::RemoteAudioSourceProviderManager::*)(WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle const&, WebCore::CAAudioStreamDescription const&, unsigned long long), std::__1::tuple<WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle, WebCore::CAAudioStreamDescription, unsigned long long>, 0ul, 1ul, 2ul, 3ul>(WebKit::RemoteAudioSourceProviderManager*, void (WebKit::RemoteAudioSourceProviderManager::*)(WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle const&, WebCore::CAAudioStreamDescription const&, unsigned long long), std::__1::tuple<WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle, WebCore::CAAudioStreamDescription, unsigned long long>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul>)
7   0x1032db340 void IPC::callMemberFunction<WebKit::RemoteAudioSourceProviderManager, void (WebKit::RemoteAudioSourceProviderManager::*)(WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle const&, WebCore::CAAudioStreamDescription const&, unsigned long long), std::__1::tuple<WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle, WebCore::CAAudioStreamDescription, unsigned long long>, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul> >(std::__1::tuple<WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle, WebCore::CAAudioStreamDescription, unsigned long long>&&, WebKit::RemoteAudioSourceProviderManager*, void (WebKit::RemoteAudioSourceProviderManager::*)(WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle const&, WebCore::CAAudioStreamDescription const&, unsigned long long))
8   0x1032b1b54 void IPC::handleMessage<Messages::RemoteAudioSourceProviderManager::AudioStorageChanged, WebKit::RemoteAudioSourceProviderManager, void (WebKit::RemoteAudioSourceProviderManager::*)(WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle const&, WebCore::CAAudioStreamDescription const&, unsigned long long)>(IPC::Connection&, IPC::Decoder&, WebKit::RemoteAudioSourceProviderManager*, void (WebKit::RemoteAudioSourceProviderManager::*)(WTF::ObjectIdentifier<WebCore::MediaPlayerIdentifierType>, WebKit::SharedMemory::IPCHandle const&, WebCore::CAAudioStreamDescription const&, unsigned long long))
9   0x1032b1988 WebKit::RemoteAudioSourceProviderManager::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
10  0x103b52b60 IPC::Connection::dispatchMessageReceiverMessage(IPC::MessageReceiver&, std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >&&)
Comment 1 Radar WebKit Bug Importer 2022-01-22 03:52:17 PST
<rdar://problem/87922927>
Comment 2 Chris Dumez 2022-01-26 12:13:42 PST
@Kimmo: Are you planning on fixing this?

I am asking because the bug is assigned to me on Bugzilla but to me in Radar :)
Comment 3 Kimmo Kinnunen 2022-01-27 12:17:19 PST
I can take it but feel free to submit a patch if it's easy for you :)