10000 BUG: crash in `test_stringdtype.py::test_ufunc_multiply` under free-threaded build · Issue #27063 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: crash in test_stringdtype.py::test_ufunc_multiply under free-threaded build #27063

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

Closed
rgommers opened this issue Jul 27, 2024 · 4 comments
Closed
Labels
00 - Bug 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) component: numpy._core

Comments

@rgommers
Copy link
Member

From this CI log, which is from today's wheel build job on main for macOS arm64 (cp313t):

 _______________________ _core/tests/test_stringdtype.py ________________________
  [gw2] darwin -- Python 3.13.0 /private/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/cibw-run-e0nrh73s/cp313t-macosx_arm64/venv-test-arm64/bin/python
  worker 'gw2' crashed while running "_core/tests/test_stringdtype.py::test_ufunc_multiply[float('nan')-False-short-other1-True]"

@ngoldbaum could you please look into this?


Unrelated: one more warning in that CI log about a test which re-enables the GIL:

  random/tests/test_extending.py::test_cython
    <frozen importlib._bootstrap>:488: RuntimeWarning: The global interpreter lock (GIL) has been enabled to load module 'extending', which has not declared that it can run safely without the GIL. To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.
@rgommers rgommers added 00 - Bug component: numpy._core 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) labels Jul 27, 2024
@ngoldbaum
Copy link
Member
ngoldbaum commented Jul 30, 2024

I'm unable to reproduce the crash but have a fix for the other issue and the other warnings I see in the output you didn't call out: #27085

I tried running the tests using numpy.test(extra_argv=['-n=auto']) using both the latest wheel build on scientific-python-nightly-wheels and the latest development version. I also tried repeating the tests many times using --count and pytest-repeat. I also tried just running the failing parameterized test hundreds of times with and without pytest-xdist and didn't see a crash.

I guess we should just watch out for this crash? Maybe I can try to see if I can trigger the crash on the actions runner using tmate?

@ngoldbaum
Copy link
Member

Looking closer at the test output, I see the following slightly fishy error from the worker that died:

[gw2] node down: Traceback (most recent call last):
    File "/private/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/cibw-run-e0nrh73s/cp313t-macosx_arm64/venv-test-arm64/lib/python3.13/site-packages/execnet/gateway_base.py", line 1050, in _local_receive
      data = loads_internal(data, channel, strconfig)
    File "/private/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/cibw-run-e0nrh73s/cp313t-macosx_arm64/venv-test-arm64/lib/python3.13/site-packages/execnet/gateway_base.py", line 1625, in loads_internal
      return Unserializer(io, channelfactory, strconfig).load()
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    File "/private/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/cibw-run-e0nrh73s/cp313t-macosx_arm64/venv-test-arm64/lib/python3.13/site-packages/execnet/gateway_base.py", line 1421, in load
      loader(self)
      ~~~~~~^^^^^^
    File "/private/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/cibw-run-e0nrh73s/cp313t-macosx_arm64/venv-test-arm64/lib/python3.13/site-packages/execnet/gateway_base.py", line 1488, in load_py3string
      self.stack.append(as_bytes.decode("utf-8"))
      ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/hn/5bx1f4_d4ds5vhwhkxc7vdcr0000gn/T/cibw-run-e0nrh73s/cp313t-macosx_arm64/venv-test-arm64/lib/python3.13/site-packages/xdist/dsession.py", line 415, in _handlefailures
      if rep.failed:
         ^^^^^^^^^^
  AttributeError: 'str' object has no attribute 'failed'

It looks like deadsnakes is still installing 3.13b3, which I think is affected by python/cpython#121368, so whenever deadsnakes updates I predict this crash will go away.

@rgommers
Copy link
Member Author

Thanks for looking into it Nathan.

I guess we should just watch out for this crash? Maybe I can try to see if I can trigger the crash on the actions runner using tmate?

No need to do extra work here I'd say if you already made the effort to try and reproduce locally. It will either go away when something in CPython is fixed, or it'll happen again and we'll hopefully learn more.

@ngoldbaum
Copy link
Member

Hasn't recurred AFAIK so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) component: numpy._core
Projects
None yet
Development

No branches or pull requests

2 participants
0