GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `test.test_math.MathTests.testAtan2` failure on OpenIndiana/Solaris · Issue #138573 · python/cpython

test.test_math.MathTests.testAtan2 failure on OpenIndiana/Solaris #138573

New issue
Copy link
New issue
Copy link
Closed
Closed
test.test_math.MathTests.testAtan2 failure on OpenIndiana/Solaris#138573
Copy link
Labels
OS-unsupportedextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@mtelka
mtelka
opened on Sep 6, 2025
Issue body actions

I do see the following failure with Python-3.14.0rc2 on OpenIndiana. This is a regression from Python-3.13.7.

======================================================================
ERROR: testAtan2 (test.test_math.MathTests.testAtan2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/builds/ul-workspace/components/python/python-314/Python-3.14.0rc2/Lib/test/test_math.py", line 339, in testAtan2
    self.ftest('atan2(0., -0.)', math.atan2(0., -0.), math.pi)
                                 ~~~~~~~~~~^^^^^^^^^
ValueError: math domain error

----------------------------------------------------------------------

Linked PRs

  • gh-138573: restrict testAtan2() the IEC 60559-compatible platforms #138812
  • gh-138573: filter out failing math tests on Solaris #146402
  • [3.14] gh-138573: Filter out failing math tests on Solaris (GH-146402) #146438

Activity

Next
  1. StanFromIreland
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    OS-unsupported
    on Sep 6, 2025
  2. github-project-automation
    added this to Unsupported platformson Sep 6, 2025
  3. StanFromIreland
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Sep 6, 2025
  4. StanFromIreland commented on Sep 6, 2025

    @StanFromIreland
    StanFromIreland
    on Sep 6, 2025
    Member
    More actions

    Also occurs on our Solaris buildbot.

    I actually talked about this with @kulikjak, and this is an issue on their side. So there isn't anything for us to do.

  5. StanFromIreland
    changed the title [-]`test.test_math.MathTests.testAtan2` failure on OpenIndiana[/-] [+]`test.test_math.MathTests.testAtan2` failure on OpenIndiana/Solaris[/+] on Sep 6, 2025
  6. terryjreedy commented on Sep 6, 2025

    @terryjreedy
    terryjreedy
    on Sep 6, 2025
    Member
    More actions

    Does that mean we should close this?

  7. skirpichev commented on Sep 6, 2025

    @skirpichev
    skirpichev
    on Sep 6, 2025
    Member
    More actions

    math.atan2 is essentially a thin wrapper over libm's atan2:

    cpython/Modules/mathmodule.c

    Lines 1100 to 1103 in 8554c09

    FUNC2(atan2, atan2,
    "atan2($module, y, x, /)\n--\n\n"
    "Return the arc tangent (measured in radians) of y/x.\n\n"
    "Unlike atan(y/x), the signs of both x and y are considered.")

    cpython/Modules/mathmodule.c

    Lines 1014 to 1047 in 8554c09

    static PyObject *
    math_2(PyObject *const *args, Py_ssize_t nargs,
    double (*func) (double, double), const char *funcname)
    {
    double x, y, r;
    if (!_PyArg_CheckPositional(funcname, nargs, 2, 2))
    return NULL;
    x = PyFloat_AsDouble(args[0]);
    if (x == -1.0 && PyErr_Occurred()) {
    return NULL;
    }
    y = PyFloat_AsDouble(args[1]);
    if (y == -1.0 && PyErr_Occurred()) {
    return NULL;
    }
    errno = 0;
    r = (*func)(x, y);
    if (isnan(r)) {
    if (!isnan(x) && !isnan(y))
    errno = EDOM;
    else
    errno = 0;
    }
    else if (isinf(r)) {
    if (isfinite(x) && isfinite(y))
    errno = ERANGE;
    else
    errno = 0;
    }
    if (errno && is_error(r, 1))
    return NULL;
    else
    return PyFloat_FromDouble(r);
    }

    I don't think something was changed here since v3.13 other than using libm's isinf/isnan macro directly.

    It looks like in the given case platform's atan2 returns a nan. @mtelka, could you verify this?

    Correct answer is pi, see https://en.cppreference.com/w/c/numeric/math/atan2.html (Assuming IEEE 754-compatible behavior.) @mtelka, did you test on same version of the OS? This looks as a regression for me, but not in the CPython.

    Edit: I assume, that we won't add a workaround for unsupported broken platform. Or?

  8. skirpichev
    added
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Sep 6, 2025
  9. StanFromIreland commented on Sep 6, 2025

    @StanFromIreland
    StanFromIreland
    on Sep 6, 2025
    Member
    More actions

    math.atan2 is essentially a thin wrapper over libm's atan2:

    Yes, as I said, this is an issue in their library, which they hope to fix soon.

  10. skirpichev
    closed this as not plannedon Sep 6, 2025
  11. github-project-automation
    moved this to Done in Unsupported platformson Sep 6, 2025
  12. skirpichev commented on Sep 6, 2025

    @skirpichev
    skirpichev
    on Sep 6, 2025
    Member
    More actions

    Ok, let's close. I don't think workaround is needed.

  13. skirpichev
    removed
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Sep 6, 2025
  14. mtelka commented on Sep 6, 2025

    @mtelka
    mtelka
    on Sep 6, 2025
    ContributorAuthor
    More actions

    I tested this simple C:

    #include <math.h>
    #include <stdio.h>
    
    int main(void)
    {
            printf("%f\n", atan2(0., -0.));
            return 0;
    }
    

    and here is the result:

    $ gcc -Wall -o test test.c 
    $ ./test 
    3.141593
    $
    

    How can I prove the issue is with the platform?

  15. 32 remaining items

  16. skirpichev
    added a commit that references this issue on Mar 25, 2026

    pythongh-138573: filter out failing math tests on Solaris

    210688d
  17. skirpichev commented on Mar 25, 2026

    @skirpichev
    skirpichev
    on Mar 25, 2026
    Member
    More actions

    @mtelka, see #146402.

  18. skirpichev
    removed their assignment
    on Mar 25, 2026
  19. vstinner commented on Mar 25, 2026

    @vstinner
    vstinner
    on Mar 25, 2026
    Member
    More actions

    (I found mentions of this behavior on our bug tracker from 1988)

    Wow, this is an old bug! 😄

    For completeness, here is list of failed tests on OpenIndiana with Python 3.13.7:

    6 tests failed:
    test.test_asyncio.test_ssl test_cext test_cppext test_embed
    test_shutil test_socket

    I'm interested by test_cext and test_cppext failures, but also by test_embed failure. Would you mind to open an issue for test_cext+test_cppext and another one for test_embed?

  20. vstinner
    added a commit that references this issue on Mar 25, 2026

    gh-138573: Filter out failing math tests on Solaris (#146402)

    8e1469c
  21. miss-islington
    added a commit that references this issue on Mar 25, 2026

    pythongh-138573: Filter out failing math tests on Solaris (pythonGH-1…

    466ff99
  22. vstinner commented on Mar 25, 2026

    @vstinner
    vstinner
    on Mar 25, 2026
    Member
    More actions

    The two failing tests are now skipped on Solaris: 8e1469c. The change will be backported to 3.14 once the CI pass on the PR.

    Thanks for your bug report @mtelka.

  23. vstinner
    closed this as completedon Mar 25, 2026
  24. vstinner commented on Mar 25, 2026

    @vstinner
    vstinner
    on Mar 25, 2026
    Member
    More actions

    Okay, it looks like the issue is really with the platform, so I reported the bug at https://www.illumos.org/issues/17602.

    Oh, this issue has been fixed by the change illumos/illumos-gate@2eba8eb in the meanwhile, nice!

    We do have only one libm implementation, so yes.

    What is lib_version != libm_ieee test in the implementation? It's possible to select a "lib_version" to get different behaviors?

  25. vstinner
    added a commit that references this issue on Mar 26, 2026

    [3.14] gh-138573: Filter out failing math tests on Solaris (GH-146402) (

    7efa72a
  26. mtelka commented on Mar 26, 2026

    @mtelka
    mtelka
    on Mar 26, 2026
    ContributorAuthor
    More actions

    We do have only one libm implementation, so yes.

    What is lib_version != libm_ieee test in the implementation? It's possible to select a "lib_version" to get different behaviors?

    I do not think so. However, there was a discussion about this line during the code review. You can find it here: https://code.illumos.org/c/illumos-gate/+/4476

  27. mtelka commented on Mar 26, 2026

    @mtelka
    mtelka
    on Mar 26, 2026
    ContributorAuthor
    More actions

    I'm interested by test_cext and test_cppext failures, but also by test_embed failure. Would you mind to open an issue for test_cext+test_cppext and another one for test_embed?

    These tests pass with Python 3.14.3.

    Reacted by Victor Stinner
  28. kulikjak commented on Mar 31, 2026

    @kulikjak
    kulikjak
    on Mar 31, 2026
    Contributor
    More actions

    Thank you for the merge. We still didn't fix (or change) the atan2 behavior, so the skip at least helps us.

  29. clin1234
    added a commit that references this issue on Apr 16, 2026

    pythongh-138573: Filter out failing math tests on Solaris (python#146402

    3989081
  30. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-138573: Filter out failing math tests on Solaris (python#146402

    7cd988b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-unsupportedextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Unsupported platforms
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.