Bug 203638 - ASSERT_WITH_MESSAGE(m_isOwnedByMainThread == isMainThread()) when web inspecting
Summary: ASSERT_WITH_MESSAGE(m_isOwnedByMainThread == isMainThread()) when web inspecting
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-30 15:54 PDT by Simon Fraser (smfr)
Modified: 2020-05-06 09:15 PDT (History)
14 users (show)

See Also:


Attachments
Test file (2.79 KB, text/html)
2019-10-30 15:54 PDT, Simon Fraser (smfr)
no flags Details
Patch (31.23 KB, patch)
2020-05-01 17:59 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2019-10-30 15:54:26 PDT
Created attachment 382378 [details]
Test file

I was web inspecting MiniBrowser WK2 with the attached tescase loaded, and was resizing the window (Resize Observer enabled in experimental features).

(lldb) bt
* thread #147, name = 'JSC Heap Collector Thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xbbadbeef)
  * frame #0: 0x0000000312ecad0e JavaScriptCore`::WTFCrash() at Assertions.cpp:305:35
    frame #1: 0x00000002fa7f1a3a WebCore`WTF::RefCountedBase::applyRefDerefThreadingCheck(this=0x000000031abf7270) const at RefCounted.h:114:13
    frame #2: 0x00000002fa803ba9 WebCore`WTF::RefCountedBase::ref(this=0x000000031abf7270) const at RefCounted.h:43:9
    frame #3: 0x00000002fd60d107 WebCore`WTF::Ref<WTF::Stopwatch, WTF::DumbPtrTraits<WTF::Stopwatch> >::Ref(this=0x000070000b310c98, object=0x000000031abf7270) at Ref.h:66:16
    frame #4: 0x00000002fd60d0cd WebCore`WTF::Ref<WTF::Stopwatch, WTF::DumbPtrTraits<WTF::Stopwatch> >::Ref(this=0x000070000b310c98, object=0x000000031abf7270) at Ref.h:65:5
    frame #5: 0x00000002fd5f6eef WebCore`WTF::Ref<WTF::Stopwatch, WTF::DumbPtrTraits<WTF::Stopwatch> >::copyRef(this=0x000000031abd04b0) const & at Ref.h:128:55
    frame #6: 0x00000002fd5f6ec0 WebCore`WebCore::InspectorController::executionStopwatch(this=0x000000031abd0480) at InspectorController.cpp:488:33
    frame #7: 0x0000000314037f68 JavaScriptCore`Inspector::InspectorHeapAgent::willGarbageCollect(this=0x000000031cef8340) at InspectorHeapAgent.cpp:277:35
    frame #8: 0x0000000313ec1c7b JavaScriptCore`JSC::Heap::willStartCollection(this=0x000000031b200048) at Heap.cpp:2211:19
    frame #9: 0x0000000313ec076e JavaScriptCore`JSC::Heap::runBeginPhase(this=0x000000031b200048, conn=Collector) at Heap.cpp:1280:5
    frame #10: 0x0000000313ebfb43 JavaScriptCore`JSC::Heap::runCurrentPhase(this=0x000000031b200048, conn=Collector, currentThreadState=0x0000000000000000) at Heap.cpp:1219:18
    frame #11: 0x0000000313ebf9c6 JavaScriptCore`JSC::Heap::collectInCollectorThread(this=0x000000031b200048) at Heap.cpp:1162:40
    frame #12: 0x0000000313eca5e9 JavaScriptCore`JSC::Heap::HeapThread::work(this=0x000000031abfa620) at Heap.cpp:268:16
    frame #13: 0x0000000312ee1e79 JavaScriptCore`WTF::AutomaticThread::start(this=0x000000031ab59a70)::$_0::operator()() const at AutomaticThread.cpp:223:37
    frame #14: 0x0000000312ee1a69 JavaScriptCore`WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call(this=0x000000031ab59a68) at Function.h:52:39
    frame #15: 0x0000000312ef49ea JavaScriptCore`WTF::Function<void ()>::operator(this=0x000070000b310f80)() const at Function.h:79:35
    frame #16: 0x0000000312f914a0 JavaScriptCore`WTF::Thread::entryPoint(newThreadContext=0x00000003209049c0) at Threading.cpp:148:5
    frame #17: 0x0000000312f9bb05 JavaScriptCore`WTF::wtfThreadEntryPoint(context=0x00000003209049c0) at ThreadingPOSIX.cpp:200:5
    frame #18: 0x00000002f9a608da libsystem_pthread.dylib`_pthread_start + 125
    frame #19: 0x00000002f9a5cf03 libsystem_pthread.dylib`thread_start + 15
(lldb)
Comment 1 Radar WebKit Bug Importer 2019-10-30 15:55:10 PDT
<rdar://problem/56761893>
Comment 2 Simon Fraser (smfr) 2019-10-30 15:55:24 PDT
Looks like inspector uses Stopwatch which is not ThreadSafeRefCounted<>
Comment 3 Devin Rousso 2020-05-01 17:59:23 PDT
Created attachment 398266 [details]
Patch
Comment 4 BJ Burg 2020-05-06 09:01:32 PDT
Comment on attachment 398266 [details]
Patch

r=me
Comment 5 EWS 2020-05-06 09:15:20 PDT
Committed r261233: <https://trac.webkit.org/changeset/261233>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398266 [details].