This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
fix-header crash (gcc 3.3.1 20030630)
- From: "Brian R. Gaeke" <gaeke at uiuc dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 30 Jun 2003 19:30:07 -0500
- Subject: fix-header crash (gcc 3.3.1 20030630)
Hi,
In the process of trying to build a cross compiler from i686-pc-linux-gnu
to sparcv9-sun-solaris2, I caused fix-header to crash. My machine is
running Red Hat Linux release 7.3 (Valhalla) and its compiler is gcc
version 2.96 20000731 (Red Hat Linux 7.3 2.96-113). I reduced the test
case significantly; although the result looks kind of silly, it does
seem to cause a crash, and it appears at the end of my message. I am
using fix-header from the latest gcc snapshot (see subj.)
To reproduce, I run:
------------------------------------------------------------------------------
764 neo> ./fix-header barf.test.h barf.test.h barf.test.h
barf.test.h: OK, nothing needs to be done.
Segmentation fault (core dumped)
------------------------------------------------------------------------------
The backtrace seems to suggest that something the C runtime wanted has
been trod upon by a bad pointer access:
------------------------------------------------------------------------------
barf.test.h: OK, nothing needs to be done.
Program received signal SIGSEGV, Segmentation fault.
0x400a076e in chunk_free () from /lib/libc.so.6
(gdb) where
#0 0x400a076e in chunk_free () from /lib/libc.so.6
#1 0x400a0548 in free () from /lib/libc.so.6
#2 0x40133b50 in __deregister_frame () from /lib/libc.so.6
#3 0x401348ce in _fini () from /lib/libc.so.6
#4 0x4000afea in _dl_fini () from /lib/ld-linux.so.2
#5 0x40056556 in exit () from /lib/libc.so.6
#6 0x08049a93 in read_scan_file (in_fname=0xbffff53c "barf.test.h", argc=0, argv=0xbffff394)
at ./fix-header.c:706
#7 0x0804a9a2 in main (argc=4, argv=0xbffff384) at ./fix-header.c:1166
#8 0x400431c4 in __libc_start_main () from /lib/libc.so.6
------------------------------------------------------------------------------
I would appreciate any help in fixing this. Here is the test case:
------------------------------------------------------------------------------
extern "C" {
extern "C" {
} extern "C" {
extern "C" {
} extern "C" {
extern "C" {
}}} extern "C" {
}} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
extern "C" {
extern "C" {
}}} extern "C" {
extern "C" {
extern "C" {
} extern "C" {
}}} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
} extern "C" {
}}
------------------------------------------------------------------------------