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

Disable PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF generally for PyPy #4751

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Jul 15, 2023

Description

This is to resolve #4748.

Note that we have this since Apr 2021:

That suggests generally PyGILState_Check() is working as intended with PyPy, but maybe PyPy's teardown it not GIL clean?

Answering this is left for another day.

Suggested changelog entry:

``PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF`` was disabled for PyPy in general (not just PyPy Windows). This is to resolve #4748.

@rwgk rwgk marked this pull request as ready for review July 15, 2023 19:40
@rwgk rwgk requested a review from EthanSteinberg July 15, 2023 19:40
@rwgk rwgk merged commit ec1b57c into pybind:master Jul 15, 2023
80 checks passed
@rwgk rwgk deleted the pypy_disable_inc_ref_dec_ref_gil_check branch July 15, 2023 19:55
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Jul 15, 2023
rwgk pushed a commit to rwgk/pybind11 that referenced this pull request Jul 15, 2023
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Jul 17, 2023
rwgk pushed a commit that referenced this pull request Jul 17, 2023
* Update README.rst - Add missing comma in the list of acknowlegements (#4750)

* Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751)

* Update changelog

* Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753)

* Remove GIL checks

* Update common.h

* Add flag

* style: pre-commit fixes

* Update pytypes.h

* style: pre-commit fixes

* Update common.h

* style: pre-commit fixes

* Update pytypes.h

* style: pre-commit fixes

* Update common.h

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update changelog: PR #4753

---------

Co-authored-by: bzaar <[email protected]>
Co-authored-by: Ethan Steinberg <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@SimonHeybrock
Copy link

Just like another commenter in #4748 we are seeing similar problems for cpython, not PyPy:

  • Pybind11 2.13.1
  • Python 3.10
  • Debug build (release builds work).

@rwgk
Copy link
Collaborator Author

rwgk commented Jul 18, 2024

You are not providing any information how to reproduce what you apparently see as a pybind11 problem:

I have to assume you're most likely detecting a bug in client code, exactly what #4246 is meant to do. — Note that the PyGILState_Check() in py::handle inc_ref() & dec_ref() is activated only in debug builds, by design.

Please provide a reproducer if you believe that there is a problem in pybind11 (and not in client code).

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