<?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>239339</bug_id>
          
          <creation_ts>2022-04-14 08:57:42 -0700</creation_ts>
          <short_desc>-Wdangling-pointer warning when building ANGLE with GCC 12</short_desc>
          <delta_ts>2022-05-16 15:36:19 -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>ANGLE</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>dino</cc>
    
    <cc>kbr</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1861517</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-14 08:57:42 -0700</bug_when>
    <thetext>This is probably a false-positive. I&apos;m a little tempted to build ANGLE with -w since it is third-party code and doesn&apos;t make a ton of sense for us to be responsible for their build warnings, but for now we just have a steadily-increasing list of warnings to suppress when building ANGLE.

[1645/6690] Building CXX object Source/ThirdParty/ANGLE/CM....dir/src/compiler/translator/tree_util/IntermRebuild.cpp.o
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp: In member function ‘sh::PostResult sh::TIntermRebuild::traversePost(sh::NodeType, const sh::TIntermNode&amp;, sh::TIntermNode&amp;, VisitBits)’:
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp:482:16: warning: storing the address of local variable ‘guard’ in ‘*this.sh::TIntermRebuild::mNodeStack.sh::TIntermRebuild::ConsList&lt;sh::TIntermNode*&gt;::tail’ [-Wdangling-pointer=]
  482 |     mNodeStack = {&amp;currNode, &amp;guard.oldNodeStack};
      |     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp:481:20: note: ‘guard’ declared here
  481 |     NodeStackGuard guard(mNodeStack);
      |                    ^~~~~
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp:481:20: note: ‘&lt;unknown&gt;’ declared here
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp: In function ‘sh::TIntermNode* sh::TIntermRebuild::traverseChildren(sh::NodeType, const sh::TIntermNode&amp;, sh::TIntermNode&amp;, VisitBits)’:
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp:411:16: warning: storing the address of local variable ‘guard’ in ‘*this.sh::TIntermRebuild::mNodeStack.sh::TIntermRebuild::ConsList&lt;sh::TIntermNode*&gt;::tail’ [-Wdangling-pointer=]
  411 |     mNodeStack = {&amp;currNode, &amp;guard.oldNodeStack};
      |     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp:410:20: note: ‘guard’ declared here
  410 |     NodeStackGuard guard(mNodeStack);
      |                    ^~~~~
/home/mcatanzaro/Projects/WebKit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_util/IntermRebuild.cpp:410:20: note: ‘&lt;unknown&gt;’ declared here</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862355</commentid>
    <comment_count>1</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2022-04-18 16:11:01 -0700</bug_when>
    <thetext>Please consider filing this bug on http://anglebug.com/ as well. These warnings would be best fixed upstream and from there rolled into WebKit.

If you can provide a comprehensive list of the warnings from your build (or, even better, a patch addressing them - please see https://chromium.googlesource.com/angle/angle/+/refs/heads/main/doc/ContributingCode.md ) then we can help get them fixed.

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862385</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-18 17:28:02 -0700</bug_when>
    <thetext>(In reply to Kenneth Russell from comment #1)
&gt; Please consider filing this bug on http://anglebug.com/ as well. These
&gt; warnings would be best fixed upstream and from there rolled into WebKit.

I agree that would be ideal, but I&apos;d rather not get involved with this upstream.

&gt; If you can provide a comprehensive list of the warnings from your build (or,
&gt; even better, a patch addressing them - please see
&gt; https://chromium.googlesource.com/angle/angle/+/refs/heads/main/doc/
&gt; ContributingCode.md ) then we can help get them fixed.
&gt; 
&gt; Thanks.

These are the only non-suppressed warnings currently.

We have a list of warnings to suppress at the bottom of Source/ThirdParty/ANGLE/CMakeLists.txt:

-Wno-cast-align
-Wno-extra
-Wno-suggest-attribute=format
-Wno-undef
-Wno-unused-parameter
-Wno-return-type
-Wno-comment

I&apos;ll either add -Wdangling-pointer there, or maybe just replace the list with -w (warnings are useful for upstream, not for downstream).

If you want, I can disable that and record all the warnings that I see. I would expect it to be quite a lot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862392</commentid>
    <comment_count>3</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2022-04-18 18:18:30 -0700</bug_when>
    <thetext>If it&apos;s not feasible for you to file a bug or propose a fix upstream in ANGLE then I suggest you add -Wdangling-pointer to Source/ThirdParty/ANGLE/CMakeLists.txt rather than -w so that at least new warnings are looked at and their severity can be evaluated in WebKit.

I would ask though that you at least copy/paste the warnings you&apos;ve found into a new bug on anglebug.com.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862649</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-19 11:25:19 -0700</bug_when>
    <thetext>OK, will do...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867625</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-09 07:35:05 -0700</bug_when>
    <thetext>(In reply to Kenneth Russell from comment #3)
&gt; If it&apos;s not feasible for you to file a bug or propose a fix upstream in
&gt; ANGLE then I suggest you add -Wdangling-pointer to
&gt; Source/ThirdParty/ANGLE/CMakeLists.txt rather than -w so that at least new
&gt; warnings are looked at and their severity can be evaluated in WebKit.

OK, I will use -Wdangling-pointer.

&gt; I would ask though that you at least copy/paste the warnings you&apos;ve found
&gt; into a new bug on anglebug.com.

Before I got around to this, bug #240041 happened. I can work around it easily enough by using my development build, but am sufficiently irritated that I&apos;m disinclined to do so. (That said, thanks for helping with it.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867626</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-05-09 07:35:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/92959790&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867628</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-09 07:40:49 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/566</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867711</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-09 11:45:36 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #5)
&gt; Before I got around to this, bug #240041 happened.

It has mysteriously fixed itself, at least for now. I reported:

https://bugs.chromium.org/p/angleproject/issues/detail?id=7288</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1868792</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-13 10:06:02 -0700</bug_when>
    <thetext>The ANGLE developers think this might be a real bug, not a false-positive. Hi Dean, it looks like you are familiar with this code. Can you check it please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1868846</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-13 13:39:35 -0700</bug_when>
    <thetext>Um, an ANGLE developer landed a change hoping to fix this, but it didn&apos;t work.

I provided an updated copy of the new warning in the upstream ticket. I was also going to offer to test any updated patch before it lands, to avoid landing another commit that doesn&apos;t work, but now I&apos;m blocked from commenting again due to bug #240041. If anybody wants to forward that offer along on the issue tracker, feel free. Seems absurd that I cannot log in even though I could 10 minutes ago, but oh well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1868849</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-13 13:47:03 -0700</bug_when>
    <thetext>Eh nevermind, I finally realized it&apos;s actually just discrimination, not an outright block. I was able to comment after all. See that bug #240041 for the full exciting story....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1869458</commentid>
    <comment_count>12</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-05-16 15:36:17 -0700</bug_when>
    <thetext>Committed r294271 (250617@main): &lt;https://commits.webkit.org/250617@main&gt;

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

    </bug>

</bugzilla>