<?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>248496</bug_id>
          
          <creation_ts>2022-11-29 14:27:42 -0800</creation_ts>
          <short_desc>[ New Test ] (256342@main): [ macOS Debug ] fast/events/message-port-gc-after-removing-event-listener.html is a flaky crash</short_desc>
          <delta_ts>2022-11-30 08:00:27 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=193184</see_also>
          <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="Karl Rackler">rackler</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>cdumez</cc>
    
    <cc>webkit-bot-watchers-bugzilla</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1915417</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Rackler">rackler</who>
    <bug_when>2022-11-29 14:27:42 -0800</bug_when>
    <thetext>Description:
fast/events/message-port-gc-after-removing-event-listener.html

The test was added at 256342@main and was a flaky crash since then.  The history shows this affecting macOS Debug.

This issue can be bisected to 256342@main using the command: 
run-webkit-tests --debug --iterations 4000 --exit-after-n-failures 1 --exit-after-n-crashes-or-timeouts 1 --debug-rwt-logging --no-retry --force --no-build -f fast/events/message-port-gc-after-removing-event-listener.html 

Result: 
Unexpected flakiness: crashes (1)
  fast/events/message-port-gc-after-removing-event-listener.html [ Pass Crash ]

History:
https://results.webkit.org/?suite=layout-tests&amp;test=fast%2Fevents%2Fmessage-port-gc-after-removing-event-listener.html&amp;style=debug&amp;platform=mac

Crash Log:
No crash log found for com.apple.WebKit.WebContent.Development:79000.

stdout:

stderr:
com.apple.WebKit.WebContent.Development terminated (pid 79000) for reason: crash
LEAK: 1 WebPageProxy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915418</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-29 14:28:07 -0800</bug_when>
    <thetext>&lt;rdar://problem/102784521&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915422</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2022-11-29 14:38:52 -0800</bug_when>
    <thetext>I managed to get this crash trace from one of the bots:

Crashed Thread:        12  WebCore: Worker

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000005
Exception Codes:       0x0000000000000001, 0x0000000000000005

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [41345]

VM Region Info: 0x5 is not in any region.  Bytes before following region: 4377247739
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
---&gt;  
      __TEXT                      104e78000-104e7c000    [   16K] r-x/r-x SM=COW  ...t.Development

Thread 12 Crashed:: Dispatch queue: 
0  com.apple.WebCore       	       0x108ca1d64 JSC::JSCell::isObject() const
1  com.apple.WebCore       	       0x108cb4c08 JSC::JSValue::isObject() const
2  com.apple.WebCore       	       0x108cb4c08 JSC::JSValue::isObject() const
3  com.apple.WebCore       	       0x10b177420 WebCore::isWorldCompatible(JSC::JSGlobalObject&amp;, JSC::JSValue)
4  com.apple.WebCore       	       0x10b177338 WebCore::cloneAcrossWorlds(JSC::JSGlobalObject&amp;, WebCore::JSDOMObject const&amp;, JSC::JSValue)
5  com.apple.WebCore       	       0x10b1605f0 WebCore::cachedPropertyValue(JSC::JSGlobalObject&amp;, WebCore::JSDOMObject const&amp;, WebCore::JSValueInWrappedObject&amp;, WTF::Function&lt;JSC::JSValue ()&gt; const&amp;)
6  com.apple.WebCore       	       0x10b207e2c WebCore::JSMessageEvent::ports(JSC::JSGlobalObject&amp;) const
7  com.apple.WebCore       	       0x10948e9b8 WebCore::jsMessageEvent_portsGetter(JSC::JSGlobalObject&amp;, WebCore::JSMessageEvent&amp;)
8  com.apple.WebCore       	       0x1093cbf0c long long WebCore::IDLAttribute&lt;WebCore::JSMessageEvent&gt;::get&lt;&amp;(WebCore::jsMessageEvent_portsGetter(JSC::JSGlobalObject&amp;, WebCore::JSMessageEvent&amp;)), (WebCore::CastedThisErrorBehavior)3&gt;(JSC::JSGlobalObject&amp;, long long, JSC::PropertyName)
9  com.apple.WebCore       	       0x1093cbde8 WebCore::jsMessageEvent_ports(JSC::JSGlobalObject*, long long, JSC::PropertyName)
10  com.apple.JavaScriptCore	       0x147530c9c WTF::FunctionPtr&lt;(WTF::PtrTag)57072, long long (JSC::JSGlobalObject*, long long, JSC::PropertyName), (WTF::FunctionAttributes)1&gt;::operator()(JSC::JSGlobalObject*, long long, JSC::PropertyName) const
11  com.apple.JavaScriptCore	       0x147794a0c JSC::PropertySlot::customGetter(JSC::VM&amp;, JSC::PropertyName) const
12  com.apple.JavaScriptCore	       0x145f6716c JSC::PropertySlot::getValue(JSC::JSGlobalObject*, JSC::PropertyName) const
13  com.apple.JavaScriptCore	       0x14602c6e0 JSC::JSValue::get(JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&amp;) const
14  com.apple.JavaScriptCore	       0x147115f40 JSC::LLInt::performLLIntGetByID(JSC::BytecodeIndex, JSC::CodeBlock*, JSC::JSGlobalObject*, JSC::JSValue, JSC::Identifier const&amp;, JSC::GetByIdModeMetadata&amp;)
15  com.apple.JavaScriptCore	       0x147115ca8 llint_slow_path_get_by_id</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915428</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2022-11-29 14:56:29 -0800</bug_when>
    <thetext>I don&apos;t think this is a regression from my change. I believe the new test exposed a pre-existing issue. In particular, I believe that the worker is being terminated while MessageEvent.ports is getting called and we don&apos;t properly deal with this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915437</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-11-29 15:27:09 -0800</bug_when>
    <thetext>Is there a way to adjust the test so that it doesn&apos;t run into this? We do need a working test for the original fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915438</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2022-11-29 15:27:38 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #4)
&gt; Is there a way to adjust the test so that it doesn&apos;t run into this? We do
&gt; need a working test for the original fix.

I will upload a fix shortly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915441</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2022-11-29 15:33:43 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6947</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915610</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-30 08:00:24 -0800</bug_when>
    <thetext>Committed 257180@main (c9f7f8272c10): &lt;https://commits.webkit.org/257180@main&gt;

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

    </bug>

</bugzilla>