Package: libc6
Version: 2.3.2.ds1-22sarge5
Architecture: amd64
CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
$ uname -a
Linux gloeiworm 2.6.18-2-amd64 #1 SMP Wed Nov 15 03:18:20 UTC 2006
x86_64 GNU/Linux
Problem:
======
With the "right" arguments the atan2() function will run on indefinitely
(forever unless killed). This is found for both C++ and C programs.
The simplest C program I could find that exhibits the problem is
file oef.c:
----
#include <math.h>
int main()
{
atan2(0.87600557019648551, 0.012279899574599516);
return 0;
}
----
build it:
gcc -o oef oef.c -lm
run it:
./oef &
This will run forever.
If I attach with gdb, I can see the following:
$ gdb
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-linux".
(gdb) attach 4492
Attaching to process 4492
Using host libthread_db library "/lib/libthread_db.so.1".
Reading symbols from /home/eric/pruts/oef...done.
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x00002b0a15e124ec in __signbitl () from /lib/libm.so.6
(gdb) where
#0 0x00002b0a15e124ec in __signbitl () from /lib/libm.so.6
#1 0x00002b0a15e13e46 in __signbitl () from /lib/libm.so.6
#2 0x00002b0a15e13681 in __signbitl () from /lib/libm.so.6
#3 0x00002b0a15e13522 in __signbitl () from /lib/libm.so.6
#4 0x00002b0a15ddd4e0 in fegetexcept () from /lib/libm.so.6
#5 0x00002b0a15df5b95 in atan2 () from /lib/libm.so.6
#6 0x0000000000400559 in main ()
The top of the stack is exactly the same as in my actual C++ program,
the behaviour depends on the exact values of the arguments of the atan2
function. In my actual program there are millions of calls to atan2()
that run just fine before this happens. The behaviour does not seem to
depend on optimization flags, also happens with mfpmath=387, and is the
same for C and C++. I got almost the same problem when I made my own
atan2() implementation, but then the __signbitl() in the stack was
called from an atan() function. The problem does not occur on my other
sarge system, which is 32bit Pentium 4.
It seems like this is a known problem with the 64 bit port of the math
library:
see http://sourceware.org/ml/libc-alpha/2003-11/msg00187.html
Please ask if you need more info,
Eric Meijer
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]