Bug 230644

Summary: REGRESSION (r282865?): ASSERTION FAILED: Unsafe to ref/deref from different threads m_isOwnedByMainThread == isMainThread()
Product: WebKit Reporter: ayumi_kojima
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, jean-yves.avenard, jer.noble, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Intel)   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230662
Attachments:
Description Flags
Crash log none

Description ayumi_kojima 2021-09-22 15:04:37 PDT
imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-negative.html

Is a flaky crash on macOS wk1 Debug.

History: https://results.webkit.org/?suite=layout-tests&test=imported%2Fw3c%2Fweb-platform-tests%2Fmedia-source%2Fmediasource-changetype-play-negative.html

Stderr:

2021-09-22 12:21:01.415 DumpRenderTree[58389:29549883] *** WARNING: Method convertPointToBase: in class NSView is deprecated on 10.7 and later. It should not be used in new applications. 
ASSERTION FAILED: Unsafe to ref/deref from different threads
m_isOwnedByMainThread == isMainThread()
/Volumes/Data/worker/bigsur-debug/build/WebKitBuild/Debug/usr/local/include/wtf/RefCounted.h(114) : void WTF::RefCountedBase::applyRefDerefThreadingCheck() const
1   0x107107539 WTFCrash
2   0x12849df91 WTF::RefCountedBase::applyRefDerefThreadingCheck() const
3   0x12849dd6c WTF::RefCountedBase::derefBase() const
4   0x12850920f WTF::RefCounted<WebCore::SharedBuffer, std::__1::default_delete<WebCore::SharedBuffer> >::deref() const
5   0x1285091dc WTF::Ref<WebCore::SharedBuffer, WTF::RawPtrTraits<WebCore::SharedBuffer> >::~Ref()
6   0x1284fe755 WTF::Ref<WebCore::SharedBuffer, WTF::RawPtrTraits<WebCore::SharedBuffer> >::~Ref()
7   0x1289ba0ea WebCore::SourceBufferParserAVFObjC::appendData(WebCore::SourceBufferParser::Segment&&, WTF::CompletionHandler<void ()>&&, WebCore::SourceBufferParser::AppendFlags)
8   0x1289cbf7c WebCore::SourceBufferPrivateAVFObjC::append(WTF::Ref<WebCore::SharedBuffer, WTF::RawPtrTraits<WebCore::SharedBuffer> >&&)::$_13::operator()()
9   0x1289cbeac invocation function for block in WebCore::SourceBufferPrivateAVFObjC::append(WTF::Ref<WebCore::SharedBuffer, WTF::RawPtrTraits<WebCore::SharedBuffer> >&&)
10  0x7fff2020d623 _dispatch_call_block_and_release
11  0x7fff2020e806 _dispatch_client_callout
12  0x7fff202111b0 _dispatch_continuation_pop
13  0x7fff20210887 _dispatch_async_redirect_invoke
14  0x7fff2021d818 _dispatch_root_queue_drain
15  0x7fff2021df70 _dispatch_worker_thread2
16  0x7fff203b5417 _pthread_wqthread
17  0x7fff203b442f start_wqthread
Comment 1 Radar WebKit Bug Importer 2021-09-22 15:07:52 PDT
<rdar://problem/83419269>
Comment 2 ayumi_kojima 2021-09-22 15:10:17 PDT
From the history and the crash log, I think the test started being flaky at https://trac.webkit.org/changeset/282865/webkit
Comment 3 ayumi_kojima 2021-09-22 15:12:00 PDT
Created attachment 438981 [details]
Crash log
Comment 4 ayumi_kojima 2021-09-22 15:52:29 PDT
imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit.html
media/media-source/media-source-abort-resets-parser.html
media/media-source/media-source-resize.html
media/media-source/media-source-trackid-change.html
media/media-source/only-bcp47-language-tags-accepted-as-valid.html

also show the same assertion failure: https://build.webkit.org/results/Apple-BigSur-Debug-WK1-Tests/r282881%20(4297)/results.html#
Comment 5 ayumi_kojima 2021-09-22 15:53:38 PDT
ASSERTION FAILED: Unsafe to ref/deref from different threads
m_isOwnedByMainThread == isMainThread()
/Volumes/Data/worker/bigsur-debug/build/WebKitBuild/Debug/usr/local/include/wtf/RefCounted.h(114) : void WTF::RefCountedBase::applyRefDerefThreadingCheck() const
Comment 6 ayumi_kojima 2021-09-22 17:17:01 PDT
Marked test expectations: https://trac.webkit.org/changeset/282895/webkit
Comment 7 Alexey Proskuryakov 2021-09-25 13:26:09 PDT
This assertion is claimed to have been fixed via bug 230662, but TestExpectations haven't been updated.

Jean-Yves, can you please correct that?
Comment 8 Jean-Yves Avenard [:jya] 2021-09-25 22:01:01 PDT
(In reply to Alexey Proskuryakov from comment #7)
> This assertion is claimed to have been fixed via bug 230662, but
> TestExpectations haven't been updated.
> 
> Jean-Yves, can you please correct that?

Bug 230662 reverted this change.

*** This bug has been marked as a duplicate of bug 230662 ***
Comment 9 Alexey Proskuryakov 2021-09-26 11:57:45 PDT
Indeed, I missed that in the patch somehow.