<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>313643</bug_id>
          
          <creation_ts>2026-04-29 05:43:45 -0700</creation_ts>
          <short_desc>REGRESSION(309800@main): inspector/canvas/create-context-2d.html crashes due to WeakRef assertion in WebCore::InspectorCanvasAgent::internalEnable()</short_desc>
          <delta_ts>2026-04-30 07:16:14 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Canvas</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Claudio Saavedra">csaavedra</reporter>
          <assigned_to name="Claudio Saavedra">csaavedra</assigned_to>
          <cc>cdumez</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2205738</commentid>
    <comment_count>0</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2026-04-29 05:43:45 -0700</bug_when>
    <thetext>309800@main introduced threading assertions in WeakRef::get(), which is implicitly used in CanvasRenderingContext::canvasBase(), as it returns a CanvasBase&amp; from a WeakRef&lt;CanvasBase&gt;. This is called from the wrong thread, causing the threading assertion to fail:

Thread 1 (Thread 0x7f8a89bff6c0 (LWP 379416)):
#0  WTFCrash () at ../../../Source/WTF/wtf/Assertions.cpp:380
#1  0x00007f8d4ac3430d in WTFCrashWithSecurityImplication () at ../../../Source/WTF/wtf/Assertions.cpp:409
#2  0x00007f8d5e993026 in WTF::WeakRef&lt;WebCore::CanvasBase, WTF::DefaultWeakPtrImpl&gt;::get (this=0x7f8d32281c50) at WTF/Headers/wtf/WeakRef.h:114
#3  0x00007f8d5e97bd4a in WTF::WeakRef&lt;WebCore::CanvasBase, WTF::DefaultWeakPtrImpl&gt;::operator WebCore::CanvasBase&amp; (this=0x7f8d32281c50) at WTF/Headers/wtf/WeakRef.h:120
#4  0x00007f8d5e955974 in WebCore::CanvasRenderingContext::canvasBase (this=0x7f8d32281c20) at ../../../Source/WebCore/html/canvas/CanvasRenderingContext.h:66
#5  0x00007f8d63995741 in WebCore::InspectorCanvasAgent::internalEnable (this=0x7f8d32644440) at ../../../Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp:165
#6  0x00007f8d6399543a in WebCore::InspectorCanvasAgent::enable (this=0x7f8d32644440) at ../../../Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp:127
#7  0x00007f8d496fa080 in Inspector::CanvasBackendDispatcher::enable (this=0x7f8d3256c510, protocol_requestId=112) at JavaScriptCore/DerivedSources/inspector/InspectorBackendDispatchers.cpp:1175
#8  0x00007f8d496f9fbc in Inspector::CanvasBackendDispatcher::dispatch (this=0x7f8d3256c510, protocol_requestId=112, protocol_method=..., protocol_message=...) at JavaScriptCore/DerivedSources/inspector/InspectorBackendDispatchers.cpp:1163
#9  0x00007f8d496edf42 in Inspector::BackendDispatcher::dispatch (this=0x7f8d3246c300, message=...) at ../../../Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp:190
#10 0x00007f8d63983ee8 in WebCore::WorkerInspectorController::dispatchMessageFromFrontend (this=0x7f8d323edda0, message=...) at ../../../Source/WebCore/inspector/WorkerInspectorController.cpp:191
#11 0x00007f8d65e7903c in operator() (__closure=0x7f8d324e4ff8, context=warning: RTTI symbol not found for class &apos;WebCore::DedicatedWorkerGlobalScope&apos;
...) at ../../../Source/WebCore/workers/WorkerInspectorProxy.cpp:220
#12 0x00007f8d65eb38e2 in WTF::Detail::CallableWrapper&lt;WebCore::WorkerInspectorProxy::sendMessageToWorkerInspectorController(const WTF::String&amp;)::&lt;lambda(WebCore::ScriptExecutionContext&amp;)&gt;, void, WebCore::ScriptExecutionContext&amp;&gt;::call(WebCore::ScriptExecutionContext &amp;) (this=0x7f8d324e4ff0, in#0=warning: RTTI symbol not found for class &apos;WebCore::DedicatedWorkerGlobalScope&apos;
...) at WTF/Headers/wtf/Function.h:59
#13 0x00007f8d60ded4ac in WTF::Function&lt;void (WebCore::ScriptExecutionContext&amp;)&gt;::operator()(WebCore::ScriptExecutionContext&amp;) const (this=0x7f8d324b2dc0, in#0=warning: RTTI symbol not found for class &apos;WebCore::DedicatedWorkerGlobalScope&apos;
...) at WTF/Headers/wtf/Function.h:103
#14 0x00007f8d617eb451 in WebCore::ScriptExecutionContext::Task::performTask (this=0x7f8d324b2dc0, context=warning: RTTI symbol not found for class &apos;WebCore::DedicatedWorkerGlobalScope&apos;
...) at WebCore/PrivateHeaders/WebCore/ScriptExecutionContext.h:278
#15 0x00007f8d65ebaf2b in WebCore::WorkerDedicatedRunLoop::Task::performTask (this=0x7f8d324b2dc0, context=0x7f8a6e140000) at ../../../Source/WebCore/workers/WorkerRunLoop.cpp:411
#16 0x00007f8d65eba7c1 in WebCore::WorkerDedicatedRunLoop::runInMode (this=0x7f8d324c73c0, context=0x7f8a6e140000, predicate=...) at ../../../Source/WebCore/workers/WorkerRunLoop.cpp:327
#17 0x00007f8d65eb9d26 in WebCore::WorkerDedicatedRunLoop::run (this=0x7f8d324c73c0, context=0x7f8a6e140000) at ../../../Source/WebCore/workers/WorkerRunLoop.cpp:220
#18 0x00007f8d65eb7b8a in WebCore::WorkerOrWorkletThread::runEventLoop (this=0x7f8d3202e220) at ../../../Source/WebCore/workers/WorkerOrWorkletThread.cpp:110
#19 0x00007f8d65eb807c in WebCore::WorkerOrWorkletThread::workerOrWorkletThread (this=0x7f8d3202e220) at ../../../Source/WebCore/workers/WorkerOrWorkletThread.cpp:184
#20 0x00007f8d65ebef91 in operator() (__closure=0x7f8d32438248) at ../../../Source/WebCore/workers/WorkerThread.cpp:136
#21 0x00007f8d65eee970 in WTF::Detail::CallableWrapper&lt;WebCore::WorkerThread::createThread()::&lt;lambda()&gt;, void&gt;::call(void) (this=0x7f8d32438240) at WTF/Headers/wtf/Function.h:59
#22 0x00007f8d49011c52 in WTF::Function&lt;void ()&gt;::operator()() const (this=0x7f8a89bfe6f8) at WTF/Headers/wtf/Function.h:103
#23 0x00007f8d4ae0191c in WTF::Thread::entryPoint (newThreadContext=0x7f8d324c7420) at ../../../Source/WTF/wtf/Threading.cpp:258
#24 0x00007f8d4aeeade8 in WTF::wtfThreadEntryPoint (context=0x7f8d324c7420) at ../../../Source/WTF/wtf/posix/ThreadingPOSIX.cpp:245
#25 0x00007f8d4c88aaa4 in start_thread (arg=&lt;optimized out&gt;) at ./nptl/pthread_create.c:447
#26 0x00007f8d4c917c6c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2205739</commentid>
    <comment_count>1</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2026-04-29 05:44:41 -0700</bug_when>
    <thetext>https://results.webkit.org/?suite=layout-tests&amp;test=inspector%2Fcanvas%2Fcreate-context-2d.html&amp;style=debug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2205742</commentid>
    <comment_count>2</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2026-04-29 05:46:38 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/63890</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2206240</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-30 07:15:41 -0700</bug_when>
    <thetext>Committed 312362@main (cbb066bf78fc): &lt;https://commits.webkit.org/312362@main&gt;

Reviewed commits have been landed. Closing PR #63890 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2206241</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-04-30 07:16:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/175941841&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>