This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Exception bug in egcs-1.1.1

Dear developers of EGCS,

I found a bug in the exception handling: if an exception is both thrown
and caught in the same C++ module (i. e. "*.cc" file), everything works
fine. But if an exception is caught in a different module than it was
thrown in, the program aborts with either a segmentation fault or an
"IOT trap/Abort". I attached a tar file containing the minimal code to
produce the bug.

My configuration:

computer: i486DX4/100; 16MB RAM
GNU machine description: i486-pc-linux-gnulibc1
OS: SuSE-Linux 5.0; ELF; Kernel 2.0.35
ld: GNU ld 2.8.1; supported emulations: elf_i386, i386linux
g++ -v: "gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)"
configure options for compiling egcs: "--prefix=/usr --enable-shared 
  --with-gnu-as --with-gnu-ld"
command for compiling egcs: "make CFLAGS="-s -O3" LIBCFLAGS="-s -O3" 
  LIBCXXFLAGS="-s -O3 -fno-implicit-templates bootstrap-lean "

options for compiling exception test program: 
  "-s -O3 -W -Wall", "-O0 -Wall -W" "-g -Wall -W" 
  -> every variation produces the bug

My test program: contains a main() catching "FooException"s throwed by a 
function foo(). foo.h contains  declarations for FooException and foo(). contains the definition for foo() (it just throws a FooException).
This program produced the bug. But if foo()'s definition is just moved to (and thus making empty but the #include), everything

The program runs correctly on gcc 2.8.1 (on my friend's computer).

Thanks for your investigations and also for your enormous and impressive
efforts to write the best C++ compiler ever!


Martin Pitt 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]