homepage

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: testTanh() of test_math fails on "NetBSD 5 i386 3.x"
Type: Stage:
Components: Library (Lib) Versions: Python 3.1, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gregory.p.smith, mark.dickinson, vstinner
Priority: normal Keywords: patch

Created on 2010年11月06日 11:03 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
skip_tanh_sign.patch vstinner, 2010年11月07日 14:00
skip_tanh_sign-2.patch vstinner, 2010年11月07日 14:11
Messages (9)
msg120604 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010年11月06日 11:03
On "NetBSD 5 i386 3.x" buildbot, testTanh() of test_math fails because the sign of wrong.
configure scripts has a test to check if tanh(-0.0) keeps the sign or no, and on this buildbot the result is "no". pyconfig.h contains a TANH_PRESERVES_ZERO_SIGN define, but it is not used in Modules/mathmodule.c. Extract of configure comment:
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
# -0. on some architectures.
---
http://www.python.org/dev/buildbot/builders/NetBSD%205%20i386%203.x/builds/237/steps/configure/logs/stdio
...
checking whether tanh preserves the sign of zero... no
...
http://www.python.org/dev/buildbot/builders/NetBSD%205%20i386%203.x/builds/237/steps/test/logs/stdio
======================================================================
FAIL: testTanh (test.test_math.MathTests)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/home/buildbot/buildarea/3.x.smith-netbsd-i386/build/Lib/test/test_math.py", line 898, in testTanh
 math.copysign(1., -0.))
AssertionError: 1.0 != -1.0
----------------------------------------------------------------------
msg120605 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010年11月06日 11:05
test_cmath does also fail:
http://www.python.org/dev/buildbot/builders/NetBSD%205%20i386%203.x/builds/237/steps/test/logs/stdio
======================================================================
FAIL: test_specific_values (test.test_cmath.CMathTests)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/home/buildbot/buildarea/3.x.smith-netbsd-i386/build/Lib/test/test_cmath.py", line 348, in test_specific_values
 msg=error_message)
 File "/home/buildbot/buildarea/3.x.smith-netbsd-i386/build/Lib/test/test_cmath.py", line 94, in rAssertAlmostEqual
 'got {!r}'.format(a, b))
AssertionError: tanh0002: tanh(complex(-0.0, 0.0))
Expected: complex(-0.0, 0.0)
Received: complex(0.0, 0.0)
Received value insufficiently close to expected value.
----------------------------------------------------------------------
msg120669 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010年11月07日 11:07
I'm not sure what can reasonably be done about these failures. The Python test is failing because of a deficiency in the system math library.
Adding extra code to Python to handle this (making use of TANH_PRESERVES_ZERO_SIGN) is an option, but it seems like overkill to me.
I definitely don't want to remove these tests---they're valuable. If there's a way of marking the test as an expected failure on NetBSD 5 then that would be fine, I guess.
We should also report the problem upstream.
msg120679 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010年11月07日 14:00
Here is a patch skipping math and cmath tests if TANH_PRESERVES_ZERO_SIGN is 0.
msg120680 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010年11月07日 14:15
Commited to Python 3.2 (r86299) after a review of Mark Dickson on IRC. Thanks Mark ;-)
msg120682 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010年11月07日 14:18
Nice fix! Thanks.
msg120683 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010年11月07日 14:20
P.S. Greg, as the owner of the buildbot, do you feel like reporting this upstream? I get the impression that it's easier to do the reporting directly from the NetBSD machine in question...
msg120685 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010年11月07日 14:29
> P.S. Greg, as the owner of the buildbot, do you feel like reporting this
> upstream? I get the impression that it's easier to do the reporting
> directly from the NetBSD machine in question...
I already reported the bug upstream: "Thank you for your problem report. You 
should receive confirmation of your problem report and an internal 
identification number by electronic mail in less than 24 hours."
msg120688 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010年11月07日 14:38
NetBSD bug report: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44057 
History
Date User Action Args
2022年04月11日 14:57:08adminsetgithub: 54546
2010年11月07日 14:38:51vstinnersetmessages: + msg120688
2010年11月07日 14:29:01vstinnersetmessages: + msg120685
2010年11月07日 14:20:36mark.dickinsonsetmessages: + msg120683
2010年11月07日 14:18:32mark.dickinsonsetmessages: + msg120682
2010年11月07日 14:15:39vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg120680
2010年11月07日 14:11:19vstinnersetfiles: + skip_tanh_sign-2.patch
2010年11月07日 14:00:53vstinnersetfiles: + skip_tanh_sign.patch
keywords: + patch
messages: + msg120679
2010年11月07日 11:07:49mark.dickinsonsetmessages: + msg120669
2010年11月06日 11:08:03vstinnersetnosy: + gregory.p.smith
2010年11月06日 11:05:06vstinnersetmessages: + msg120605
2010年11月06日 11:04:21vstinnersetnosy: + mark.dickinson
2010年11月06日 11:03:54vstinnercreate

AltStyle によって変換されたページ (->オリジナル) /