Skip to contentSkip to conversation

bug in fmod on trillian [fmod(-10,1) causes core dump]

Linux-ia64 Trent Mick 2 participants 2 messages May 1, 2000

lore
Share & tools
lore

Trent Mick

author
#0 lore raw

I hope that someone appropriate (i.e. someone at Cygnus or someone on ia64-tools) sees this message.

Some arguments to fmod() cause a segmentation fault on trillian. Examples are fmod(-10,1), fmod(-10,0.5).

Here is a test case:

-----------> ls
Makefile fmodbug.c
-----------> cat fmodbug.c
#include <stdio.h>
#include <math.h>

int main(void)

{
        int i;
        double d;

        d = fmod(-10.0, 1.0);
        printf("fmod(-10,1) = %f\n", d);

        return 0;
}

-----------> cat Makefile
all : fmodbug

fmodbug : fmodbug.c
gcc -lm fmodbug.c -o fmodbug

test :
./fmodbug

clean :
-rm -f fmodbug
-rm -f core
-rm -f *~
-----------> make
gcc -lm fmodbug.c -o fmodbug
-----------> make test
./fmodbug
make: *** [test] Segmentation fault (core dumped)
----------->

I would appreciate a reply if this reaches the proper eyes. Or, if someone can tell me to whom this should properly reported...

Thanks,
Trent

--
Trent Mick
[email protected]

#1 lore raw

I tried your testcase on my system. It worked fine.

Your bug report is incomplete. You didn't mention what compiler version you have, or the glibc version, or the kernel version, or the root filesystem and/or OS release, or the firmware version or the hardware version. The problem could be any of those, or something else.

It is pretty unlikely that the compiler miscompiled such a simple testcase. So I would guess, in order
1) You have a miscompiled glibc. Try recompiling it or getting a newer one.
2) You have an old buggy gcc. Try getting a newer one. Repeat step one.
3) You have old buggy firmware. Try updating it.

Jim