pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.39k stars 2.07k forks source link

Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy #4751

Closed rwgk closed 1 year ago

rwgk commented 1 year ago

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.
SimonHeybrock commented 1 month ago

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

rwgk commented 1 month ago

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).