[Bug c/36697] New: SIGSEGV on program exit with gcc 4.3.1
benny at ammitzboell-consult dot dk
gcc-bugzilla@gcc.gnu.org
Wed Jul 2 15:34:00 GMT 2008
I get SIGSEGV when my C and C++ programs exits. I have tracked it down to the
__do_global_dtors_aux function. The newly added code under HIDDEN_DTOR_LIST_END
does not check if the function ptr from the list is 0 - which the old code
below does. On my platform (no-mmu ARM, uclibc, uclinux) at least there are
zero-pointers in that __DTOR_LIST__.
This patch solved the issue for me:
--- gcc-4.3.1.org/gcc/crtstuff.c 2008-07-02 15:52:23.000000000 +0200
+++ gcc-4.3.1/gcc/crtstuff.c 2008-07-02 17:03:35.000000000 +0200
@@ -298,6 +298,7 @@
while (dtor_idx < max_idx)
{
f = __DTOR_LIST__[++dtor_idx];
+ if (!f) break;
f ();
}
}
--
Summary: SIGSEGV on program exit with gcc 4.3.1
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: benny at ammitzboell-consult dot dk
GCC build triplet: i386-pc-linux-gnu
GCC host triplet: i386-pc-linux-gnu
GCC target triplet: arm-linux-uclibc
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36697
More information about the Gcc-bugs
mailing list