<?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>134593</bug_id>
          
          <creation_ts>2014-07-03 07:14:14 -0700</creation_ts>
          <short_desc>[GTK] [Stable] Crash in TSymbolTableLevel::~TSymbolTableLevel with GCC 4.9</short_desc>
          <delta_ts>2014-07-04 00:14:27 -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>WebKitGTK</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alberto Garcia">berto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1020253</commentid>
    <comment_count>0</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2014-07-03 07:14:14 -0700</bug_when>
    <thetext>There&apos;s a bug in ANGLE triggered with GCC 4.9.

It crashes the WebProcess when you open some sites like http://gabrielecirulli.github.io/2048/

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007f24f4756b17 in TSymbolTableLevel::~TSymbolTableLevel() () from /tmp/WebKit/WebKitBuild/Release/.libs/libwebkit2gtk-3.0.so.25
#2  0x00007f24f4707891 in TCompiler::compile(char const* const*, unsigned long, int) () from /tmp/WebKit/WebKitBuild/Release/.libs/libwebkit2gtk-3.0.so.25
#3  0x00007f24f47554dc in ShCompile () from /tmp/WebKit/WebKitBuild/Release/.libs/libwebkit2gtk-3.0.so.25
#4  0x00007f24f4aca780 in WebCore::ANGLEWebKitBridge::compileShaderSource(char const*, WebCore::ANGLEShaderType, WTF::String&amp;, WTF::String&amp;, WTF::Vector&lt;WebCore::ANGLEShaderSymbol, 0ul, WTF::CrashOnOverflow&gt;&amp;, int) () from /tmp/WebKit/WebKitBuild/Release/.libs/libwebkit2gtk-3.0.so.25
#5  0x00007f24f4abedc0 in WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE(unsigned int) ()
   from /tmp/WebKit/WebKitBuild/Release/.libs/libwebkit2gtk-3.0.so.25


master is not affected by this, but the stable branch (2.4.3) is. This has been reported and fixed upstream:

https://code.google.com/p/angleproject/issues/detail?id=651

However the patch doesn&apos;t apply cleanly against the ANGLE version in our stable branch. This one, also posted there, and apparently used by Mozilla, does work, though:

--- a/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp
@@ -171,7 +171,8 @@ TFunction::~TFunction()
 TSymbolTableLevel::~TSymbolTableLevel()
 {
     for (tLevel::iterator it = level.begin(); it != level.end(); ++it)
-        delete (*it).second;
+        if ((*it).first == (*it).second-&gt;getMangledName())
+            delete (*it).second;
 }

 //</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1020263</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-07-03 08:29:05 -0700</bug_when>
    <thetext>I wonder why master is not affected, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1020313</commentid>
    <comment_count>2</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2014-07-03 10:59:06 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; I wonder why master is not affected, though.

Doesn&apos;t it have a different version of ANGLE?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1020321</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-07-03 11:50:39 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; I wonder why master is not affected, though.
&gt; 
&gt; Doesn&apos;t it have a different version of ANGLE?

Yes, but the fix you mention is not there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1020448</commentid>
    <comment_count>4</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2014-07-04 00:06:19 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; I wonder why master is not affected, though.
&gt; &gt; 
&gt; &gt; Doesn&apos;t it have a different version of ANGLE?
&gt; 
&gt; Yes, but the fix you mention is not there.

In master it was solved using a different fix, which seems more efficient:

https://chromium.googlesource.com/angle/angle/+/adfffe4649d622bab6957972663a852f123b5ea7%5E%21/

This doesn&apos;t apply cleanly in the stable branch (there&apos;s actually lots of conflicts) but we could try to see if it&apos;s easy to backport, the changes themselves don&apos;t seem complex.

Or we can just stick to the simple version in the stable branch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1020449</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-07-04 00:07:38 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; &gt; I wonder why master is not affected, though.
&gt; &gt; &gt; 
&gt; &gt; &gt; Doesn&apos;t it have a different version of ANGLE?
&gt; &gt; 
&gt; &gt; Yes, but the fix you mention is not there.
&gt; 
&gt; In master it was solved using a different fix, which seems more efficient:
&gt; 
&gt; https://chromium.googlesource.com/angle/angle/+/adfffe4649d622bab6957972663a852f123b5ea7%5E%21/
&gt; 
&gt; This doesn&apos;t apply cleanly in the stable branch (there&apos;s actually lots of conflicts) but we could try to see if it&apos;s easy to backport, the changes themselves don&apos;t seem complex.
&gt; 
&gt; Or we can just stick to the simple version in the stable branch.

The stable branch is using an older version of ANGLE, so let&apos;s use the simple patch for now that fixes the crashes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1020451</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-07-04 00:14:27 -0700</bug_when>
    <thetext>Commited &lt;http://trac.webkit.org/changeset/170788&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>