Bug 750811
Summary: | python fails self checks on ppc (test_cmath) | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Karsten Hopp <karsten> |
Component: | glibc | Assignee: | Jeff Law <law> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 16 | CC: | dmalcolm, fweimer, ivazqueznet, jakub, jonathansteffan, law, schwab |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | ppc | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-12-31 15:27:51 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 757021 |
Description
Karsten Hopp
2011-11-02 12:39:14 UTC
I accidentally added my notes on this to bug 757021, rather than here, so I'll repeat the information here. Attachment 541076 [details] is a debugging patch to capture the extent of the problem. It hacks up test_cmath so that test_specific_values shows all failing cases (and ultimately "succeeds"), rather than aborting on the first failed case, so that we can see the extent of the problem. Attachment 541077 [details] is the log from running "python -m test.test_cmath" with the patch. Summarizing that log, and comparing against cmath_testcases.txt: * 3 of the 20 tests for "acos() near infinity" fail due to the imaginary component of the result being unexpectedly either "+/-inf" * 4 of the 20 tests for "acosh() near infinity" fail due to the real component of the result being unexpectedly "inf" * 4 of the 20 tests for "asin() near infinity" fail due to the imaginary component of the result being unexpectedly either "+/-inf" * 4 of the 20 tests for "asinh() near infinity" fail due to the real component of the result being unexpectedly either "+/-inf" * 4 of the 20 tests for "atan() near infinity" fail due to the imaginary component of the result being unexpectedly either "+/-0.0" * 4 of the 20 tests for "atanh() near infinity" fail due to the real component of the result being unexpectedly either "+/-0.0" * 4 of the 20 tests for "log() near infinity" fail due to the real component of the result being unexpectedly either "inf" * 4 of the 20 tests for "log10() near infinity" fail due to the real component of the result being unexpectedly either "inf" * both of the 2 tests for "sqrt() with input whose abs value overflows" fail, one expectedly collapsing to (inf, -0.0), the other to (0.0, -inf) This is out of 1885 tests within test_specific_values (__main__.CMathTests) Attachment 541092 [details] is a crude patch to log all calls to "hypot (3)" from Modules/cmathmodule.c Attachment 541093 [details] is a log from running "python -m test.test_cmath" with that patch, and shows the calls to hypot() interleaved with the cmath test cases. Python's "complex" type uses a pair of C "double" values internally (real and imag), which on ppc64 should be standard IEEE754. ppc64's glibc has an optimized implementation of "hypot" (in libm): sysdeps/powerpc/fpu/e_hypot.c All of the failing Python test cases involve a call to hypot(). When examining the results in comment #2, a comparison of calls to hypot with the failing test cases, reveals that all of the failing cases are preceded by a call to hypot that returns "inf". Python's math.hypot() is a thin wrapper around hypot(3); a Python "float" uses a C "double" internally. Attachment 541097 [details] is a Python script to exercise hypot(3). It calls hypot() for all of the x,y pairs that fail within the Python test case on ppc64. On x86_64, with glibc-2.14-5.x86_64 (and python-2.7.1-7.fc15.x86_64), all results are non-infinite, with exponent e+307 or e+308 (see attachment 541102 [details] for the results on this box). On ppc64, with glibc-2.14.90-19.ppc64 (and python-2.7.2-4.2.fc16.ppc64), all results are "inf". Filed in upstream bug tracker for CPython as: http://bugs.python.org/issue13534 Filed in glibc's bug tracker as: http://sourceware.org/bugzilla/show_bug.cgi?id=13472 as there's already a upstream fix available, can you add that to the f16 glibc git branch, please ? It affects only powerpc, so an update on the primary archs won't be necessary, we just need the git commit. I was hoping to start to throttle back the updates now that I'm starting to get a handle on things in glibc-land. There's a small handful that I've got queued for the next update, I'll make sure this one gets added. glibc-2.14.90-24.fc16.4 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/glibc-2.14.90-24.fc16.4 glibc-2.14.90-24.fc16.4 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. |