gcj-compiled multithreaded programs trigger Segmentation Faults in emutls.c:76
This clearly comes from the deletion of an uninitialized pointer.
I found this patch on toolchain-commit, and it works, but it does not seem to
be committed to gcc subversion tree.

ref:
http://www.mail-archive.com/toolchain-comm...@blackfin.uclinux.org/msg01652.html#trunkgcc43gccemutlsc


Modified: trunk/gcc-4.3/gcc/emutls.c (3180 => 3181)


--- trunk/gcc-4.3/gcc/emutls.c  2009-02-12 18:30:30 UTC (rev 3180)
+++ trunk/gcc-4.3/gcc/emutls.c  2009-02-13 09:45:04 UTC (rev 3181)
@@ -70,7 +70,7 @@
   pointer size = arr->size;
   pointer i;

-  for (i = 0; i < size; ++i)
+  for (i = 0; i < size - 1; ++i)
     {
       if (arr->data[i])
        free (arr->data[i][-1]);


-- 
           Summary: trunk/gcc-4.3/gcc: * emutls.c (emutls_destroy): Don' t
                    fall out of the array bound.
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: antoine dot rozenknop at gmail dot com
GCC target triplet: i586-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40024

Reply via email to