Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testsuite fails on x86_64 #88891

Open
deep-42-thought mannequin opened this issue Jul 23, 2021 · 7 comments
Open

Testsuite fails on x86_64 #88891

deep-42-thought mannequin opened this issue Jul 23, 2021 · 7 comments
Labels
3.9 only security fixes tests Tests in the Lib/test dir

Comments

@deep-42-thought
Copy link
Mannequin

deep-42-thought mannequin commented Jul 23, 2021

BPO 44728
Nosy @mdickinson, @deep-42-thought
Files
  • build-log.php?a=pentium4&p=python
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-07-23.17:55:01.636>
    labels = ['tests', '3.9']
    title = 'Testsuite fails on x86_64'
    updated_at = <Date 2021-08-20.10:09:23.729>
    user = 'https://github.com/deep-42-thought'

    bugs.python.org fields:

    activity = <Date 2021-08-20.10:09:23.729>
    actor = 'mark.dickinson'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2021-07-23.17:55:01.636>
    creator = 'deep42thought'
    dependencies = []
    files = ['50175']
    hgrepos = []
    issue_num = 44728
    keywords = []
    message_count = 7.0
    messages = ['398084', '398161', '398162', '398167', '399942', '399943', '399952']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'deep42thought']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44728'
    versions = ['Python 3.9']

    @deep-42-thought
    Copy link
    Mannequin Author

    deep-42-thought mannequin commented Jul 23, 2021

    The following tests fails on x86 32 bit:

    test_cmath test_math test_posix test_turtle - looks, like the expected precision is too high.

    Full log is attached.

    @deep-42-thought deep-42-thought mannequin added 3.9 only security fixes tests Tests in the Lib/test dir labels Jul 23, 2021
    @mdickinson
    Copy link
    Member

    Extract from the log - from the configure output:

    checking for expm1... yes

    and from the test output

    expm10118: expm1(27.0): expected 532048240600.79865, got 532048240600.7976 (error = 0.00104 (17 ulps); permitted error = 0 or 5 ulps)
    expm10119: expm1(123.0): expected 2.6195173187490626e+53, got 2.619517318749054e+53 (error = 8.51e+38 (20 ulps); permitted error = 0 or 5 ulps)
    expm10300: expm1(300.0): expected 1.9424263952412558e+130, got 1.942426395241274e+130 (error = 1.82e+116 (74 ulps); permitted error = 0 or 5 ulps)
    expm10301: expm1(700.0): expected 1.0142320547350045e+304, got 1.0142320547349733e+304 (error = 3.12e+290 (256 ulps); permitted error = 0 or 5 ulps)
    expm10307: expm1(709.5): expected 1.3549863193146328e+308, got 1.354986319314675e+308 (error = 4.21e+294 (211 ulps); permitted error = 0 or 5 ulps)

    The first part indicates that your math library does provide expm1, so Python goes ahead and uses it. The errors from test_math show that the expm1 implementation provided by your math library has accuracy problems for large inputs. From the other failures, I suspect that the underlying issue is actually an issue with exp (but our tests for exp are not so thorough as those for expm1).

    In short, the tests represent issues with the underlying C math library. What OS is this, and who supplies the libm?

    @mdickinson
    Copy link
    Member

    The test_posix failure appears to be unrelated; I'll let others look into that one.

    The test_turtle failure looks again like a libm issue, perhaps combined with an overeager test: we're expecting a ** 0.5 operation (which translates to a libm pow call) to give exact results when the square root is exactly representable.

    @mdickinson
    Copy link
    Member

    Looks like the turtle code was changed to use math.hypot instead of ** 0.5 in issue bpo-41528. That will likely also fix the test failure, but I've opened bpo-44734 to fix the unnecessarily strict test.

    @mdickinson
    Copy link
    Member

    Update: test_turtle is fixed (44734); I think test_math and test_cmath should be resolved as either "third party" or "wont fix", since the issue is almost certainly the platform libm.

    That leaves test_posix, which we should probably open a fresh issue for.

    @mdickinson
    Copy link
    Member

    Here's the test_posix failure, extracted from the attachment:

    ======================================================================
    ERROR: test_sched_rr_get_interval (test.test_posix.PosixTester)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/build/python/src/Python-3.9.6/Lib/test/test_posix.py", line 1347, in test_sched_rr_get_interval
        interval = posix.sched_rr_get_interval(0)
    PermissionError: [Errno 1] Operation not permitted

    @mdickinson
    Copy link
    Member

    One more thought on the libm issues - from the logs, it looks as though the libm implementation is coming from a fairly recent version of glibc (glibc 2.33, which was released in February 2021). There were updates to the 'exp' implementation in glibc in 2018[1], but I'm not seeing anything more recent than that. Is it possible that glibc was miscompiled somehow on this platform - e.g., that it's using code designed to work with the x87 FPU with its extended precision, but was compiled with flags that force use of SSE2 instead?

    If not, and if there's a genuine accuracy problem in glibc itself, we should expect to see more Python test_math and test_cmath failures in the future.

    If anyone is able to run test_math or test_cmath on a machine using glibc 2.33 or glibc 2.34 and report results, that would be useful.

    [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=e70c17682518fab2fad164fecf73341443bc2ed3

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant