<?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>210983</bug_id>
          
          <creation_ts>2020-04-24 12:10:26 -0700</creation_ts>
          <short_desc>ASSERTION FAILED: m_wrapper under HTMLMediaElement::setIsPlayingToWirelessTarget</short_desc>
          <delta_ts>2020-04-24 19:11:34 -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>Media</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="Chris Dumez">cdumez</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>calvaris</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>glenn</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>jer.noble</cc>
    
    <cc>philipj</cc>
    
    <cc>sergio</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1645312</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-04-24 12:10:26 -0700</bug_when>
    <thetext>ASSERTION FAILED: m_wrapper under HTMLMediaElement::setIsPlayingToWirelessTarget:
ASSERTION FAILED: m_wrapper
./bindings/js/JSEventListener.h(123) : JSC::JSObject *WebCore::JSEventListener::jsFunction(WebCore::ScriptExecutionContext &amp;) const
1   0x106bf70b9 WTFCrash
2   0x11d80388b WTFCrashWithInfo(int, char const*, char const*, int)
3   0x11f9be9f8 WebCore::JSEventListener::jsFunction(WebCore::ScriptExecutionContext&amp;) const
4   0x11f9bdd1b WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&amp;, WebCore::Event&amp;)
5   0x12000b87c WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&amp;, WTF::Vector&lt;WTF::RefPtr&lt;WebCore::RegisteredEventListener, WTF::DumbPtrTraits&lt;WebCore::RegisteredEventListener&gt; &gt;, 1ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;, WebCore::EventTarget::EventInvokePhase)
6   0x120007b12 WebCore::EventTarget::fireEventListeners(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase)
7   0x1200834ba WebCore::Node::handleLocalEvents(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase)
8   0x11fff6180 WebCore::EventContext::handleLocalEvents(WebCore::Event&amp;, WebCore::EventTarget::EventInvokePhase) const
9   0x11fff6b97 WebCore::dispatchEventInDOM(WebCore::Event&amp;, WebCore::EventPath const&amp;)
10  0x11fff6795 WebCore::EventDispatcher::dispatchEvent(WebCore::Node&amp;, WebCore::Event&amp;)
11  0x12008350d WebCore::Node::dispatchEvent(WebCore::Event&amp;)
12  0x1203eeb31 WebCore::HTMLMediaElement::dispatchEvent(WebCore::Event&amp;)
13  0x120426b95 WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget(bool)::$_35::operator()() const
14  0x120426999 WTF::Detail::CallableWrapper&lt;WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget(bool)::$_35, void&gt;::call()

The issue is that we are trying to fire a JS event as a result of ActiveDOMObject getting called, which is not allowed:
1   0x12799f3a4 WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget(bool)
2   0x12799f1bb WebCore::HTMLMediaElement::clearMediaPlayer()
3   0x12799f913 WebCore::HTMLMediaElement::stop()
4   0x12769ddbd auto WebCore::ScriptExecutionContext::stopActiveDOMObjects()::$_9::operator()&lt;WebCore::ActiveDOMObject&gt;(WebCore::ActiveDOMObject&amp;) const
5   0x12769dd73 WTF::Detail::CallableWrapper&lt;WebCore::ScriptExecutionContext::stopActiveDOMObjects()::$_9, WebCore::ScriptExecutionContext::ShouldContinue, WebCore::ActiveDOMObject&amp;&gt;::call(WebCore::ActiveDOMObject&amp;)
6   0x12767c22a WTF::Function&lt;WebCore::ScriptExecutionContext::ShouldContinue (WebCore::ActiveDOMObject&amp;)&gt;::operator()(WebCore::ActiveDOMObject&amp;) const
7   0x12767c080 WebCore::ScriptExecutionContext::forEachActiveDOMObject(WTF::Function&lt;WebCore::ScriptExecutionContext::ShouldContinue (WebCore::ActiveDOMObject&amp;)&gt; const&amp;) const
8   0x12767c487 WebCore::ScriptExecutionContext::stopActiveDOMObjects()
9   0x1274a42ff WebCore::Document::stopActiveDOMObjects()
10  0x1274a40bc WebCore::Document::commonTeardown()
11  0x1274b0253 WebCore::Document::prepareForDestruction()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645314</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-04-24 12:10:36 -0700</bug_when>
    <thetext>&lt;rdar://problem/61611994&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645316</commentid>
    <comment_count>2</comment_count>
      <attachid>397481</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-04-24 12:12:32 -0700</bug_when>
    <thetext>Created attachment 397481
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645326</commentid>
    <comment_count>3</comment_count>
      <attachid>397481</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2020-04-24 12:27:13 -0700</bug_when>
    <thetext>Comment on attachment 397481
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=397481&amp;action=review

&gt; Source/WebCore/ChangeLog:14
&gt; +        No new tests, already covered by:
&gt; +        media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html

Is there any observable  behavior change here in addition to not running into the GC issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645334</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-04-24 12:32:56 -0700</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #3)
&gt; Comment on attachment 397481 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=397481&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:14
&gt; &gt; +        No new tests, already covered by:
&gt; &gt; +        media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html
&gt; 
&gt; Is there any observable  behavior change here in addition to not running
&gt; into the GC issue?

No. In release, we would fail to fire the event in this case and return early. In debug we would hit the assertion. Now we don&apos;t even try to fire the event so that we no longer hit the assertion in this case. No behavior change since we don&apos;t fire the event either way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645388</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-04-24 14:11:05 -0700</bug_when>
    <thetext>Committed r260669: &lt;https://trac.webkit.org/changeset/260669&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397481.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645515</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2020-04-24 19:11:34 -0700</bug_when>
    <thetext>&gt; No. In release, we would fail to fire the event in this case and return
&gt; early. In debug we would hit the assertion. Now we don&apos;t even try to fire
&gt; the event so that we no longer hit the assertion in this case. No behavior
&gt; change since we don&apos;t fire the event either way.

We would hit the assertion (or return in release) in the case where the wrapper was already GC collected. What about the case where it was not?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>397481</attachid>
            <date>2020-04-24 12:12:32 -0700</date>
            <delta_ts>2020-04-24 14:11:06 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-210983-20200424121231.patch</filename>
            <type>text/plain</type>
            <size>2007</size>
            <attacher name="Chris Dumez">cdumez</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjYwNjQyCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZjhiMmMyZTNmNTM2NThh
MmE0ZDFkNDY5OWVkMjg2ODM4ZjA5YjdkYi4uNTUwMjlkNWZkZGNiYjUwNzE3MGE5NTExNmMxNWJk
MTIzYTFjOTRiNCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDIxIEBACisyMDIwLTA0LTI0ICBDaHJp
cyBEdW1leiAgPGNkdW1lekBhcHBsZS5jb20+CisKKyAgICAgICAgQVNTRVJUSU9OIEZBSUxFRDog
bV93cmFwcGVyIHVuZGVyIEhUTUxNZWRpYUVsZW1lbnQ6OnNldElzUGxheWluZ1RvV2lyZWxlc3NU
YXJnZXQKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIx
MDk4MworICAgICAgICA8cmRhcjovL3Byb2JsZW0vNjE2MTE5OTQ+CisKKyAgICAgICAgUmV2aWV3
ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgVGhlIGlzc3VlIHdhcyB0aGF0IHdlIHdl
cmUgdHJ5aW5nIHRvIGZpcmUgYSBKUyBldmVudCBhcyBhIHJlc3VsdCBvZiBBY3RpdmVET01PYmpl
Y3Q6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