`_PyType_Lookup: Assertion `!PyErr_Occurred()' failed.` in two `mypyc/test/test_run.py` tests
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Crash Report
When running the mypy test suite while CPython is built --with-assertions, the two following tests fail due to crashes inside the tests.
Traceback
============================================================== FAILURES ===============================================================
__________________________________________________ testI64GlueMethodsAndInheritance ___________________________________________________
[gw4] linux -- Python 3.11.5 /tmp/mypy/.tox/py311/bin/python
data: /tmp/mypy/mypyc/test-data/run-i64.test:1340:
Failed: Invalid output (/tmp/mypy/mypyc/test-data/run-i64.test, line 1340)
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------
*** Exit status: -6
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Expected:
Actual:
python: Objects/typeobject.c:3823: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed. (diff)
---------------------------------------------------------- Captured log call ----------------------------------------------------------
INFO root:dist.py:985 running build_ext
INFO root:build_ext.py:521 building 'native' extension
INFO root:dir_util.py:71 creating build/temp.linux-x86_64-cpython-311
INFO root:dir_util.py:71 creating build/temp.linux-x86_64-cpython-311/build
INFO root:spawn.py:38 x86_64-pc-linux-gnu-gcc -Wsign-compare -fPIC -I/tmp/mypy/mypyc/lib-rt -I/tmp/mypy/.tox/py311/include -I/usr/include/python3.11 -c build/__native.c -o build/temp.linux-x86_64-cpython-311/build/__native.o -O0 -g1 -Werror -Wno-unused-function -Wno-unused-label -Wno-unreachable-code -Wno-unused-variable -Wno-unused-command-line-argument -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-ignored-optimization-argument -Wno-cpp
INFO root:dir_util.py:71 creating build/lib.linux-x86_64-cpython-311
INFO root:spawn.py:38 x86_64-pc-linux-gnu-gcc -shared build/temp.linux-x86_64-cpython-311/build/__native.o -L/usr/lib64 -o build/lib.linux-x86_64-cpython-311/native.cpython-311-x86_64-linux-gnu.so
INFO root:file_util.py:137 copying build/lib.linux-x86_64-cpython-311/native.cpython-311-x86_64-linux-gnu.so ->
____________________________________________________________ testFloatOps _____________________________________________________________
[gw4] linux -- Python 3.11.5 /tmp/mypy/.tox/py311/bin/python
data: /tmp/mypy/mypyc/test-data/run-floats.test:3:
Failed: Invalid output (/tmp/mypy/mypyc/test-data/run-floats.test, line 3)
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------
*** Exit status: -6
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Expected:
Actual:
python: Objects/typeobject.c:3823: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed. (diff)
---------------------------------------------------------- Captured log call ----------------------------------------------------------
INFO root:dist.py:985 running build_ext
INFO root:build_ext.py:521 building 'native' extension
INFO root:dir_util.py:71 creating build/temp.linux-x86_64-cpython-311
INFO root:dir_util.py:71 creating build/temp.linux-x86_64-cpython-311/build
INFO root:spawn.py:38 x86_64-pc-linux-gnu-gcc -Wsign-compare -fPIC -I/tmp/mypy/mypyc/lib-rt -I/tmp/mypy/.tox/py311/include -I/usr/include/python3.11 -c build/__native.c -o build/temp.linux-x86_64-cpython-311/build/__native.o -O0 -g1 -Werror -Wno-unused-function -Wno-unused-label -Wno-unreachable-code -Wno-unused-variable -Wno-unused-command-line-argument -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-ignored-optimization-argument -Wno-cpp
INFO root:dir_util.py:71 creating build/lib.linux-x86_64-cpython-311
INFO root:spawn.py:38 x86_64-pc-linux-gnu-gcc -shared build/temp.linux-x86_64-cpython-311/build/__native.o -L/usr/lib64 -o build/lib.linux-x86_64-cpython-311/native.cpython-311-x86_64-linux-gnu.so
INFO root:file_util.py:137 copying build/lib.linux-x86_64-cpython-311/native.cpython-311-x86_64-linux-gnu.so ->
======================================================= short test summary info =======================================================
FAILED mypyc/test/test_run.py::TestRun::run-i64.test::testI64GlueMethodsAndInheritance
FAILED mypyc/test/test_run.py::TestRun::run-floats.test::testFloatOps
======================================== 2 failed, 376 passed, 2 xfailed in 164.00s (0:02:44) =========================================
To Reproduce
Build CPython with --with-assertions. Then run the test suite, e.g. via tox:
tox -e py311 -- mypyc/test/test_run.py
Your Environment
- Mypy version used: 1.5.1; also reproduced with 4496a005a84f7daedc1ef2e801583127f5995f75
- Python version used: 3.11.5; also reproduced with 3.10.13 and 3.12.0rc1
- Operating system and version: Gentoo Linux amd64
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit mypyc/test/test_run.py und den fehlschlagenden Fällen in mypyc/test-data/run-i64.test und run-floats.test. Reproduziere den Fehler mit CPython, das mit --with-assertions erstellt wurde, indem du tox -e py311 -- mypyc/test/test_run.py ausführst, und verfolge anschließend die an den Abstürzen beteiligte generierte native Erweiterung. Die Aufgabe ist abgeschlossen, wenn beide Tests ohne den _PyType_Lookup-Assertion-Fehler bestehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, python
- Bereich
- compilers, testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100