RESOLVED FIXED 199652
Stop using GenericTaskQueue from multiple threads
https://bugs.webkit.org/show_bug.cgi?id=199652
Summary Stop using GenericTaskQueue from multiple threads
Chris Dumez
Reported 2019-07-09 19:42:12 PDT
Stop using GenericTaskQueue from multiple threads as its implementation is not thread-safe.
Attachments
Patch (6.68 KB, patch)
2019-07-09 19:49 PDT, Chris Dumez
no flags
Patch (20.45 KB, patch)
2019-07-10 13:32 PDT, Chris Dumez
no flags
Patch (20.30 KB, patch)
2019-07-10 15:07 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2019-07-09 19:45:58 PDT
Thread 7 Crashed:: Dispatch queue: WebCoreAVFLoaderDelegate queue 0 com.apple.JavaScriptCore 0x0000000411b68cfe WTFCrash + 14 (Assertions.cpp:305) 1 com.apple.WebCore 0x00000003f9f2c92b WTFCrashWithInfo(int, char const*, char const*, int) + 27 2 com.apple.WebCore 0x00000003fa2033ae WTF::WeakPtrFactory<WebCore::GenericTaskQueue<WebCore::Timer, std::__1::atomic<unsigned int> > >::createWeakPtr(WebCore::GenericTaskQueue<WebCore::Timer, std::__1::atomic<unsigned int> >&) const + 142 (WeakPtr.h:132) 3 com.apple.WebCore 0x00000003fa203293 WTF::WeakPtr<WebCore::GenericTaskQueue<WebCore::Timer, std::__1::atomic<unsigned int> > > WTF::makeWeakPtr<WebCore::GenericTaskQueue<WebCore::Timer, std::__1::atomic<unsigned int> > >(WebCore::GenericTaskQueue<WebCore::Timer, std::__1::atomic<unsigned int> >&) + 51 (WeakPtr.h:207) 4 com.apple.WebCore 0x00000003fa1de75a WebCore::GenericTaskQueue<WebCore::Timer, std::__1::atomic<unsigned int> >::enqueueTask(WTF::Function<void ()>&&) + 90 (GenericTaskQueue.h:101) 5 com.apple.WebCore 0x00000003fa1df030 -[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:] + 144 (MediaPlayerPrivateAVFoundationObjC.mm:3449) 6 com.apple.CoreFoundation 0x00007fff301dea0c __invoking___ + 140 7 com.apple.CoreFoundation 0x00007fff301de8c4 -[NSInvocation invoke] + 273 8 com.apple.avfoundation 0x00007fff2bd7dff7 __104-[AVAssetResourceLoader _performDelegateSelector:withObject:representingNewRequest:key:fallbackHandler:]_block_invoke + 403 9 com.apple.avfoundation 0x00007fff2bd7dc77 -[AVAssetResourceLoader _performDelegateCallbackSynchronouslyIfCurrentDelegateQueueIsQueue:delegateCallbackBlock:] + 301 10 libdispatch.dylib 0x00007fff67802683 _dispatch_call_block_and_release + 12 11 libdispatch.dylib 0x00007fff6780360e _dispatch_client_callout + 8 12 libdispatch.dylib 0x00007fff67808bd2 _dispatch_lane_serial_drain + 597 13 libdispatch.dylib 0x00007fff67809556 _dispatch_lane_invoke + 363 14 libdispatch.dylib 0x00007fff67812bc5 _dispatch_workloop_worker_thread + 582 15 libsystem_pthread.dylib 0x00007fff67a5c860 _pthread_wqthread + 336 16 libsystem_pthread.dylib 0x00007fff67a5c69b start_wqthread + 15
Chris Dumez
Comment 2 2019-07-09 19:49:33 PDT
Geoffrey Garen
Comment 3 2019-07-09 20:50:04 PDT
Comment on attachment 373812 [details] Patch r=me
WebKit Commit Bot
Comment 4 2019-07-09 21:19:54 PDT
Comment on attachment 373812 [details] Patch Clearing flags on attachment: 373812 Committed r247292: <https://trac.webkit.org/changeset/247292>
WebKit Commit Bot
Comment 5 2019-07-09 21:19:56 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2019-07-09 21:24:15 PDT
Ryan Haddad
Comment 7 2019-07-10 11:01:13 PDT
This change caused TestWebKitAPI.CloseWebViewDuringEnterFullscreen.VideoFullscreen to time out on Mojave bots: https://build.webkit.org/builders/Apple%20Mojave%20Release%20WK2%20(Tests)/builds/5227 The test is still passing on High Sierra, so EWS didn't catch it.
Chris Dumez
Comment 8 2019-07-10 11:30:24 PDT
(In reply to Ryan Haddad from comment #7) > This change caused > TestWebKitAPI.CloseWebViewDuringEnterFullscreen.VideoFullscreen to time out > on Mojave bots: > https://build.webkit.org/builders/Apple%20Mojave%20Release%20WK2%20(Tests)/ > builds/5227 > > The test is still passing on High Sierra, so EWS didn't catch it. Ok, looking now.
Chris Dumez
Comment 9 2019-07-10 11:42:01 PDT
(In reply to Chris Dumez from comment #8) > (In reply to Ryan Haddad from comment #7) > > This change caused > > TestWebKitAPI.CloseWebViewDuringEnterFullscreen.VideoFullscreen to time out > > on Mojave bots: > > https://build.webkit.org/builders/Apple%20Mojave%20Release%20WK2%20(Tests)/ > > builds/5227 > > > > The test is still passing on High Sierra, so EWS didn't catch it. > > Ok, looking now. Does not reproduce for me locally on Catalina, odd.
Chris Dumez
Comment 10 2019-07-10 13:13:33 PDT
Reverted r247292 for reason: Caused CloseWebViewDuringEnterFullscreen.VideoFullscreen API test to time out on Mojave bots Committed r247323: <https://trac.webkit.org/changeset/247323>
Chris Dumez
Comment 11 2019-07-10 13:32:24 PDT
EWS Watchlist
Comment 12 2019-07-10 13:36:30 PDT
Attachment 373862 [details] did not pass style-queue: ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3391: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3392: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3394: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3395: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3396: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3398: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3399: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3401: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3402: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3415: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] Total errors found: 10 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Eric Carlson
Comment 13 2019-07-10 14:43:00 PDT
Comment on attachment 373862 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373862&action=review r=me with a couple of minor nits > Source/WebCore/ChangeLog:16 > + Stop last template parameter which was used exclusively by WebCoreAVFLoaderDelegate to try and Nit: s/Stop/Remove/ > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3391 > + #if ENABLE(WIRELESS_PLAYBACK_TARGET) Nit: indentation > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3395 > + #if ENABLE(LEGACY_ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA) Ditto. > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3401 > + #if !RELEASE_LOG_DISABLED Ditto.
Chris Dumez
Comment 14 2019-07-10 15:07:35 PDT
Chris Dumez
Comment 15 2019-07-10 15:08:09 PDT
(In reply to Eric Carlson from comment #13) > Comment on attachment 373862 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373862&action=review > > r=me with a couple of minor nits > > > Source/WebCore/ChangeLog:16 > > + Stop last template parameter which was used exclusively by WebCoreAVFLoaderDelegate to try and > > Nit: s/Stop/Remove/ > > > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3391 > > + #if ENABLE(WIRELESS_PLAYBACK_TARGET) > > Nit: indentation > > > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3395 > > + #if ENABLE(LEGACY_ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA) > > Ditto. > > > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3401 > > + #if !RELEASE_LOG_DISABLED > > Ditto. Thanks Eric.
WebKit Commit Bot
Comment 16 2019-07-10 16:08:35 PDT
Comment on attachment 373868 [details] Patch Clearing flags on attachment: 373868 Committed r247331: <https://trac.webkit.org/changeset/247331>
WebKit Commit Bot
Comment 17 2019-07-10 16:08:37 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.