Bug 223228

Summary: Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web AudioAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, darin, eric.carlson, ews-watchlist, ggaren, glenn, jer.noble, peng.liu6, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 223226    
Attachments:
Description Flags
Patch none

Chris Dumez
Reported 2021-03-15 17:29:09 PDT
Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum() since this runs on the audio thread: Thread 11 Crashed:: RemoteAudioDestinationProxy render thread 3 com.apple.WebCore 0x00000005608bce75 WTF::FastMalloc::malloc(unsigned long) + 21 (FastMalloc.h:246) 4 com.apple.WebCore 0x00000005608bcdc2 bool WTF::VectorBufferBase<unsigned char, WTF::FastMalloc>::allocateBuffer<(WTF::FailureAction)0>(unsigned long) + 178 (Vector.h:301) 5 com.apple.WebCore 0x00000005608bcbe1 bool WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>::reserveCapacity<(WTF::FailureAction)0>(unsigned long) + 113 (Vector.h:1195) 6 com.apple.WebCore 0x00000005608bcb10 bool WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>::expandCapacity<(WTF::FailureAction)0>(unsigned long) + 112 (Vector.h:1056) 7 com.apple.WebCore 0x00000005608bc25d WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>::resize(unsigned long) + 141 (Vector.h:1102) 8 com.apple.WebCore 0x0000000564803e34 WebCore::WebAudioBufferList::setSampleCount(unsigned int) + 244 (WebAudioBufferList.cpp:99) 9 com.apple.WebKit 0x0000000551bd8910 WebKit::RemoteAudioDestinationProxy::renderQuantum() + 144 (RemoteAudioDestinationProxy.cpp:165) 10 com.apple.WebKit 0x0000000551c0161b WebKit::RemoteAudioDestinationProxy::startRenderingThread()::$_10::operator()() + 91 (RemoteAudioDestinationProxy.cpp:87) 11 com.apple.WebKit 0x0000000551c0158e WTF::Detail::CallableWrapper<WebKit::RemoteAudioDestinationProxy::startRenderingThread()::$_10, void>::call() + 30 (Function.h:52) 12 com.apple.JavaScriptCore 0x000000057fc68552 WTF::Function<void ()>::operator()() const + 130 (Function.h:83) 13 com.apple.JavaScriptCore 0x000000057fd1cba8 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 424 (Threading.cpp:181) 14 com.apple.JavaScriptCore 0x000000057fd28d48 WTF::wtfThreadEntryPoint(void*) + 24 (ThreadingPOSIX.cpp:241) 15 libsystem_pthread.dylib 0x00007fff20686954 _pthread_start + 224 16 libsystem_pthread.dylib 0x00007fff206824a7 thread_start + 15
Attachments
Patch (2.20 KB, patch)
2021-03-15 17:30 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-03-15 17:30:34 PDT
EWS
Comment 2 2021-03-15 19:01:19 PDT
Committed r274459: <https://commits.webkit.org/r274459> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423270 [details].
Radar WebKit Bug Importer
Comment 3 2021-03-15 19:02:14 PDT
Note You need to log in before you can comment on or make changes to this bug.