<?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>216746</bug_id>
          
          <creation_ts>2020-09-20 10:47:50 -0700</creation_ts>
          <short_desc>Enable AddressSanitizer in C++ std library templates</short_desc>
          <delta_ts>2021-09-10 14:36:22 -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>Tools / Tests</component>
          <version>Other</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=230100</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>
          <dependson>216318</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>dino</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>peng.liu6</cc>
    
    <cc>ryanhaddad</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1690176</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2020-09-20 10:47:50 -0700</bug_when>
    <thetext>Enable AddressSanitizer in C++ std library templates.

This amounts to undefining the _LIBCPP_HAS_NO_ASAN macro when building.

Although most of WebKit doesn&apos;t used C++ std library types like std::vector or std::hash, ANGLE and libwebrtc do use these types, so it&apos;s beneficial to enable AddressSanitizer in these cases when compiling with Asan enabled for the rest of WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690182</commentid>
    <comment_count>1</comment_count>
      <attachid>409239</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2020-09-20 11:10:18 -0700</bug_when>
    <thetext>Created attachment 409239
Patch v1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690185</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2020-09-20 11:11:25 -0700</bug_when>
    <thetext>(In reply to David Kilzer (:ddkilzer) from comment #0)
&gt; Although most of WebKit doesn&apos;t used C++ std library types like std::vector
&gt; or std::hash, ANGLE and libwebrtc do use these types, so it&apos;s beneficial to
&gt; enable AddressSanitizer in these cases when compiling with Asan enabled for
&gt; the rest of WebKit.

Actually, I think this is mostly affects std::vector and related classes, not std::hash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690187</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2020-09-20 11:19:59 -0700</bug_when>
    <thetext>I CCed folks that work on ANGLE and libwebrtc since there is a small chance that enabling this might find some latent issues in those libraries when running layout tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690206</commentid>
    <comment_count>4</comment_count>
      <attachid>409239</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2020-09-20 13:03:27 -0700</bug_when>
    <thetext>Comment on attachment 409239
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=409239&amp;action=review

&gt; Tools/sanitizer/asan.xcconfig:9
&gt; +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = $(inherited) -U_LIBCPP_HAS_NO_ASAN;

Nice. Did you run tests locally to confirm that nothing terrible was going to happen? EWS doesn&apos;t have ASan.

&gt; Tools/sanitizer/sanitizer.xcconfig:7
&gt;  WK_SANITIZER_OTHER_CFLAGS_YES = -fno-omit-frame-pointer -g;
&gt; +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = ;

Does &quot;-fno-omit-frame-pointer -g&quot; get added for C++ in some other way, or do we not need it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690245</commentid>
    <comment_count>5</comment_count>
      <attachid>409239</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2020-09-20 20:45:48 -0700</bug_when>
    <thetext>Comment on attachment 409239
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=409239&amp;action=review

&gt;&gt; Tools/sanitizer/asan.xcconfig:9
&gt;&gt; +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = $(inherited) -U_LIBCPP_HAS_NO_ASAN;
&gt; 
&gt; Nice. Did you run tests locally to confirm that nothing terrible was going to happen? EWS doesn&apos;t have ASan.

Yes.  No new ASan-related crashes in any std C++ objects.

&gt;&gt; Tools/sanitizer/sanitizer.xcconfig:7
&gt;&gt; +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = ;
&gt; 
&gt; Does &quot;-fno-omit-frame-pointer -g&quot; get added for C++ in some other way, or do we not need it?

As noted in the ChangeLog, OTHER_CFLAGS applies to C++ sources, so it doesn&apos;t need to be listed twice.  I verified this by reviewing build log output.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690383</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2020-09-21 12:01:20 -0700</bug_when>
    <thetext>&gt; As noted in the ChangeLog, OTHER_CFLAGS applies to C++ sources, so it doesn&apos;t need to be listed twice.

My understanding was that OTHER_CFLAGS was the default value for OTHER_CPLUSPLUSFLAGS, but it had no effect when OTHER_CPLUSPLUSFLAGS was defined.

&gt; I verified this by reviewing build log output.

Surprising.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690431</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-09-21 12:25:34 -0700</bug_when>
    <thetext>&lt;rdar://problem/69319755&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1690456</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-09-21 13:02:29 -0700</bug_when>
    <thetext>Committed r267358: &lt;https://trac.webkit.org/changeset/267358&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 409239.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>409239</attachid>
            <date>2020-09-20 11:10:18 -0700</date>
            <delta_ts>2020-09-21 13:02:30 -0700</delta_ts>
            <desc>Patch v1</desc>
            <filename>bug-216746-20200920111111.patch</filename>
            <type>text/plain</type>
            <size>2501</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjY3MTQ0CmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggNGZhNzA5NDdjMzgzODJmYzAzMGMyMWFlN2U2YmUyNWUx
YjI2ZWUzZS4uZDMzN2JkNmZkMTVmMmQyYTU5ZDQ2MDBlOWU3ZjE1ZTUwNzE4N2E1YyAxMDA2NDQK
LS0tIGEvVG9vbHMvQ2hhbmdlTG9nCisrKyBiL1Rvb2xzL0NoYW5nZUxvZwpAQCAtMSwzICsxLDI2
IEBACisyMDIwLTA5LTIwICBEYXZpZCBLaWx6ZXIgIDxkZGtpbHplckBhcHBsZS5jb20+CisKKyAg
ICAgICAgRW5hYmxlIEFkZHJlc3NTYW5pdGl6ZXIgaW4gQysrIHN0ZCBsaWJyYXJ5IHRlbXBsYXRl
cworICAgICAgICA8aHR0cHM6Ly93ZWJ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