Red Hat Bugzilla – Bug 23489
g++ core dump on a segmentation violation
Last modified: 2007-04-18 12:30:34 EDT
Calling g++ like this
g++ -c -O3 -o ball.o ball.cc
on the enclosed input file causes g++ to dump core. This is with with the
updated gcc-c++-2.96-69 version of the compiler. I have tried to reduce
the example further, but it the problem disappears for most things I remove
now. Even if I do things like removing the second #include of a file which
has already been included.
(For correct credits: the original source came from the tunnel game
http://www.eng.um.edu.mt/~tbspit/tunnel version 20000913.)
Created attachment 7143 [details]
C++ source triggering a segmentation violation in g++
Cannot reproduce this (perhaps you have some headers different to
what I have installed). Can you perhaps run
g++ -c -O3 -o ball.o ball.cc -save-temps -v
then try if
g++ -c -O3 -o ball.o ball.ii
reproduces it as well and attach here ball.ii if yes?
I upbraded glibc-2.2 from release 5 to 9 to check if that was the relevant
difference, but it doesn't seem to be. I still get the dump. Is there any other
package involved which I should check? Gcc doesn't seem to depend on much else.
Anyway, I include ball.ii as requested. I also enclose a script log showing the
output when I ran the commands. As you can see, the bug is still there.
Created attachment 7205 [details]
Log from running the commands.
Created attachment 7206 [details]
Ball.ii as requested
Fixed in CVS g++ today (well, it did not segfault on it but the bug was still
there), plus the patch will appear in gcc-c++-2.96-71