<?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>124532</bug_id>
          
          <creation_ts>2013-11-18 12:30:21 -0800</creation_ts>
          <short_desc>[ASAN] Building with trunk clang corrupts sandbox profile with comment from Compiler.h</short_desc>
          <delta_ts>2019-05-02 16:23:35 -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>Web Template Framework</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Farler">dfarler</reporter>
          <assigned_to name="David Farler">dfarler</assigned_to>
          <cc>andersca</cc>
    
    <cc>ap</cc>
    
    <cc>benjamin</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>lisacarlon25</cc>
    
    <cc>marshalblake</cc>
    
    <cc>parkermark330</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>951747</commentid>
    <comment_count>0</comment_count>
    <who name="David Farler">dfarler</who>
    <bug_when>2013-11-18 12:30:21 -0800</bug_when>
    <thetext>In https://bugs.webkit.org/show_bug.cgi?id=119165,

A preprocessor check of __clang_major__ and __clang_minor__ was added to Source/WTF/wtf/Compiler.h because of a bug with the &quot;final&quot; keyword.

 59 /* Disable final on versions of Apple clang earlier than 4.2 to avoid bugs like http://webkit.org/b/119165 */
 60 #if defined(__APPLE__) &amp;&amp; (__clang_major__ &lt; 4 || (__clang_major__ == 4 &amp;&amp; __clang_minor__ &lt; 2))
 61 #define WTF_COMPILER_QUIRK_FINAL_IS_BUGGY 1
 62 // #error &quot;Please use a newer version of Xcode, this version has code generation bugs when using &apos;final&apos; in C++ code&quot;
 63 #endif

This inserts a comment into code that includes Compiler.h. However, this comment also makes its way into the WebKit2 separate process targets&apos; sandbox profiles, for which // is syntactically invalid and causes the binaries to get killed on launch with something like this:

Nov 18 11:53:20 dmf1 com.apple.launchd[1] (com.apple.WebKit.Networking.Development.41C1A105-0D6B-49FE-8642-88B8537ECD26[93304]): Exited with code: 77
Nov 18 11:53:20 dmf1 com.apple.launchd[1] (com.apple.WebKit.WebContent.Development.F1A8659F-2388-4B1A-ADAF-26C815F35877[93305]): Exited with code: 77
Nov 18 11:57:06 dmf1.apple.com com.apple.WebKit.WebContent.Development[93637]: com.apple.WebKit.WebContent.Development: Couldn&apos;t initialize sandbox profile [/Volumes/Data/Users/davidfarler/Downloads/WebKit 2.app/Contents/Frameworks/10.9/WebKit2.framework/Resources/com.apple.WebProcess.sb], error &apos;line 1: unbound variable: // &apos;

Trunk clang still identifies itself as clang 3.4:

$ xcrun clang --version
clang version 3.4 (trunk 194422)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

So we need to find a proper way to identify trunk clang as well as Apple-built clang.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>951777</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-11-18 13:59:28 -0800</bug_when>
    <thetext>Compiler.h should obviously use c-style comments.

I&apos;m a bit confused though. Is it even intentional that the #error is commented out? It got commented out without any explanation in &lt;http://trac.webkit.org/changeset/157044&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>951783</commentid>
    <comment_count>2</comment_count>
    <who name="David Farler">dfarler</who>
    <bug_when>2013-11-18 14:07:48 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Compiler.h should obviously use c-style comments.

This isn&apos;t obvious to me – what would that do in this case? &quot;;;&quot; are used to denote comments in sandbox profiles; would using C-style comments prevent this from getting printed to the profile or something?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>951792</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-11-18 14:14:01 -0800</bug_when>
    <thetext>.sb.in files are processed with a C preprocessor, which removes /**/ comments. There are lots more in Compiler.h, so this C++ one is a mistake.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>951795</commentid>
    <comment_count>4</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2013-11-18 14:16:04 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Compiler.h should obviously use c-style comments.
&gt; 
&gt; I&apos;m a bit confused though. Is it even intentional that the #error is commented out? It got commented out without any explanation in &lt;http://trac.webkit.org/changeset/157044&gt;.

It was unintentional. I was using a trunk build of clang and probably ran into the same error as David’s seeing now.

Since we only build on Xcode 5 now we can probably remove the quirk altogether.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>965112</commentid>
    <comment_count>5</comment_count>
      <attachid>220539</attachid>
    <who name="David Farler">dfarler</who>
    <bug_when>2014-01-07 12:28:05 -0800</bug_when>
    <thetext>Created attachment 220539
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>965113</commentid>
    <comment_count>6</comment_count>
      <attachid>220539</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2014-01-07 12:29:38 -0800</bug_when>
    <thetext>Comment on attachment 220539
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>965130</commentid>
    <comment_count>7</comment_count>
      <attachid>220539</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-01-07 13:03:08 -0800</bug_when>
    <thetext>Comment on attachment 220539
Patch

Clearing flags on attachment: 220539

Committed r161451: &lt;http://trac.webkit.org/changeset/161451&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>965131</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-01-07 13:03:11 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>220539</attachid>
            <date>2014-01-07 12:28:05 -0800</date>
            <delta_ts>2014-01-07 13:03:08 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-124532-20140107122804.patch</filename>
            <type>text/plain</type>
            <size>1550</size>
            <attacher name="David Farler">dfarler</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTYxNDQ0CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IGNiMTQzMjA1ZWJiMjI0OTM2NzAzMTRh
ZTYwZTM0OTlmNGJiZWY1NzIuLjM5NWRiODQwY2Q4OGYxMmQzMWQzMzA5MzBlOWE0NjUyYTVkN2Y4
Y2MgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hh
bmdlTG9nCkBAIC0xLDMgKzEsMTMgQEAKKzIwMTQtMDEtMDcgIERhdmlkIEZhcmxlciAgPGRmYXJs
ZXJAYXBwbGUuY29tPgorCisgICAgICAgIFtBU0FOXSBCdWlsZGluZyB3aXRoIHRydW5rIGNsYW5n
IGNvcnJ1cHRzIHNhbmRib3ggcHJvZmlsZSB3aXRoIGNvbW1lbnQgZnJvbSBDb21waWxlci5oCisg
ICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMjQ1MzIKKwor
ICAgICAg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