<?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>314269</bug_id>
          
          <creation_ts>2026-05-06 18:07:11 -0700</creation_ts>
          <short_desc>[GTK][WPE] ASSERTION FAILED: m_wrapper in OffscreenCanvas::dispatchEvent for webgl/lose-context-after-context-lost.html</short_desc>
          <delta_ts>2026-05-17 19:38:03 -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>WebKitGTK</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>DoNotImportToRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Fujii Hironori">fujii</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2208392</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-05-06 18:07:11 -0700</bug_when>
    <thetext>[GTK][WPE] ASSERTION FAILED: m_wrapper in OffscreenCanvas::dispatchEvent for webgl/lose-context-after-context-lost.html

History: https://results.webkit.org/?suite=layout-tests&amp;test=webgl%2Flose-context-after-context-lost.html&amp;platform=GTK&amp;platform=WPE

https://build.webkit.org/results/GTK-Linux-64-bit-Debug-Tests/312703@main%20(18895)/webgl/lose-context-after-context-lost-stderr.txt

ASSERTION FAILED: m_wrapper
../../../Source/WebCore/bindings/js/JSEventListener.h(171) : JSC::JSObject* WebCore::JSEventListener::ensureJSFunction(WebCore::ScriptExecutionContext&amp;) const
1   0x7f5fac39ba57 WebCore::JSEventListener::ensureJSFunction(WebCore::ScriptExecutionContext&amp;) const
2   0x7f5fac39d673 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&amp;, WebCore::Event&amp;)
3   0x7f5fad5b3cec WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&amp;, WTF::Vector&lt;WTF::Ref&lt;WebCore::RegisteredEventListener, WTF::RawPtrTraits&lt;WebCore::RegisteredEventListener&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::RegisteredEventListener&gt; &gt;, 1ul, WTF::CrashOnOverflow, 2ul, WTF::FastMalloc&gt;, WebCore::EventTarget::EventInvokePhase)
4   0x7f5fad5b369e WebCore::EventTarget::fireEventListeners(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase)
5   0x7f5fad59ceea WebCore::EventContext::handleLocalEvents(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase) const
6   0x7f5fad59d7fc dispatchEventInDOM
7   0x7f5fad5a1403 dispatchEventWithType&lt;WebCore::EventTarget&gt;
8   0x7f5fad59eaa0 WebCore::EventDispatcher::dispatchEvent(std::span&lt;WebCore::EventTarget* const, 18446744073709551615ul&gt;, WebCore::Event&amp;)
9   0x7f5fade1941d WebCore::OffscreenCanvas::dispatchEvent(WebCore::Event&amp;)
10  0x7f5fadf4a8bc operator()&lt;WebCore::CanvasBase&gt;
11  0x7f5fadf4a9ea call
12  0x7f5fadcf734c WTF::Function&lt;void (WebCore::CanvasBase&amp;)&gt;::operator()(WebCore::CanvasBase&amp;) const
13  0x7f5fade1d035 operator()&lt;WebCore::OffscreenCanvas&gt;
14  0x7f5fade1d064 operator()
15  0x7f5fade22cf2 call
16  0x7f5fa50407ee WTF::Function&lt;void ()&gt;::operator()() const
17  0x7f5fad5ab9b2 WebCore::EventLoopFunctionDispatchTask::execute()
18  0x7f5fad5aa527 WebCore::EventLoop::run(JSC::VM&amp;, std::optional&lt;WTF::ApproximateTime&gt;)
19  0x7f5fad9797b0 WebCore::WindowEventLoop::didReachTimeToRun()
20  0x7f5fad97fa92 WebCore::Timer::Timer&lt;WebCore::WindowEventLoop, WebCore::WindowEventLoop&gt;(WebCore::WindowEventLoop&amp;, void (WebCore::WindowEventLoop::*)())::{lambda()#1}::operator()() const
21  0x7f5fad993d16 WTF::Detail::CallableWrapper&lt;WebCore::Timer::Timer&lt;WebCore::WindowEventLoop, WebCore::WindowEventLoop&gt;(WebCore::WindowEventLoop&amp;, void (WebCore::WindowEventLoop::*)())::{lambda()#1}, void&gt;::call()
22  0x7f5fa50407ee WTF::Function&lt;void ()&gt;::operator()() const
23  0x7f5fa685978a WebCore::Timer::fired()
24  0x7f5faecc6039 WebCore::ThreadTimers::sharedTimerFiredInternal()
25  0x7f5faecc5831 operator()
26  0x7f5faecd859c call
27  0x7f5fa50407ee WTF::Function&lt;void ()&gt;::operator()() const
28  0x7f5faebdd48b WebCore::MainThreadSharedTimer::fired()
29  0x7f5faebdee0c WTF::RunLoop::Timer::Timer&lt;WebCore::MainThreadSharedTimer&gt;(WTF::Ref&lt;WTF::RunLoop, WTF::RawPtrTraits&lt;WTF::RunLoop&gt;, WTF::DefaultRefDerefTraits&lt;WTF::RunLoop&gt; &gt;&amp;&amp;, WTF::ASCIILiteral, WebCore::MainThreadSharedTimer*, void (WebCore::MainThreadSharedTimer::*)())::{lambda()#1}::operator()() const
30  0x7f5faebe4808 WTF::Detail::CallableWrapper&lt;WTF::RunLoop::Timer::Timer&lt;WebCore::MainThreadSharedTimer&gt;(WTF::Ref&lt;WTF::RunLoop, WTF::RawPtrTraits&lt;WTF::RunLoop&gt;, WTF::DefaultRefDerefTraits&lt;WTF::RunLoop&gt; &gt;&amp;&amp;, WTF::ASCIILiteral, WebCore::MainThreadSharedTimer*, void (WebCore::MainThreadSharedTimer::*)())::{lambda()#1}, void&gt;::call()
31  0x7f5fa50407ee WTF::Function&lt;void ()&gt;::operator()() const
WebKitWebProcess terminated (pid 4034991) for reason: crash</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2210805</commentid>
    <comment_count>1</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-05-14 00:46:42 -0700</bug_when>
    <thetext>This is reproducible on my PC.
&gt; ./Tools/Scripts/run-webkit-tests --gtk --release --no-retry --force --iter=1000 --exit-after-n-crash=1 --no-timeout -f --child=10 webgl/lose-context-after-context-lost.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2210807</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-05-14 00:48:16 -0700</bug_when>
    <thetext>I&apos;m using GTK release build with ENABLE_ASSERTS=1 of 313226@main.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2210819</commentid>
    <comment_count>3</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-05-14 01:08:05 -0700</bug_when>
    <thetext>This is the backtrace on my PC. webglcontextlost event is dispatched.

Thread 1 (Thread 0x7f14345e8f00 (LWP 323507)):
#0  0x00007f1441924319 in WTFCrash () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libjavascriptcoregtk-6.0.so.1
#1  0x00007f1447507e88 in WTFCrashWithInfo(int, char const*, char const*) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#2  0x00007f144a4f7949 in WebCore::JSEventListener::ensureJSFunction(WebCore::ScriptExecutionContext&amp;) const () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#3  0x00007f144a4f6666 in WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&amp;, WebCore::Event&amp;) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#4  0x00007f144aad2498 in WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&amp;, WTF::Vector&lt;WTF::Ref&lt;WebCore::RegisteredEventListener, WTF::RawPtrTraits&lt;WebCore::RegisteredEventListener&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::RegisteredEventListener&gt; &gt;, 1ul, WTF::CrashOnOverflow, 2ul, WTF::FastMalloc&gt;, WebCore::EventTarget::EventInvokePhase) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#5  0x00007f144aad1d13 in WebCore::EventTarget::fireEventListeners(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#6  0x00007f144aabdfc9 in WebCore::EventContext::handleLocalEvents(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase) const () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#7  0x00007f144aac0e61 in WebCore::dispatchEventInDOM(WebCore::Event&amp;, WebCore::EventPath const&amp;, WebCore::Document::EventListenerCounts const&amp;) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#8  0x00007f144aac1255 in WebCore::EventDispatcher::dispatchEvent(std::span&lt;WebCore::EventTarget* const, 18446744073709551615ul&gt;, WebCore::Event&amp;) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#9  0x00007f144b0caea1 in non-virtual thunk to WebCore::OffscreenCanvas::dispatchEvent(WebCore::Event&amp;) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#10 0x00007f144b18a499 in WTF::Detail::CallableWrapper&lt;WebCore::WebGLRenderingContextBase::scheduleTaskToDispatchContextLostEvent()::$_0, void, WebCore::CanvasBase&amp;&gt;::call(WebCore::CanvasBase&amp;) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#11 0x00007f144aac75c4 in WebCore::EventLoop::run(JSC::VM&amp;, std::optional&lt;WTF::ApproximateTime&gt;) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#12 0x00007f144acffcc5 in WebCore::WindowEventLoop::didReachTimeToRun() () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#13 0x00007f144ad05e7e in WebCore::Timer::Timer&lt;WebCore::WindowEventLoop, WebCore::WindowEventLoop&gt;(WebCore::WindowEventLoop&amp;, void (WebCore::WindowEventLoop::*)()) requires (WTF::HasRefPtrMemberFunctions&lt;WebCore::WindowEventLoop&gt;::value&amp;&amp;(!WTF::HasThreadSafeWeakPtrFunctions&lt;WebCore::WindowEventLoop&gt;::value))&amp;&amp;WTF::HasWeakPtrFunctions&lt;WebCore::WindowEventLoop&gt;::value::{lambda()#1}::operator()() const () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#14 0x00007f144b9bad32 in WebCore::ThreadTimers::sharedTimerFiredInternal() () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#15 0x00007f1441a5e842 in WTF::RunLoop::TimerBase::TimerBase(WTF::Ref&lt;WTF::RunLoop, WTF::RawPtrTraits&lt;WTF::RunLoop&gt;, WTF::DefaultRefDerefTraits&lt;WTF::RunLoop&gt; &gt;&amp;&amp;, WTF::ASCIILiteral)::$_0::__invoke(void*) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libjavascriptcoregtk-6.0.so.1
#16 0x00007f1441a5c5d9 in WTF::RunLoop::$_3::__invoke(_GSource*, int (*)(void*), void*) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libjavascriptcoregtk-6.0.so.1
#17 0x00007f1441d0ef7f in g_main_dispatch (context=context@entry=0x5618ab9f5c10) at ../../../../../jhbuild/checkout/glib/glib/gmain.c:3357
#18 0x00007f1441d116f8 in g_main_context_dispatch_unlocked (context=0x5618ab9f5c10) at ../../../../../jhbuild/checkout/glib/glib/gmain.c:4208
#19 g_main_context_dispatch (context=0x5618ab9f5c10) at ../../../../../jhbuild/checkout/glib/glib/gmain.c:4196
#20 0x00007f1441a5cd29 in WTF::RunLoop::runGLibMainLoopIteration(WTF::RunLoop::MayBlock) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libjavascriptcoregtk-6.0.so.1
#21 0x00007f1441a5d0d7 in WTF::RunLoop::run() () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libjavascriptcoregtk-6.0.so.1
#22 0x00007f14487a8273 in WebKit::WebProcessMain(int, char**) () from /sdk/webkit/WebKitBuild/GTK/Release/lib/libwebkitgtk-6.0.so.4
#23 0x00007f143be701ca in __libc_start_call_main (main=main@entry=0x5618ab699990 &lt;main&gt;, argc=argc@entry=4, argv=argv@entry=0x7ffd3fabb568) at ../sysdeps/nptl/libc_start_call_main.h:58
#24 0x00007f143be7028b in __libc_start_main_impl (main=0x5618ab699990 &lt;main&gt;, argc=4, argv=0x7ffd3fabb568, init=&lt;optimized out&gt;, fini=&lt;optimized out&gt;, rtld_fini=&lt;optimized out&gt;, stack_end=0x7ffd3fabb558) at ../csu/libc-start.c:360
#25 0x00005618ab6998c5 in _start ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2210843</commentid>
    <comment_count>4</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-05-14 02:45:38 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64921</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2211597</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-17 19:38:00 -0700</bug_when>
    <thetext>Committed 313384@main (2be1403ca6cd): &lt;https://commits.webkit.org/313384@main&gt;

Reviewed commits have been landed. Closing PR #64921 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>