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

[ENH] Fix test failures and crashes in the nogil python build. #6154

Open
ngoldbaum opened this issue Apr 22, 2024 · 4 comments
Open

[ENH] Fix test failures and crashes in the nogil python build. #6154

ngoldbaum opened this issue Apr 22, 2024 · 4 comments
Milestone

Comments

@ngoldbaum
Copy link
Contributor

ngoldbaum commented Apr 22, 2024

Describe your issue

I currently see seg faults in sequential_parallel, cpp_exceptions, and intermittently in cpp_smart_ptr.test_unique_ptr. After disabling those tests by running the test runner like this:

CFLAGS="-O0" python runtests.py -vv -x sequential_parallel -x cpp_exceptions -x cpp_smart_ptr

and after applying the changes in #6152 and #6153, I see the following addiitonal errors and failures in the tests: https://gist.github.com/ngoldbaum/495a699953e60bc95a776498de05604c

Some of this may just be python 3.13-related and have nothing to do with the nogil build.

@ngoldbaum ngoldbaum changed the title [ENH] Fix test failures in the nogil python build. [ENH] Fix test failures and crashes in the nogil python build. Apr 22, 2024
@matusvalo matusvalo added this to the 3.1 milestone Apr 23, 2024
@ngoldbaum
Copy link
Contributor Author

ngoldbaum commented Apr 23, 2024

I ran the tests in a normal 3.13-dev build with the GIL enabled and on 3.12.2, both on the same ARM mac I ran the free-threaded tests on above.

It seems the test_cpp_exceptions seg fault happens on 3.13-dev regardless of whether the GIL is enabled.

cpp_smart_ptr fails to compile on 3.12, but does compile on 3.13-dev and seg faults regardless of the GIL settings.

cpp_nonstdint fails in the same way on 3.13-dev with the GIL enabled.

All the other C++ tests fail in the same way on all three python versions.

Of the remaining tests, the following are nogil specific:

  • sequential_parallel segfault
  • double_dealloc_T796 failure
  • isolated_limited_api_tests error

And the following happen on 3.13-dev regardless of the build settings:

  • time_pxd error
  • test_find_etc_raise_correct_error_messages failure

@ngoldbaum
Copy link
Contributor Author

double_dealloc_T796 is failing because in the nogil build code objects in the REPL participate in garbage collection, so gc.collect() run in a REPL will always return at least 1. We can probably just disable that test like in pypy or maybe add some conditional logic to the test, everything else works otherwise.

isolated_limited_api_tests fails because the limited API is not supported in the nogil build yet.

So it looks like the only functional issue left is in the sequential_parallel tests.

@da-woods
Copy link
Contributor

The c++ failures just look like the compiler isn't running with an up-to-date c++ standard. I don't know why that'd be (probably just a clang-specific flag we're missing) but it doesn't look interesting or relevant to the nogil build.

@ngoldbaum
Copy link
Contributor Author

ngoldbaum commented Apr 23, 2024

It looks like setting CYTHON_AVOID_BORROWED_REFS fixes the sequential_parallel segfault (woohoo!) but I ran into another issue turning on that option: #6155 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants