<?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>263671</bug_id>
          
          <creation_ts>2023-10-25 10:31:53 -0700</creation_ts>
          <short_desc>Regression(268375@main) Crash under ~Node() due to CheckedRef</short_desc>
          <delta_ts>2024-10-01 17:50: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>DOM</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=280723</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>
          
          <blocked>261983</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Dumez">cdumez</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>heycam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1987464</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-10-25 10:31:53 -0700</bug_when>
    <thetext>Crash under ~Node() due to CheckedRef:
```
ASSERTION FAILED: !m_count
/Volumes/Work/WebKit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/CheckedRef.h(250) : WTF::CanMakeCheckedPtrBase&lt;WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;, unsigned int&gt;::~CanMakeCheckedPtrBase() [StorageType = WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;, PtrCounterType = unsigned int]
1   0x138bbdb3c WTFCrash
2   0x282d68d1c WebCore::BaseAudioContext::markSummingJunctionDirty(WebCore::AudioSummingJunction*)
3   0x28326135c WTF::CanMakeCheckedPtrBase&lt;WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;, unsigned int&gt;::~CanMakeCheckedPtrBase()
4   0x283d3426c WebCore::EventTarget::~EventTarget()
5   0x283daf064 WebCore::Node::~Node()
6   0x283b5bbf4 WebCore::ContainerNode::~ContainerNode()
7   0x283cbcb3c WebCore::Element::~Element()
8   0x283e00150 WebCore::PseudoElement::~PseudoElement()
9   0x283e00180 WebCore::PseudoElement::~PseudoElement()
10  0x283e001b0 WebCore::PseudoElement::~PseudoElement()
11  0x283dbaf04 WebCore::Node::removedLastRef()
12  0x2832ca440 WebCore::Node::deref() const
13  0x283d0511c WTF::DefaultRefDerefTraits&lt;WebCore::PseudoElement&gt;::derefIfNotNull(WebCore::PseudoElement*)
14  0x283d050dc WTF::RefPtr&lt;WebCore::PseudoElement, WTF::RawPtrTraits&lt;WebCore::PseudoElement&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::PseudoElement&gt;&gt;::~RefPtr()
15  0x283cd85e0 WTF::RefPtr&lt;WebCore::PseudoElement, WTF::RawPtrTraits&lt;WebCore::PseudoElement&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::PseudoElement&gt;&gt;::~RefPtr()
16  0x283cf6020 WTF::RefPtr&lt;WebCore::PseudoElement, WTF::RawPtrTraits&lt;WebCore::PseudoElement&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::PseudoElement&gt;&gt;::operator=(WTF::RefPtr&lt;WebCore::PseudoElement, WTF::RawPtrTraits&lt;WebCore::PseudoElement&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::PseudoElement&gt;&gt;&amp;&amp;)
17  0x283cd8ecc WebCore::ElementRareData::setBeforePseudoElement(WTF::RefPtr&lt;WebCore::PseudoElement, WTF::RawPtrTraits&lt;WebCore::PseudoElement&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::PseudoElement&gt;&gt;&amp;&amp;)
18  0x283cd90fc WebCore::Element::clearBeforePseudoElementSlow()
19  0x283cd0024 WebCore::Element::clearBeforePseudoElement()
20  0x285bd1424 WebCore::RenderTreeUpdater::GeneratedContent::removeBeforePseudoElement(WebCore::Element&amp;, WebCore::RenderTreeBuilder&amp;)
21  0x285bd06d0 WebCore::RenderTreeUpdater::tearDownRenderers(WebCore::Element&amp;, WebCore::RenderTreeUpdater::TeardownType, WebCore::RenderTreeBuilder&amp;)::$_5::operator()(unsigned int) const
22  0x285bcf090 WebCore::RenderTreeUpdater::tearDownRenderers(WebCore::Element&amp;, WebCore::RenderTreeUpdater::TeardownType, WebCore::RenderTreeBuilder&amp;)
23  0x285bcde5c WebCore::RenderTreeUpdater::updateElementRenderer(WebCore::Element&amp;, WebCore::Style::ElementUpdate const&amp;)
24  0x285bcd3fc WebCore::RenderTreeUpdater::updateRenderTree(WebCore::ContainerNode&amp;)
25  0x285bccc28 WebCore::RenderTreeUpdater::commit(std::__1::unique_ptr&lt;WebCore::Style::Update const, std::__1::default_delete&lt;WebCore::Style::Update const&gt;&gt;)
26  0x283bd6650 WebCore::Document::updateRenderTree(std::__1::unique_ptr&lt;WebCore::Style::Update const, std::__1::default_delete&lt;WebCore::Style::Update const&gt;&gt;)
27  0x283bd6cf8 WebCore::Document::resolveStyle(WebCore::Document::ResolveStyleType)
28  0x283bd7a8c WebCore::Document::updateStyleIfNeeded()
29  0x284c03f80 WebCore::LocalFrameViewLayoutContext::layout()
30  0x284c18608 WebCore::LocalFrameView::updateContentsSize()
31  0x284ee692c WebCore::ScrollView::updateScrollbars(WebCore::IntPoint const&amp;)
```

