<?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>290185</bug_id>
          
          <creation_ts>2025-03-21 09:10:04 -0700</creation_ts>
          <short_desc>[GTK][WPE] False positive `use-after-free` error on GCC 12 in `CSSValue::operator delete()`</short_desc>
          <delta_ts>2025-03-29 00:19:18 -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>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>
          
          
          <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="Vitaly Dyackhov">vitaly</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2105003</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Dyackhov">vitaly</who>
    <bug_when>2025-03-21 09:10:04 -0700</bug_when>
    <thetext>```
In member function ‘void WebCore::CSSValue::deref() const’,
    inlined from ‘static void WTF::DefaultRefDerefTraits&lt; &lt;template-parameter-1-1&gt; &gt;::derefIfNotNull(T*) [with T = WebCore::CSSValueList]’ at /home/vitaly/Projects/WebKit/WebKitBuild/GTK/Release/WTF/Headers/wtf/Ref.h:62:23,
    inlined from ‘WTF::RefPtr&lt;T, &lt;template-parameter-1-2&gt;, &lt;template-parameter-1-3&gt; &gt;::~RefPtr() [with T = WebCore::CSSValueList; _PtrTraits = WTF::RawPtrTraits&lt;WebCore::CSSValueList&gt;; _RefDerefTraits = WTF::DefaultRefDerefTraits&lt;WebCore::CSSValueList&gt;]’ at /home/vitaly/Projects/WebKit/WebKitBuild/GTK/Release/WTF/Headers/wtf/RefPtr.h:60:61,
    inlined from ‘static void WebCore::Style::BuilderCustom::applyValueFill(WebCore::Style::BuilderState&amp;, WebCore::CSSValue&amp;)’ at /home/vitaly/Projects/WebKit/Source/WebCore/style/StyleBuilderCustom.h:1244:5:
/home/vitaly/Projects/WebKit/Source/WebCore/css/CSSValue.h:312:29: error: pointer ‘value’ used after ‘static void WebCore::CSSValue::operator delete(WebCore::CSSValue*, std::destroying_delete_t)’ [-Werror=use-after-free]
  312 |     unsigned tempRefCount = m_refCount - refCountIncrement;
      |                             ^~~~~~~~~~
In member function ‘void WebCore::CSSValue::deref() const’,
    inlined from ‘static void WTF::DefaultRefDerefTraits&lt; &lt;template-parameter-1-1&gt; &gt;::derefIfNotNull(T*) [with T = const WebCore::CSSValue]’ at /home/vitaly/Projects/WebKit/WebKitBuild/GTK/Release/WTF/Headers/wtf/Ref.h:62:23,
    inlined from ‘WTF::RefPtr&lt;T, &lt;template-parameter-1-2&gt;, &lt;template-parameter-1-3&gt; &gt;::~RefPtr() [with T = const WebCore::CSSValue; _PtrTraits = WTF::RawPtrTraits&lt;const WebCore::CSSValue&gt;; _RefDerefTraits = WTF::DefaultRefDerefTraits&lt;const WebCore::CSSValue&gt;]’ at /home/vitaly/Projects/WebKit/WebKitBuild/GTK/Release/WTF/Headers/wtf/RefPtr.h:60:61,
    inlined from ‘WTF::RefPtr&lt;T, PtrTraits, RefDerefTraits&gt;&amp; WTF::RefPtr&lt;T, &lt;template-parameter-1-2&gt;, &lt;template-parameter-1-3&gt; &gt;::operator=(WTF::RefPtr&lt;T, &lt;template-parameter-1-2&gt;, &lt;template-parameter-1-3&gt; &gt;&amp;&amp;) [with T = const WebCore::CSSValue; _PtrTraits = WTF::RawPtrTraits&lt;const WebCore::CSSValue&gt;; _RefDerefTraits = WTF::DefaultRefDerefTraits&lt;const WebCore::CSSValue&gt;]’ at /home/vitaly/Projects/WebKit/WebKitBuild/GTK/Release/WTF/Headers/wtf/RefPtr.h:165:1,
    inlined from ‘static void WebCore::Style::BuilderCustom::applyValueFill(WebCore::Style::BuilderState&amp;, WebCore::CSSValue&amp;)’ at /home/vitaly/Projects/WebKit/Source/WebCore/style/StyleBuilderCustom.h:1243:43:
/home/vitaly/Projects/WebKit/Source/WebCore/css/CSSValue.h:316:16: note: call to ‘static void WebCore::CSSValue::operator delete(WebCore::CSSValue*, std::destroying_delete_t)’ here
  316 |         delete this;
 ```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2105004</commentid>
    <comment_count>1</comment_count>
    <who name="Vitaly Dyackhov">vitaly</who>
    <bug_when>2025-03-21 09:13:41 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/42813</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107080</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-03-29 00:18:28 -0700</bug_when>
    <thetext>Committed 292887@main (8255a10580c5): &lt;https://commits.webkit.org/292887@main&gt;

Reviewed commits have been landed. Closing PR #42813 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107081</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-03-29 00:19:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/148153125&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>