<?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>270132</bug_id>
          
          <creation_ts>2024-02-26 16:12:51 -0800</creation_ts>
          <short_desc>ASSERTION FAILED: m_wrapper in JSEventListener::ensureJSFunction for imported/w3c/web-platform-tests/html/rendering/widgets/the-select-element/option-empty-label-to-empty-string.html</short_desc>
          <delta_ts>2024-05-01 17:11:36 -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>Bindings</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>266711</dup_id>
          
          <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="Fujii Hironori">fujii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2017031</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2024-02-26 16:12:51 -0800</bug_when>
    <thetext>imported/w3c/web-platform-tests/html/rendering/widgets/the-select-element/option-empty-label-to-empty-string.html is randomly crashing.

History:

  https://results.webkit.org/?suite=layout-tests&amp;test=imported%2Fw3c%2Fweb-platform-tests%2Fhtml%2Frendering%2Fwidgets%2Fthe-select-element%2Foption-empty-label-to-empty-string.html


Buildbot: builder Apple-Ventura-Debug-WK2-Tests build 4065 : 275325@main
https://build.webkit.org/#/builders/701/builds/4065

https://build.webkit.org/results/Apple-Ventura-Debug-WK2-Tests/275325@main%20(4065)/imported/w3c/web-platform-tests/html/rendering/widgets/the-select-element/option-empty-label-to-empty-string-crash-log.txt

