Fix thread safety bug in AudioSourceProviderAVFObjC::prepare(). It calls callOnMainThread() from a background and captures makeRef(*this) in the lambda, even though |this| is a AudioSourceProviderAVFObjC, which subclasses RefCounted, not ThreadSafeRefCounted.
Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000002, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Trace/BPT trap: 5 Termination Reason: Namespace SIGNAL, Code 0x5 Terminating Process: exc handler [0] Application Specific Information: CRASHING TEST: webaudio/silence-after-playback.html Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.WebCore 0x000000010737dfb3 0x10737c000 + 8115 1 com.apple.WebCore 0x000000010738e7f3 WTF::Detail::CallableWrapper<WebCore::AudioSourceProviderAVFObjC::prepare(long, AudioStreamBasicDescription const*)::$_0, void>::~CallableWrapper() + 163 2 com.apple.JavaScriptCore 0x0000000102b2aa9c WTF::dispatchFunctionsFromMainThread() + 332 (MainThread.cpp:123) 3 com.apple.Foundation 0x00007fff4ebad0b5 __NSThreadPerformPerform + 334 4 com.apple.CoreFoundation 0x00007fff4ca6b581 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 5 com.apple.CoreFoundation 0x00007fff4cb238ac __CFRunLoopDoSource0 + 108 6 com.apple.CoreFoundation 0x00007fff4ca4e530 __CFRunLoopDoSources0 + 208 7 com.apple.CoreFoundation 0x00007fff4ca4d9ad __CFRunLoopRun + 1293 8 com.apple.CoreFoundation 0x00007fff4ca4d207 CFRunLoopRunSpecific + 487 9 DumpRenderTree 0x000000010285482f runTest(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 3601 (DumpRenderTree.mm:2087) 10 DumpRenderTree 0x000000010285365a dumpRenderTree(int, char const**) + 3439 (DumpRenderTree.mm:1210) 11 DumpRenderTree 0x00000001028550dd DumpRenderTreeMain(int, char const**) + 1456 (DumpRenderTree.mm:1442) 12 libdyld.dylib 0x00007fff74a0d015 start + 1
Created attachment 375815 [details] Patch
Created attachment 375820 [details] Patch
Comment on attachment 375820 [details] Patch Clearing flags on attachment: 375820 Committed r248432: <https://trac.webkit.org/changeset/248432>
All reviewed patches have been landed. Closing bug.
<rdar://problem/54089364>