segmentation fault bug
Jeffrey A Law
law@cygnus.com
Sun Oct 25 14:50:00 GMT 1998
In message < 36338F72.5C3B41FC@inka.de >you write:
> Hi,
>
> below is a description of a bug which might be a bug in egcs.
>
> 1. I have the following source ("testn.cc"):
>
> #include <stdio.h>
> #include <math.h>
>
> main()
> {
> float v = fabs(-1.); // A
> printf("a"); // B
> pow(1., 5.); // C
> }
>
> 2. I compile it with "g++ -O testn.cc".
> 3. When I call "a.out" I get the following error message
> (this should not happen and therefore seems to be a bug):
> "Segmentation fault"
> 4. Hardware: AMD K6-2 300 or P90
> 5. OS: Debian LINUX 2.0 with a 2.0.34 kernel
> 6. g++ -v:
> Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.90.29/specs
> gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
> 7. The bug does *not* occur:
> - when I remove either A, B, or C.
> - with gcc version 2.7.2.3.
> - when I copmpile "testn.cc" without the "-O" option.
>
> Do you have any clues if this bug might be my fault, a egcs bug,
> or some kind of LINUX bug?
It is most likely an egcs bug. The pow function in glibc2 tickles a bug in
egcs-1.0.x compilers. egcs-1.1 should do the right thing.
jeff
More information about the Gcc-bugs
mailing list