Bug 223228 - Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum()
Summary: Avoid heap allocation in RemoteAudioDestinationProxy::renderQuantum()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 223226
  Show dependency treegraph
 
Reported: 2021-03-15 17:29 PDT by Chris Dumez
Modified: 2021-03-15 19:31 PDT (History)
11 users (show)

See Also:


Attachments
Patch (2.20 KB, patch)
2021-03-15 17:30 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 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
Comment 1 Chris Dumez 2021-03-15 17:30:34 PDT
Created attachment 423270 [details]
Patch
Comment 2 EWS 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].
Comment 3 Radar WebKit Bug Importer 2021-03-15 19:02:14 PDT
<rdar://problem/75458755>