Avoid heap allocations under AudioSampleDataSource::pullSamplesInternal(): Thread 12 Crashed:: WebCore: AudioWorklet 0 com.apple.JavaScriptCore 0x000000059fd88aee 0x59fd86000 + 10990 1 com.apple.JavaScriptCore 0x00000005a152629b 0x59fd86000 + 24773275 2 com.apple.JavaScriptCore 0x000000059fdc637b 0x59fd86000 + 263035 3 com.apple.WebCore 0x00000005808ffc65 WTF::Detail::CallableWrapperBase<void>::operator new(unsigned long) + 21 (Function.h:37) 4 com.apple.WebCore 0x0000000582265d18 std::__1::__unique_if<WTF::Detail::CallableWrapper<WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3, void> >::__unique_single std::__1::make_unique<WTF::Detail::CallableWrapper<WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3, void>, WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3>(WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3&&) + 40 (memory:2755) 5 com.apple.WebCore 0x0000000582265c86 decltype(auto) WTF::makeUnique<WTF::Detail::CallableWrapper<WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3, void>, WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3>(WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3&&) + 54 (StdLibExtras.h:507) 6 com.apple.WebCore 0x0000000582265c30 WTF::Function<void ()>::Function<WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3, void>(WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3&&) + 48 (Function.h:74) 7 com.apple.WebCore 0x000000058224e48d WTF::Function<void ()>::Function<WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3, void>(WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode)::$_3&&) + 29 (Function.h:74) 8 com.apple.WebCore 0x000000058224ddc8 WebCore::AudioSampleDataSource::pullSamplesInternal(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode) + 824 (AudioSampleDataSource.mm:242) 9 com.apple.WebCore 0x000000058224e8aa WebCore::AudioSampleDataSource::pullSamples(AudioBufferList&, unsigned long, unsigned long long, double, WebCore::AudioSampleDataSource::PullMode) + 170 (AudioSampleDataSource.mm:343) 10 com.apple.WebCore 0x000000058295c717 WebCore::WebAudioSourceProviderCocoa::provideInput(WebCore::AudioBus*, unsigned long) + 919 (WebAudioSourceProviderCocoa.mm:97) 11 com.apple.WebCore 0x0000000582c8c0a6 WebCore::MediaElementAudioSourceNode::provideInput(WebCore::AudioBus*, unsigned long) + 166 (MediaElementAudioSourceNode.cpp:125) 12 com.apple.WebCore 0x0000000582c8c52e WebCore::MediaElementAudioSourceNode::process(unsigned long) + 606 (MediaElementAudioSourceNode.cpp:178) 13 com.apple.WebCore 0x0000000582bdc9ae WebCore::AudioNode::processIfNecessary(unsigned long) + 462 (AudioNode.cpp:474)
Created attachment 423610 [details] Patch
Committed r274657: <https://commits.webkit.org/r274657> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423610 [details].
<rdar://problem/75583342>
Hum, this logging was useful in the past to debug crackling and was recently useful again. I think we should try to resurrect it in some ways.