<?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>163897</bug_id>
          
          <creation_ts>2016-10-24 10:17:37 -0700</creation_ts>
          <short_desc>[CMake] RelWithDebInfo builds are super broken at runtime</short_desc>
          <delta_ts>2017-02-03 09:22:50 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.gnome.org/show_bug.cgi?id=772692</see_also>
    
    <see_also>https://bugs.mageia.org/show_bug.cgi?id=19470</see_also>
          <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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annulen</cc>
    
    <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>clopez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>fujii</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>rfox</cc>
    
    <cc>tpopela</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1243753</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-24 10:17:37 -0700</bug_when>
    <thetext>Several Mageia users are complaining that Evolution is not displaying mails properly. For these users, it seems Epiphany is broken in the same manner.

Please see:

Screenshot of bug in Evolution: https://bug772692.bugzilla-attachments.gnome.org/attachment.cgi?id=337312
Screenshot of bug in Epiphany: https://bug772692.bugzilla-attachments.gnome.org/attachment.cgi?id=337574
glxinfo of first affected user: https://bug772692.bugzilla-attachments.gnome.org/attachment.cgi?id=338287
glxinfo of second affected user: https://bug772692.bugzilla-attachments.gnome.org/attachment.cgi?id=338310

The graphics stacks look totally different. At first I thought there might be an ABI issue in Mageia, but they&apos;ve rebuilt everything recently so that&apos;s unlikely.

There is some more debug information in the downstream bug, including a valgrind log, but unfortunately nothing that looked useful to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1244205</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Fox">rfox</who>
    <bug_when>2016-10-25 08:38:26 -0700</bug_when>
    <thetext>For background on the bug filed on Evolution bugzilla:
https://bugzilla.gnome.org/show_bug.cgi?id=772692

Just wanted to report that this issue is independent of what graphics card (happens on Intel based laptop as well as NVidia based PC using either nouveau or NVidia proprietary drivers)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1253640</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Fox">rfox</who>
    <bug_when>2016-11-25 03:05:41 -0800</bug_when>
    <thetext>Here&apos;s the Mageia bug related to this issue:
https://bugs.mageia.org/show_bug.cgi?id=19470

I&apos;m the the one who originated this bug - and I&apos;m still affected</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1253649</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-11-25 07:52:27 -0800</bug_when>
    <thetext>I wouldn&apos;t expect any progress on this since it only seems to affect Mageia users and no WebKit developers are using Mageia, sorry. :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271678</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-01-31 05:48:49 -0800</bug_when>
    <thetext>Good news for you, this started affecting Fedora. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271679</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-01-31 05:51:10 -0800</bug_when>
    <thetext>The Fedora maintainer (Tom) reports that the bug (really strangely) disappears when doing a Release build. (You&apos;re probably doing a RelWithDebInfo build, because that&apos;s what all distros want to use.) So you might try that and see if it works as a workaround until we figure out what&apos;s going on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271686</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-01-31 06:25:30 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; The Fedora maintainer (Tom) reports that the bug (really strangely)
&gt; disappears when doing a Release build. (You&apos;re probably doing a
&gt; RelWithDebInfo build, because that&apos;s what all distros want to use.)

Turns out Fedora and Debian are both (IMO incorrectly) using Release builds instead of RelWithDebInfo builds. So that explains why it&apos;s only broken for Mageia.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271720</commentid>
    <comment_count>7</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-01-31 08:04:26 -0800</bug_when>
    <thetext>I might be wrong but I understand Release is a production build and therefore what distros should do. At least I hope Debian keeps doing so.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271728</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-01-31 08:28:45 -0800</bug_when>
    <thetext>Why RelWithDebInfo builds are broken???</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271750</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-01-31 09:35:13 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; I might be wrong but I understand Release is a production build and
&gt; therefore what distros should do. At least I hope Debian keeps doing so.

