This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_math fails on 64bit
Type: behavior Stage:
Components: Library (Lib), Tests Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: barry, benjamin.peterson, mark.dickinson
Priority: release blocker Keywords: 64bit, patch

Created on 2008-06-16 02:39 by benjamin.peterson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
math_64.patch mark.dickinson, 2008-06-17 16:58
Messages (7)
msg68257 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-16 02:39
Re-running failed tests in verbose mode
Re-running test 'test_math' in verbose mode
testAcos (test.test_math.MathTests) ... ok
testAcosh (test.test_math.MathTests) ... ok
testAsin (test.test_math.MathTests) ... ok
testAsinh (test.test_math.MathTests) ... ok
testAtan (test.test_math.MathTests) ... ok
testAtan2 (test.test_math.MathTests) ... ok
testAtanh (test.test_math.MathTests) ... ok
testCeil (test.test_math.MathTests) ... ok
testConstants (test.test_math.MathTests) ... ok
testCopysign (test.test_math.MathTests) ... ok
testCos (test.test_math.MathTests) ... ok
testCosh (test.test_math.MathTests) ... ok
testDegrees (test.test_math.MathTests) ... ok
testExp (test.test_math.MathTests) ... ok
testFabs (test.test_math.MathTests) ... ok
testFactorial (test.test_math.MathTests) ... ok
testFloor (test.test_math.MathTests) ... ok
testFmod (test.test_math.MathTests) ... ok
testFrexp (test.test_math.MathTests) ... ok
testHypot (test.test_math.MathTests) ... ok
testIsinf (test.test_math.MathTests) ... ok
testIsnan (test.test_math.MathTests) ... ok
testLdexp (test.test_math.MathTests) ... ok
testLog (test.test_math.MathTests) ... ok
testLog10 (test.test_math.MathTests) ... ok
testLog1p (test.test_math.MathTests) ... ok
testModf (test.test_math.MathTests) ... ok
testPow (test.test_math.MathTests) ... ok
testRadians (test.test_math.MathTests) ... ok
testSin (test.test_math.MathTests) ... ok
testSinh (test.test_math.MathTests) ... ok
testSqrt (test.test_math.MathTests) ... ok
testSum (test.test_math.MathTests) ... ok
testTan (test.test_math.MathTests) ... ok
testTanh (test.test_math.MathTests) ... ok
test_exceptions (test.test_math.MathTests) ... ok
test_testfile (test.test_math.MathTests) ... FAIL
test_trunc (test.test_math.MathTests) ... ok
Doctest: ieee754.txt ... ok

======================================================================
FAIL: test_testfile (test.test_math.MathTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_math.py",
line 939, in test_testfile
    self.fail(message)
AssertionError: Unexpected OverflowError in test exp0042:exp(-745.0)


----------------------------------------------------------------------
Ran 39 tests in 46.087s

FAILED (failures=1)
test test_math failed -- Traceback (most recent call last):
  File
"/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_math.py",
line 939, in test_testfile
    self.fail(message)
AssertionError: Unexpected OverflowError in test exp0042:exp(-745.0)
msg68331 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-17 16:58
I suspect that what's happening is that errno is being set to ERANGE
on a subnormal results;  this is somewhat ... um ... unorthodox.

In that case, the fix would be to raise OverflowError when errno is set to 
ERANGE and the function result x is larger than 1, say, in absolute value.  
(Currently the code ignores errno=ERANGE only when x == 0.)

Could someone with access to ia64 hardware test the attached patch?
msg68341 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-17 20:55
I further suspect that no-one with access to ia64 is monitoring this 
issue.  :-)

So maybe this should just be checked in, and then reverted if it either 
causes other buildbots to fail or doesn't help with Ubuntu/ia64.

Benjamin, are you in a position to verify that the patch looks sane 
and/or test it on Windows?  It works for me on OS X 10.5/Intel and SuSE 
Linux/x86.  I'm reasonably confident that the patch shouldn't break 
anything on already-working platforms, but with floating-point stuff 
it's always hard to be 100% certain.
msg68343 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-17 21:09
It looks fine to me. Please apply.
msg68344 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-17 21:17
Committed, r64349.  I'm watching the buildbots.
msg68345 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-17 21:18
On Tue, Jun 17, 2008 at 4:17 PM, Mark Dickinson <report@bugs.python.org> wrote:
>
> Mark Dickinson <dickinsm@gmail.com> added the comment:
>
> Committed, r64349.  I'm watching the buildbots.

You can bet I am, too. :)
msg68348 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-17 22:38
Thanks Mark. That seems to have done the trick.
History
Date User Action Args
2022-04-11 14:56:35adminsetnosy: + barry
github: 47368
2008-06-17 22:38:33benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg68348
2008-06-17 21:18:24benjamin.petersonsetmessages: + msg68345
2008-06-17 21:17:53mark.dickinsonsetmessages: + msg68344
2008-06-17 21:09:35benjamin.petersonsetassignee: mark.dickinson
messages: + msg68343
2008-06-17 20:55:41mark.dickinsonsetmessages: + msg68341
2008-06-17 16:58:41mark.dickinsonsetfiles: + math_64.patch
keywords: + patch
messages: + msg68331
nosy: + mark.dickinson
2008-06-16 02:39:26benjamin.petersoncreate