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 — CI: intermittent hard crash of `cython` while building the limited API test extensions on Windows · Issue #32473 · numpy/numpy

CI: intermittent hard crash of cython while building the limited API test extensions on Windows #32473

New issue
Copy link
New issue
Copy link
Open
Open
CI: intermittent hard crash of cython while building the limited API test extensions on Windows#32473
Copy link
Labels
05 - Testingcomponent: CI

Description

@ngoldbaum
ngoldbaum
opened on Sep 1, 2026
Issue body actions

Describe the issue

Since 2026-09-01, Windows CI jobs intermittently fail in the test_limited_api.py fixture. meson compile -vv fails because one of the ~35 parallel cython processes spawned by ninja dies with exit code 3221356611 and no stderr:

[29/175] "cython" "-M" "--fast-fail" "-3" "-I" "...\site-packages\\" "--module-name" "limited_api_cython_3_13_npy2_0" .../limited_api_cython.pyx -o limited_api_cython_3_13_npy2_0.pyd.p/limited_api_cython.pyx.c
FAILED: [code=3221356611] limited_api_cython_3_13_npy2_0.pyd.p/limited_api_cython.pyx.c
ninja: build stopped: subcommand failed.

3221356611 is 0xC0020043 = RPC_NT_INTERNAL_ERROR. That is an OS-level process crash, not a Cython error. Which module variant dies varies from run to run, and reruns usually pass.

Examples

  • MAINT: exit deadlock tests quickly on slow hardware #32466, "MSVC, x86_64, full, openblas64": https://github.com/numpy/numpy/actions/runs/33556667385/job/100019056682
  • BUG/ENH: fix casting and setitem nan behavior between StringDType and float16/32 #31825, cp313-win_amd64 wheel build test (-n auto): https://github.com/numpy/numpy/actions/runs/33556177629/job/100017437304

Steps to reproduce

I tried to reproduce this on my Windows 11 PC using the same dependencies as the failing jobs, but didn't see any problems. I've only seen this happen on github runners. It may be a problem with the runners themselves.

