[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

STINNER Victor report at bugs.python.org
Fri Jul 22 12:08:12 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

The problem is in PyLong_FromDouble(): if (Py_IS_INFINITY(dval)) is evaluated as false, whereas dval *is* infinity. Possible causes:

 - Py_IS_INFINITY is not defined as "# define Py_IS_INFINITY(X) isinf(X)" (issue with the pyconfig.h file?)
 - the compiler replaces isinf(X) by something else (!?)
 - isinf() is not called with the right argument (conversion between 32, 64 and/or 80 floats?)
 - issue with the FPU mode (unlikely because in your ctypes test, isinf(float("inf")) returns 1, and this test runs in the Python process)

Try to run python in gdb. Set a breakpoint on isinf() (or on PyLong_FromDouble() and use step by step) to check that the function is really called, and called with the "right" argument.

You may also try to replace Py_IS_INFINITY(dval) directly by isinf(dval) (or simply if(1) :-)) in PyLong_FromDouble().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12589>
_______________________________________


More information about the Python-bugs-list mailing list