<?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>262721</bug_id>
          
          <creation_ts>2023-10-05 12:57:29 -0700</creation_ts>
          <short_desc>Use a HashSet&lt;CheckedRef&lt;LocalFrame&gt;&gt; for Page::m_rootFrames</short_desc>
          <delta_ts>2023-10-06 14:32:56 -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>Layout and Rendering</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>
          <dependson>262778</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Dumez">cdumez</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>fujii</cc>
    
    <cc>jameshoward</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1982933</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-10-05 12:57:29 -0700</bug_when>
    <thetext>Use a HashSet&lt;WeakRef&lt;LocalFrame&gt;&gt; for Page::m_rootFrames instead of a WeakHashSet&lt;LocalFrame&gt;. This map is used in a hot code path and using a WeakHashSet is unnecessarily inefficient.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1982934</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-10-05 12:59:18 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/18713</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983127</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-05 23:52:36 -0700</bug_when>
    <thetext>Committed 268974@main (86924d729527): &lt;https://commits.webkit.org/268974@main&gt;

Reviewed commits have been landed. Closing PR #18713 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983128</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-05 23:53:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/116565539&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983151</commentid>
    <comment_count>4</comment_count>
    <who name="James Howard">jameshoward</who>
    <bug_when>2023-10-06 01:57:20 -0700</bug_when>
    <thetext>I think this change broke Debug builds, at least on my system (arm64, macOS 13.5.1, Xcode 14.3).

All tests crash here:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   JavaScriptCore                	       0x13730c204 WTFCrash + 20 (Assertions.cpp:333)
1   WebCore                       	       0x282ac42b0 WTFCrashWithInfo(int, char const*, char const*, int) + 32 (Assertions.h:778)
2   WebCore                       	       0x28480a570 WebCore::Page::removeRootFrame(WebCore::LocalFrame&amp;) + 268 (Page.cpp:4510)
3   WebCore                       	       0x2847747cc WebCore::LocalFrame::LocalFrame(WebCore::Page&amp;, WTF::UniqueRef&lt;WebCore::LocalFrameLoaderClient&gt;&amp;&amp;, WebCore::ProcessQualified&lt;WTF::ObjectIdentifierGeneric&lt;WebCore::FrameIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits&gt;&gt;, WebCore::HTMLFrameOwnerElement*, WebCore::Frame*) + 504 (LocalFrame.cpp:174)
...

If I revert the change locally, no more crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983173</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2023-10-06 04:55:34 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 262778</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983198</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-10-06 07:22:05 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/18762</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983302</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-06 12:45:44 -0700</bug_when>
    <thetext>Committed 269009@main (75d236ee7095): &lt;https://commits.webkit.org/269009@main&gt;

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

    </bug>

</bugzilla>