Activity

  1. ngoldbaum
    added
    component: CI
    05 - Testing
    on Sep 1, 2026
  2. rgommers commented on Sep 3, 2026

    @rgommers
    rgommers
    on Sep 3, 2026
    Member
    More actions

    Looks like a process dying when the OS runs out of memory. Windows is worst case for this test I think. Limiting to -j4 should help.

  3. kumaraditya303 commented on Sep 3, 2026

    @kumaraditya303
    kumaraditya303
    on Sep 3, 2026
    Contributor
    More actions

    I am wondering if the real problem is that with xdist each worker ends up running its own meson compile, and each of those spawns ninja with the default n+2 jobs, so on a 4 core runner -n auto gives 24 jobs in total so the OS runs out of memory.

  4. rgommers commented on Sep 3, 2026

    @rgommers
    rgommers
    on Sep 3, 2026
    Member
    More actions

    It shouldn't, since it's a single (parametrized) test - that should be landing in a single process.

    Re job count: unfortunately ninja uses n_vcpu + 2 and n_vcpu may be 2*n_physical on x86-64 with hyper-threading. It's a bad default, and I'm not sure what happens on GitHub runners, but it's possible on a regular CPU to get 10 jobs scheduled on a 4-core CPU. Which ends badly on lower-end laptops with 8 GB RAM.

  5. rgommers commented on Sep 3, 2026

    @rgommers
    rgommers
    on Sep 3, 2026
    Member
    More actions

    Also IIRC the compilation fixture is module-scoped, and reused - so it should be a pytest/pytest-xdist bug if it's built more than once.

  6. kumaraditya303 commented on Sep 3, 2026

    @kumaraditya303
    kumaraditya303
    on Sep 3, 2026
    Contributor
    More actions

    I tried adding prints to install_temp fixture to check how many times it gets called and with n=2 I see two different calls.

    diff --git a/numpy/_core/tests/test_limited_api.py b/numpy/_core/tests/test_limited_api.py
    index 94b1175fc6..4cedf6fe87 100644
    --- a/numpy/_core/tests/test_limited_api.py
    +++ b/numpy/_core/tests/test_limited_api.py
    @@ -44,6 +44,7 @@ def install_temp(tmpdir_factory):
         # the comment above _PY_ABI3_VERSIONS below.
         if not HAS_SUBPROCESSES:
             pytest.skip("No subprocess")
    +    print(f"Running meson build in {tmpdir_factory.getbasetemp()}")
     
         # Build against a copy of the sources placed next to the build dir:
         # meson refers to sources via paths relative to the build dir, and on
    
    bringing up nodes...
    bringing up nodes...
    
    .....................................................................s.  [100%]
    ==================================== PASSES ====================================
    ________________ test_limited_api_abi3[limited_api_3_9_npy2_0] _________________
    [gw0] darwin -- Python 3.14.7 /Users/kumaraditya/.cache/uv/builds-v0/.tmpD2lBTm/bin/python
    ---------------------------- Captured stdout setup -----------------------------
    Running meson build in /private/tmp/claude-501/-Users-kumaraditya-work-numpy/b9edb500-28bc-472a-9b1b-7d120ef2a335/scratchpad/pt/popen-gw0
    1.12.0
    ________________ test_limited_api_abi3[limited_api_3_10_npy2_1] ________________
    [gw1] darwin -- Python 3.14.7 /Users/kumaraditya/.cache/uv/builds-v0/.tmpD2lBTm/bin/python
    ---------------------------- Captured stdout setup -----------------------------
    Running meson build in /private/tmp/claude-501/-Users-kumaraditya-work-numpy/b9edb500-28bc-472a-9b1b-7d120ef2a335/scratchpad/pt/popen-gw1
    1.12.0
  7. LeonxLJX commented on Sep 4, 2026

    @LeonxLJX
    LeonxLJX
    on Sep 4, 2026 · Hidden as low-quality
    show commentMore actions
  8. rgommers commented on Sep 4, 2026

    @rgommers
    rgommers
    on Sep 4, 2026
    Member
    More actions

    You're right @kumaraditya303 - I looked into it a bit more, and it's a documented limitation of pytest-xdist.

    I had an LLM take a closer look, and the suggestions were about pytest-xdist grouping so tests get scheduled in the same process:

    pytestmark = [
        pytest.mark.skipif(cython is None, reason="requires cython"),
        pytest.mark.xdist_group("limited_api_build"),
    ]
    
    # Then execute tests with: `pytest -n auto --dist=loadgroup`

    I don't like that much though, because it's yet more abstraction, and because the extra --dist=loadgroup will not be enforced so users can still run into this.

    The better fix is to just not parametrize the test, but make it a single test, something like:

    def test_limited_api(tmp_path):
        install_dir = build_limited_api_extensions(tmp_path)
    
        for version in versions:
            for module_name in module_names:
                module = import_extension(install_dir, version, module_name)
                check_limited_api(module)

    The test parametrization isn't relevant here - it's a single test over a set of 35 extension modules, and none should fail anyway or there's a real problem - and the one minor benefit of parametrize (identifying the versions that are failing) usually won't apply. We saw that in the last failure: it depends on Cython version, so all 35 tests failed at once.

  9. rgommers commented on Sep 4, 2026

    @rgommers
    rgommers
    on Sep 4, 2026
    Member
    More actions

    @LeonxLJX stop posting direct output of an LLM. This is against our AI policy. Do not do that on any open source project, or you'll get banned.

  10. kumaraditya303 commented on Sep 4, 2026

    @kumaraditya303
    kumaraditya303
    on Sep 4, 2026
    Contributor
    More actions

    I created #32501 to combine all test into one so that meson is run once.

    Reacted by Ralf Gommers
  11. ngoldbaum commented on Sep 4, 2026

    @ngoldbaum
    ngoldbaum
    on Sep 4, 2026
    MemberAuthor
    More actions

    #32501 should have fixed this so I'm closing. I'll re-open it if I notice weird crashes along the lines of the issue description in the future.

  12. ngoldbaum
    closed this as completedon Sep 4, 2026
  13. ngoldbaum commented on Nov 3, 2026

    @ngoldbaum
    ngoldbaum
    on Nov 3, 2026
    MemberAuthor
    More actions

    Here it is happening again: https://github.com/numpy/numpy/actions/runs/41615378521/job/125847413750?pr=32269

    Image
  14. ngoldbaum
    reopened this on Nov 3, 2026
  15. kumaraditya303 commented on Nov 3, 2026

    @kumaraditya303
    kumaraditya303
    on Nov 3, 2026
    Contributor
    More actions

    I think it is related to python/cpython#159118, _wmi is used by cython when querying about platform (found by Claude).

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

    05 - Testingcomponent: CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — 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.