Release is a production build WITHOUT debuginfo, i.e. with debuginfo explicitly disabled. All Linux distros want RelWithDebInfo, which is production build WITH debuginfo. Turns out only Mageia was doing this properly, so only Mageia was broken.

It makes no real difference, because all distros override the CFLAGS with -O2 -g anyway so you get a release build with debuginfo regardless of build type, but it seems good to pick the build type that matches what you semantically want to do.

(In reply to comment #8)
&gt; Why RelWithDebInfo builds are broken???

Because our CMake files check the build type and add necessary compiler flags only if it is &quot;Release&quot; or &quot;Debug&quot; in various places. We need to audit the whole thing.

mcatanzaro:  annulen: Not possible to grep for something? CMAKE_BUILD_TYPE?
annulen:  CMAKE_BUILD_TYPE and _RELEASE or _DEBUG variables
annulen:  and decide what should be done in each case

(A related bug is that RelWithDebInfo will not define NDEBUG, which will enable assertions, which we don&apos;t want. That&apos;s a bug in our choice of how to decide when to enable assertions. They should be dependent on DEVELOPER_MODE rather than NDEBUG. Mageia was defining NDEBUG manually to avoid this problem.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271751</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-01-31 09:37:51 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Good news for you, this started affecting Fedora. :)

(For the record: what happened is Tom decided to do a RelWithDebInfo build for some reason, and showed me the screenshots of the breakage that resulted. He picked DuckDuckGo, which happened to be the same website that the Mageia users took screenshots of so it looked exactly like the screenshots above. So we got really lucky to figure this out.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272846</commentid>
    <comment_count>11</comment_count>
      <attachid>300514</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2017-02-03 02:04:17 -0800</bug_when>
    <thetext>Created attachment 300514
annulen&apos;s patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272868</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-02-03 04:07:16 -0800</bug_when>
    <thetext>Looks good to me, but why were these flags not previously required in debug mode?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272870</commentid>
    <comment_count>13</comment_count>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2017-02-03 04:15:30 -0800</bug_when>
    <thetext>-fstrict-aliasing is enabled in GCC since -O2 or -Os levels only, so debug builds don&apos;t require -fno-strict-aliasing flag for correct work</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272898</commentid>
    <comment_count>14</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-02-03 06:22:57 -0800</bug_when>
    <thetext>OK.

Do you want to submit a patch for review?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272914</commentid>
    <comment_count>15</comment_count>
      <attachid>300514</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-02-03 08:27:12 -0800</bug_when>
    <thetext>Comment on attachment 300514
annulen&apos;s patch

r=me because this is clearly better than what we&apos;re doing now.

I&apos;m a bit concerned that we&apos;re adding our flags after ${CMAKE_C_FLAGS} rather than before. That is, we&apos;re overriding the CFLAGS and CXXFLAGS set by the user. That&apos;s generally considered to be bad form in Autotools projects, where the user is always supposed to be override our build flags. But maybe it&apos;s better that we don&apos;t give the user control over these particular flags. E.g. Linux distros use -fexceptions in order to get better backtraces, but that&apos;s really mostly intended for C projects, not C++ projects that don&apos;t use exceptions; I imagine it could lead to significant code size bloat in WebKit for insufficient benefit, and that change would be immediately noticed if we were to change this. So I dunno.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272921</commentid>
    <comment_count>16</comment_count>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2017-02-03 08:31:22 -0800</bug_when>
    <thetext>Enabling exceptions may also have negative effect on performance, as they can prevent compiler optimizations (I encountered this in practise)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272922</commentid>
    <comment_count>17</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-02-03 08:32:53 -0800</bug_when>
    <thetext>I think the right answer is this:

(In reply to comment #15)
&gt; maybe it&apos;s better that we don&apos;t give the user control over these particular flags.

So let&apos;s use your patch with no changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272925</commentid>
    <comment_count>18</comment_count>
      <attachid>300514</attachid>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2017-02-03 08:41:35 -0800</bug_when>
    <thetext>Comment on attachment 300514
annulen&apos;s patch

This is certainly not the last thing to do to support configurations different from &quot;Release&quot; and &quot;Debug&quot;, I&apos;ll try to provide necessary changes soon</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272928</commentid>
    <comment_count>19</comment_count>
      <attachid>300514</attachid>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2017-02-03 08:44:54 -0800</bug_when>
    <thetext>Comment on attachment 300514
annulen&apos;s patch

Oops, changelog</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272941</commentid>
    <comment_count>20</comment_count>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2017-02-03 09:22:50 -0800</bug_when>
    <thetext>Committed r211635: &lt;http://trac.webkit.org/changeset/211635&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>300514</attachid>
            <date>2017-02-03 02:04:17 -0800</date>
            <delta_ts>2017-02-03 08:44:54 -0800</delta_ts>
            <desc>annulen&apos;s patch</desc>
            <filename>annulen.patch</filename>
            <type>text/plain</type>
            <size>842</size>
            <attacher name="Fujii Hironori">fujii</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9jbWFrZS9PcHRpb25zQ29tbW9uLmNtYWtlIGIvU291cmNlL2Nt
YWtlL09wdGlvbnNDb21tb24uY21ha2UKaW5kZXggNTliNzEyODJlNTcuLjE2MzAyOWY1MTYxIDEw
MDY0NAotLS0gYS9Tb3VyY2UvY21ha2UvT3B0aW9uc0NvbW1vbi5jbWFrZQorKysgYi9Tb3VyY2Uv
Y21ha2UvT3B0aW9uc0NvbW1vbi5jbWFrZQpAQCAtMzgsOCArMzgsOCBAQCBzZXRfcHJvcGVydHko
R0xPQkFMIFBST1BFUlRZIFVTRV9GT0xERVJTIE9OKQogZGVmaW5lX3Byb3BlcnR5KFRBUkdFVCBQ
Uk9QRVJUWSBGT0xERVIgSU5IRVJJVEVEIEJSSUVGX0RPQ1MgImZvbGRlciIgRlVMTF9ET0NTICJJ
REUgZm9sZGVyIG5hbWUiKQogCiBpZiAoQ09NUElMRVJfSVNfR0NDX09SX0NMQU5HKQotICAgIHNl
dChDTUFLRV9DX0ZMQUdTX1JFTEVBU0UgIiR7Q01BS0VfQ19GTEFHU19SRUxFQVNFfSAtZm5vLWV4
Y2VwdGlvbnMgLWZuby1zdHJpY3QtYWxpYXNpbmciKQotICAgIHNldChDTUFLRV9DWFhfRkxBR1Nf
UkVMRUFTRSAiJHtDTUFLRV9DWFhfRkxBR1NfUkVMRUFTRX0gLWZuby1leGNlcHRpb25zIC1mbm8t
c3RyaWN0LWFsaWFzaW5nIC1mbm8tcnR0aSIpCisgICAgc2V0KENNQUtFX0NfRkxBR1MgIiR7Q01B
S0VfQ19GTEFHU30gLWZuby1leGNlcHRpb25zIC1mbm8tc3RyaWN0LWFsaWFzaW5nIikKKyAgICBz
ZXQoQ01BS0VfQ1hYX0ZMQUdTICIke0NNQUtFX0NYWF9GTEFHU30gLWZuby1leGNlcHRpb25zIC1m
bm8tc3RyaWN0LWFsaWFzaW5nIC1mbm8tcnR0aSIpCiAgICAgc2V0KENNQUtFX0NYWF9GTEFHUyAi
JHtDTUFLRV9DWFhfRkxBR1N9IC1zdGQ9YysrMXkiKQogZW5kaWYgKCkKIAo=
</data>
<flag name="review"
          id="322396"
          type_id="1"
          status="+"
          setter="mcatanzaro"
    />
    <flag name="commit-queue"
          id="322403"
          type_id="3"
          status="-"
          setter="annulen"
    />
          </attachment>
      

    </bug>

</bugzilla>