Test case:
```
&lt;style&gt;
    html {
        content: &quot;a&quot; url();
    }

    html::before {
        container-type: size;
        content: url();
        float: left;
    }
&lt;/style&gt;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987465</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-25 10:33:25 -0700</bug_when>
    <thetext>&lt;rdar://problem/117483509&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987635</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-10-25 18:47:48 -0700</bug_when>
    <thetext>Remaining CheckedRef:
```
1   0x2a5d3adc4 WTF::CanMakeCheckedPtrBase&lt;WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;, unsigned int&gt;::SharedStackTrace::create()
2   0x2a5d3acc8 WTF::CanMakeCheckedPtrBase&lt;WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;, unsigned int&gt;::registerCheckedPtr(void const*) const
3   0x2a89a1f20 WTF::CheckedRef&lt;WebCore::Element, WTF::RawPtrTraits&lt;WebCore::Element&gt;&gt;::CheckedRef(WebCore::Element&amp;)
4   0x2a8999760 WTF::CheckedRef&lt;WebCore::Element, WTF::RawPtrTraits&lt;WebCore::Element&gt;&gt;::CheckedRef(WebCore::Element&amp;)
5   0x2aab07310 WebCore::Style::Scope::updateQueryContainerState(WebCore::Style::Scope::QueryContainerUpdateContext&amp;)
6   0x2a9a76300 WebCore::LocalFrameViewLayoutContext::layout()
7   0x2a9a8a9a8 WebCore::LocalFrameView::updateContentsSize()
8   0x2a9d5a2ac WebCore::ScrollView::updateScrollbars(WebCore::IntPoint const&amp;)
9   0x2a9d5bfb8 WebCore::ScrollView::setContentsSize(WebCore::IntSize const&amp;)
10  0x2a9a79a40 WebCore::LocalFrameView::setContentsSize(WebCore::IntSize const&amp;)
11  0x2a9a73544 WebCore::LocalFrameView::adjustViewSize()
12  0x2a9a9a470 WebCore::LocalFrameViewLayoutContext::performLayout()
13  0x2a9a7629c WebCore::LocalFrameViewLayoutContext::layout()
14  0x2a8a4f648 WebCore::Document::implicitClose()
15  0x2a9803b78 WebCore::FrameLoader::checkCallImplicitClose()
16  0x2a980359c WebCore::FrameLoader::checkCompleted()

```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987658</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-10-25 21:31:27 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/19582</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987862</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-26 16:25:08 -0700</bug_when>
    <thetext>Committed 269829@main (f747a6b78181): &lt;https://commits.webkit.org/269829@main&gt;

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

    </bug>

</bugzilla>