stderr:
ASSERTION FAILED: m_wrapper
/Volumes/Data/worker/Apple-Ventura-Debug-Build/build/Source/WebCore/bindings/js/JSEventListener.h(164) : JSC::JSObject *WebCore::JSEventListener::ensureJSFunction(WebCore::ScriptExecutionContext &amp;) const
1   0x4035ae5b9 WTFCrash
2   0x4a018aabb WTFCrashWithInfo(int, char const*, char const*, int)
3   0x4a3640625 WebCore::JSEventListener::ensureJSFunction(WebCore::ScriptExecutionContext&amp;) const
4   0x4a363f8de WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&amp;, WebCore::Event&amp;)
5   0x4a3ff2401 WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&amp;, WTF::Vector&lt;WTF::RefPtr&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)
6   0x4a3ff1d7a WebCore::EventTarget::fireEventListeners(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase)
7   0x4a3fd9cea WebCore::EventContext::handleLocalEvents(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase) const
8   0x4a3fdaee6 WebCore::dispatchEventInDOM(WebCore::Event&amp;, WebCore::EventPath const&amp;)
9   0x4a3fda664 WebCore::EventDispatcher::dispatchEvent(WebCore::Node&amp;, WebCore::Event&amp;)
10  0x4a408412d WebCore::Node::dispatchEvent(WebCore::Event&amp;)
11  0x4a44bde81 WebCore::HTMLMediaElement::layoutSizeChanged()::$_43::operator()() const
12  0x4a44bddd9 WTF::Detail::CallableWrapper&lt;WebCore::HTMLMediaElement::layoutSizeChanged()::$_43, void&gt;::call()
13  0x4a01b0b52 WTF::Function&lt;void ()&gt;::operator()() const
14  0x4a44a2a89 void WebCore::ActiveDOMObject::queueTaskKeepingObjectAlive&lt;WebCore::HTMLMediaElement&gt;(WebCore::HTMLMediaElement&amp;, WebCore::TaskSource, WTF::Function&lt;void ()&gt;&amp;&amp;)::&apos;lambda&apos;()::operator()() const
15  0x4a44a29c9 WTF::Detail::CallableWrapper&lt;void WebCore::ActiveDOMObject::queueTaskKeepingObjectAlive&lt;WebCore::HTMLMediaElement&gt;(WebCore::HTMLMediaElement&amp;, WebCore::TaskSource, WTF::Function&lt;void ()&gt;&amp;&amp;)::&apos;lambda&apos;(), void&gt;::call()
16  0x4a01b0b52 WTF::Function&lt;void ()&gt;::operator()() const
17  0x4a3fe3be9 WebCore::EventLoopFunctionDispatchTask::execute()
18  0x4a3fdeb46 WebCore::EventLoop::run(std::__1::optional&lt;WTF::ApproximateTime&gt;)
19  0x4a418dc66 WebCore::WindowEventLoop::didReachTimeToRun()
20  0x4a4191d69 decltype(*std::declval&lt;WebCore::WindowEventLoop*&amp;&gt;().*std::declval&lt;void (WebCore::WindowEventLoop::*&amp;)()&gt;()()) std::__1::__invoke[abi:v15006]&lt;void (WebCore::WindowEventLoop::*&amp;)(), WebCore::WindowEventLoop*&amp;, void&gt;(void (WebCore::WindowEventLoop::*&amp;)(), WebCore::WindowEventLoop*&amp;)
21  0x4a4191ced std::__1::__bind_return&lt;void (WebCore::WindowEventLoop::*)(), std::__1::tuple&lt;WebCore::WindowEventLoop*&gt;, std::__1::tuple&lt;&gt;, __is_valid_bind_return&lt;void (WebCore::WindowEventLoop::*)(), std::__1::tuple&lt;WebCore::WindowEventLoop*&gt;, std::__1::tuple&lt;&gt;&gt;::value&gt;::type std::__1::__apply_functor[abi:v15006]&lt;void (WebCore::WindowEventLoop::*)(), std::__1::tuple&lt;WebCore::WindowEventLoop*&gt;, 0ul, std::__1::tuple&lt;&gt;&gt;(void (WebCore::WindowEventLoop::*&amp;)(), std::__1::tuple&lt;WebCore::WindowEventLoop*&gt;&amp;, std::__1::__tuple_indices&lt;0ul&gt;, std::__1::tuple&lt;&gt;&amp;&amp;)
22  0x4a4191ca0 std::__1::__bind_return&lt;void (WebCore::WindowEventLoop::*)(), std::__1::tuple&lt;WebCore::WindowEventLoop*&gt;, std::__1::tuple&lt;&gt;, __is_valid_bind_return&lt;void (WebCore::WindowEventLoop::*)(), std::__1::tuple&lt;WebCore::WindowEventLoop*&gt;, std::__1::tuple&lt;&gt;&gt;::value&gt;::type std::__1::__bind&lt;void (WebCore::WindowEventLoop::*&amp;)(), WebCore::WindowEventLoop*&gt;::operator()[abi:v15006]&lt;&gt;()
23  0x4a4191c59 WTF::Detail::CallableWrapper&lt;std::__1::__bind&lt;void (WebCore::WindowEventLoop::*&amp;)(), WebCore::WindowEventLoop*&gt;, void&gt;::call()
24  0x4a01b0b52 WTF::Function&lt;void ()&gt;::operator()() const
25  0x4a02d9f89 WebCore::Timer::fired()
26  0x4a5115fc0 WebCore::ThreadTimers::sharedTimerFiredInternal()
27  0x4a511c941 WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0::operator()() const
28  0x4a511c8f9 WTF::Detail::CallableWrapper&lt;WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0, void&gt;::call()
29  0x4a01b0b52 WTF::Function&lt;void ()&gt;::operator()() const
30  0x4a50c1591 WebCore::MainThreadSharedTimer::fired()
31  0x4a51b82c6 WebCore::timerFired(__CFRunLoopTimer*, void*)
com.apple.WebKit.WebContent.Development terminated (pid 80989) for reason: crash
LEAK: 1 WebPageProxy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2017038</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2024-02-26 16:37:28 -0800</bug_when>
    <thetext>WebKit media bug? I&apos;m guessing the shadowRoot has been detached from the tree by the time the lambda in HTMLMediaElement::layoutSizeChanged() runs and we try to dispatch the event on that root. If the shadow root is no longer part of the tree and we&apos;re not using a GCReachableRef, then there is no guarantee its JS wrapper will still be alive.

It may suffice to early return in the lambda if the root is no longer connected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2018616</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-03-04 16:13:24 -0800</bug_when>
    <thetext>&lt;rdar://problem/124039685&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2032644</commentid>
    <comment_count>3</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2024-05-01 17:11:36 -0700</bug_when>
    <thetext>Seems like the same problem with bug#266711.

*** This bug has been marked as a duplicate of bug 266711 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>