Bug 252 - Run time error
Run time error
Product: Red Hat Linux
Classification: Retired
Component: libc (Show other bugs)
i386 Linux
high Severity medium
: ---
: ---
Assigned To: David Lawrence
Depends On:
  Show dependency treegraph
Reported: 1998-12-01 16:29 EST by xshen
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1998-12-03 12:03:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description xshen 1998-12-01 16:29:06 EST
I use gcc and g++ to compile the following small code

#include <math.h>
	double a[2];

If I use -O2 option, and when I run the program
I get "segmentation fault(core dumped)". If I do
not use "-O2" option, I won't get any error. I also
upgrade gcc- to gcc-2.8.1 and I still get
same type error, but only when I change "double a[2]" into
"int a[2]".

Why does this happen?

BTW, I upgraded the libc and glib package ftped from
your web site.
Comment 1 xshen 1998-12-01 17:08:59 EST
I tested this in a Pc with redhat 5.0, and no error.
Comment 2 xshen 1998-12-01 19:53:59 EST
In /usr/include/__math.h:552, if I change this line into
long long int __p = (long int) __y,

then I won't get error. Is this the problem?

The original line is

long long int __p = (long long int) __y
Comment 3 David Lawrence 1998-12-03 12:03:59 EST
Could not replicate this problem on a test machine.
Used gcc- rpm.
Comment 4 xshen 1998-12-03 12:34:59 EST
Did you try to change "double a[2];" to "int a[2];"? Only one
of them will generate error by using gcc- with "-O2" option.


Note You need to log in before you can comment on or make changes to this bug.