AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
python tests fail because failed GIL interaction
- Lingua principale
- C++
- Stelle
- 2.1k
- Fork
- 503
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Tested with 2.3.0 and 2.3.1 on gentoo using python-3.11 and python-3.12.
Running `ctest -R test_python` fails with:
```
test_apply (CPUProcessorTest.CPUProcessorTest.test_apply) ... pybind11::handle::inc_ref() is being called while the GIL is either not held or invalid. Please see https://pybind11.readthedocs.io/en/stable/advanced/misc.html#common-sources-of-global-interpreter-lock-errors for debugging advice.
If you are convinced there is no bug in your code, you can #define PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREFto disable this check. In that case you have to ensure this #define is consistently used for all translation units linked into a given pybind11 extension, otherwise there will be ODR violations.The failing pybind11::handle::inc_ref() call was triggered on a numpy.ndarray object.
ERROR
test_apply_src_dst (CPUProcessorTest.CPUProcessorTest.test_apply_src_dst) ... pybind11::handle::inc_ref() is being called while the GIL is either not held or invalid. Please see https://pybind11.readthedocs.io/en/stable/advanced/misc.html#common-sources-of-global-interpreter-lock-errors for debugging advice.
If you are convinced there is no bug in your code, you can #define PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREFto disable this check. In that case you have to ensure this #define is consistently used for all translation units linked into a given pybind11 extension, otherwise there will be ODR violations.The failing pybind11::handle::inc_ref() call was triggered on a numpy.ndarray object.
ERROR
```
```
======================================================================
ERROR: test_apply (CPUProcessorTest.CPUProcessorTest.test_apply)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/paludis/media-libs-opencolorio-2.3.1/work/OpenColorIO-2.3.1/tests/python/CPUProcessorTest.py", line 302, in test_apply
image = OCIO.PackedImageDesc(arr, 7, 3, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: pybind11::handle::inc_ref() PyGILState_Check() failure.
======================================================================
ERROR: test_apply_src_dst (CPUProcessorTest.CPUProcessorTest.test_apply_src_dst)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/paludis/media-libs-opencolorio-2.3.1/work/OpenColorIO-2.3.1/tests/python/CPUProcessorTest.py", line 331, in test_apply_src_dst
src_image = OCIO.PackedImageDesc(src_arr, 7, 3, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: pybind11::handle::inc_ref() PyGILState_Check() failure.
----------------------------------------------------------------------
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Esegui `ctest -R test_python` con Python 3.11 o 3.12 e analizza i test falliti in `tests/python/CPUProcessorTest.py`, in particolare `test_apply` e `test_apply_src_dst`. Traccia le chiamate a `PackedImageDesc` e l’errore GIL di pybind11 segnalato; il lavoro è completato quando i test interessati passano senza l’errore `PyGILState_Check()`.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, python
- Ambito
- testing
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100