zopefoundation / zope.interface

Interfaces for Python
http://zopeinterface.readthedocs.io/
Other
330 stars 71 forks source link

7.0.1: `Modules/gcmodule.c:113: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small` #316

Closed mgorny closed 2 months ago

mgorny commented 2 months ago

BUG/PROBLEM REPORT / FEATURE REQUEST

What I did:

Build Python --with-assertions, then run the test suite, e.g. via tox -e py312.

What I expect to happen:

Tests passing.

What actually happened:

$ tox -e py312
py312: install_deps> python -I -m pip install 'setuptools<69' Sphinx
.pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel
.pkg: _optional_hooks> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_editable> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_editable> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py312: install_package_deps> python -I -m pip install Sphinx 'coverage>=5.0.3' repoze.sphinx.autointerface setuptools sphinx-rtd-theme zope.event zope.testing
py312: install_package> python -I -m pip install --force-reinstall --no-deps /tmp/zope.interface/.tox/.tmp/package/8/zope.interface-7.0.2.dev0-0.editable-cp312-cp312-linux_x86_64.whl
py312: commands[0]> coverage run -p -m unittest discover -s src
Modules/gcmodule.c:113: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x5638a7bb9f60
object refcount : 3
object type     : 0x7f11cce582c0
object type name: type
object repr     : <class '_zope_interface_coptimizations.ObjectSpecificationDescriptor'>

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x00007f11ccfe5740 (most recent call first):
  Garbage-collecting
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1059 in source_to_code
  File "<frozen importlib._bootstrap_external>", line 1129 in get_code
  File "<frozen importlib._bootstrap_external>", line 991 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/tmp/zope.interface/src/zope/interface/interface.py", line 1172 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/tmp/zope.interface/src/zope/interface/__init__.py", line 53 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3.12/unittest/loader.py", line 339 in _get_module_from_name
  File "/usr/lib/python3.12/unittest/loader.py", line 429 in _find_test_path
  File "/usr/lib/python3.12/unittest/loader.py", line 366 in _find_tests
  File "/usr/lib/python3.12/unittest/loader.py", line 374 in _find_tests
  File "/usr/lib/python3.12/unittest/loader.py", line 310 in discover
  File "/usr/lib/python3.12/unittest/main.py", line 160 in createTests
  File "/usr/lib/python3.12/unittest/main.py", line 253 in _do_discovery
  File "/usr/lib/python3.12/unittest/main.py", line 130 in parseArgs
  File "/usr/lib/python3.12/unittest/main.py", line 104 in __init__
  File "/usr/lib/python3.12/unittest/__main__.py", line 18 in <module>
  File "/tmp/zope.interface/.tox/py312/lib/python3.12/site-packages/coverage/execfile.py", line 211 in run
  File "/tmp/zope.interface/.tox/py312/lib/python3.12/site-packages/coverage/cmdline.py", line 858 in do_run
  File "/tmp/zope.interface/.tox/py312/lib/python3.12/site-packages/coverage/cmdline.py", line 681 in command_line
  File "/tmp/zope.interface/.tox/py312/lib/python3.12/site-packages/coverage/cmdline.py", line 970 in main
  File "/tmp/zope.interface/.tox/py312/bin/coverage", line 8 in <module>

Extension modules: zope.interface._zope_interface_coptimizations (total: 1)
py312: exit -6 (0.67 seconds) /tmp/zope.interface> coverage run -p -m unittest discover -s src pid=386656
  py312: FAIL code -6 (25.92=setup[25.24]+cmd[0.67] seconds)
  evaluation failed :( (26.39 seconds)

What version of Python and Zope/Addons I am using:

Gentoo Linux amd64 Python 3.12.4 Reproduced on 7.0.1 and ff7c8306bc585e6ead1e2087f3a50a2064b01982.