Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
967 stars 140 forks source link

rustworkx crashes immediately on Python 3.13.0b3 #1239

Closed mgorny closed 4 days ago

mgorny commented 6 days ago

Information

What is the current behavior?

The test suite crashes immediately after starting:

$ ~/git/cpython/python -m pytest -s
========================================================= test session starts =========================================================
platform linux -- Python 3.13.0b3+, pytest-8.2.2, pluggy-1.5.0
rootdir: /tmp/rustworkx
configfile: pyproject.toml
plugins: xdist-3.6.1, subtests-0.12.1, asyncio-0.23.7, xprocess-1.0.2, anyio-4.4.0, pkgcore-0.12.27
asyncio: mode=Mode.STRICT
collecting ... python: Objects/unicodeobject.c:15052: intern_static: Assertion `_Py_IsImmortal(s)' failed.
Fatal Python error: Aborted

Current thread 0x00007f35bd341740 (most recent call first):
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1316 in create_module
  File "<frozen importlib._bootstrap>", line 813 in module_from_spec
  File "<frozen importlib._bootstrap>", line 921 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/rustworkx/rustworkx/__init__.py", line 14 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1022 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/rustworkx/tests/digraph/test_adj.py", line 15 in <module>
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/assertion/rewrite.py", line 178 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 "<frozen importlib._bootstrap>", line 1387 in _gcd_import
  File "/home/mgorny/git/cpython/Lib/importlib/__init__.py", line 88 in import_module
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/pathlib.py", line 591 in import_path
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/python.py", line 492 in importtestmodule
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/python.py", line 545 in _getobj
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/python.py", line 287 in obj
  File "/home/mgorny/.local/lib/python3.13/site-packages/pytest_asyncio/plugin.py", line 640 in _patched_collect
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/runner.py", line 389 in collect
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/runner.py", line 341 in from_call
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/runner.py", line 391 in pytest_make_collect_report
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/runner.py", line 567 in collect_one_node
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 837 in _collect_one_node
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 974 in genitems
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 979 in genitems
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 979 in genitems
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 979 in genitems
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 811 in perform_collect
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 349 in pytest_collection
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 338 in _main
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 285 in wrap_session
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/main.py", line 332 in pytest_cmdline_main
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/mgorny/.local/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/config/__init__.py", line 178 in main
  File "/home/mgorny/.local/lib/python3.13/site-packages/_pytest/config/__init__.py", line 206 in console_main
  File "/home/mgorny/.local/lib/python3.13/site-packages/pytest/__main__.py", line 7 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main

Extension modules: psutil._psutil_linux, psutil._psutil_posix (total: 2)
Aborted (core dumped)
Backtrace from gdb ``` #0 0x00007f35bd3d75ac in ?? () from /usr/lib64/libc.so.6 #1 0x00007f35bd380816 in raise () from /usr/lib64/libc.so.6 #2 0x0000556107bfe26c in faulthandler_fatal_error (signum=6) at ./Modules/faulthandler.c:338 #3 #4 0x00007f35bd3d75ac in ?? () from /usr/lib64/libc.so.6 #5 0x00007f35bd380816 in raise () from /usr/lib64/libc.so.6 #6 0x00007f35bd3688fa in abort () from /usr/lib64/libc.so.6 #7 0x00007f35bd36881e in ?? () from /usr/lib64/libc.so.6 #8 0x00007f35bd378cd6 in __assert_fail () from /usr/lib64/libc.so.6 #9 0x0000556107ae7dfe in intern_static (interp=, s=0x556107eaf930 <_PyRuntime+36400>) at Objects/unicodeobject.c:15052 #10 0x0000556107ae7f41 in intern_common (interp=0x556107ebc360 <_PyRuntime+88160>, s=0x556107eaf930 <_PyRuntime+36400>, immortalize=immortalize@entry=false) at Objects/unicodeobject.c:15146 #11 0x0000556107b19d71 in _PyUnicode_InternMortal (interp=, p=p@entry=0x7ffe93436fc8) at Objects/unicodeobject.c:15267 #12 0x0000556107aa43b1 in PyObject_SetAttr (v=0x7f35bab4eca0, name=, value=0x7f35babe3cc0) at Objects/object.c:1330 #13 0x00007f35ba65aa6f in pyo3::types::any::{impl#2}::setattr::inner (any=0x7ffe9343d1d8, attr_name=..., value=...) at src/types/any.rs:1787 #14 0x00007f35ba63949a in pyo3::types::any::{impl#2}::setattr<&pyo3::instance::Bound, &pyo3::instance::Bound> (self=0x7ffe9343d1d8, attr_name=0x7f35baa506a0 , value=0x7ffe934371a0) at src/types/any.rs:1792 #15 0x00007f35ba63be80 in pyo3::types::module::{impl#1}::index (self=0x7ffe9343d1d8) at src/types/module.rs:621 #16 0x00007f35ba669809 in pyo3::types::module::{impl#1}::add::inner (module=0x7ffe9343d1d8, name=..., value=...) at src/types/module.rs:669 #17 0x00007f35ba239d2f in pyo3::types::module::{impl#1}::add<&str, &str> (self=0x7ffe9343d1d8, name=..., value=...) at /home/mgorny/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.21.2/src/types/module.rs:677 #18 0x00007f35ba328e14 in rustworkx::rustworkx (m=0x7ffe9343d1d8) at src/lib.rs:410 #19 0x00007f35ba330e8b in rustworkx::{impl#298}::make_def::__pyo3_pymodule (module=0x7ffe9343d1d8) at src/lib.rs:408 #20 0x00007f35ba6532a9 in pyo3::impl_::pymodule::{impl#1}::make_module::{closure#0} () at src/impl_/pymodule.rs:146 #21 0x00007f35ba6804aa in pyo3::sync::GILOnceCell>::init, pyo3::impl_::pymodule::{impl#1}::make_module::{closure_env#0}, pyo3::err::PyErr> ( self=0x7f35baa501f8 , f=...) at src/sync.rs:157 #22 0x00007f35ba67ff36 in pyo3::sync::GILOnceCell>::get_or_try_init, pyo3::impl_::pymodule::{impl#1}::make_module::{closure_env#0}, pyo3::err::PyErr> ( self=0x7f35baa501f8 , f=...) at src/sync.rs:146 #23 0x00007f35ba65310a in pyo3::impl_::pymodule::ModuleDef::make_module (self=0x7f35baa50188 ) at src/impl_/pymodule.rs:138 #24 0x00007f35b9fae7fe in rustworkx::rustworkx::__pyo3_init::{closure#0} () at src/lib.rs:408 #25 0x00007f35ba1b71e6 in core::ops::function::FnOnce::call_once () at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/ops/function.rs:250 #26 0x00007f35ba3f6bff in pyo3::impl_::trampoline::module_init::{closure#0} () at /home/mgorny/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.21.2/src/impl_/trampoline.rs:23 #27 0x00007f35ba3f6865 in pyo3::impl_::trampoline::trampoline::{closure#0} () at /home/mgorny/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.21.2/src/impl_/trampoline.rs:187 #28 0x00007f35ba15c635 in std::panicking::try::do_call, core::result::Result<*mut pyo3_ffi::object::PyObject, pyo3::err::PyErr>> (data=0x7ffe9343d6e0) at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:559 #29 0x00007f35ba16773b in __rust_try () from /tmp/rustworkx/rustworkx/rustworkx.cpython-313-x86_64-linux-gnu.so #30 0x00007f35ba14aefc in std::panicking::try, pyo3::impl_::trampoline::trampoline::{closure_env#0}> (f=...) at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:523 #31 0x00007f35b9d27986 in std::panic::catch_unwind, core::result::Result<*mut pyo3_ffi::object::PyObject, pyo3::err::PyErr>> ( f=...) at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panic.rs:149 #32 0x00007f35ba3f4de2 in pyo3::impl_::trampoline::trampoline (body=...) at /home/mgorny/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.21.2/src/impl_/trampoline.rs:187 #33 0x00007f35ba0434dd in pyo3::impl_::trampoline::module_init ( f=0x7f35ba1b71d0 >) at /home/mgorny/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.21.2/src/impl_/trampoline.rs:23 #34 0x00007f35ba1f951d in rustworkx::rustworkx::__pyo3_init () at src/lib.rs:408 #35 0x0000556107bb23a9 in _PyImport_RunModInitFunc (p0=p0@entry=0x7f35ba1f9510 , info=info@entry=0x7ffe9343da00, p_res=p_res@entry=0x7ffe9343d970) at ./Python/importdl.c:423 #36 0x0000556107baf086 in import_run_extension (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, p0=p0@entry=0x7f35ba1f9510 , info=info@entry=0x7ffe9343da00, spec=spec@entry=0x7f35bab7b390, modules=) at Python/import.c:1951 #37 0x0000556107bafd35 in _imp_create_dynamic_impl (module=module@entry=0x7f35bc7ac9a0, spec=0x7f35bab7b390, file=) at Python/import.c:4683 #38 0x0000556107bafdad in _imp_create_dynamic (module=0x7f35bc7ac9a0, args=args@entry=0x7f35bacce8d8, nargs=nargs@entry=1) at Python/clinic/import.c.h:485 #39 0x0000556107a9f029 in cfunction_vectorcall_FASTCALL (func=0x7f35bc7aed90, args=0x7f35bacce8d8, nargsf=, kwnames=) at Objects/methodobject.c:425 #40 0x0000556107a544c9 in _PyVectorcall_Call (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, func=0x556107a9efcb , callable=callable@entry=0x7f35bc7aed90, tuple=tuple@entry=0x7f35bacce8c0, kwargs=kwargs@entry=0x7f35babe0f00) at Objects/call.c:273 #41 0x0000556107a547c8 in _PyObject_Call (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc7aed90, args=args@entry=0x7f35bacce8c0, kwargs=kwargs@entry=0x7f35babe0f00) at Objects/call.c:348 #42 0x0000556107a54804 in PyObject_Call (callable=callable@entry=0x7f35bc7aed90, args=args@entry=0x7f35bacce8c0, kwargs=kwargs@entry=0x7f35babe0f00) at Objects/call.c:373 #43 0x0000556107b6634f in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62cef0, throwflag=0) at Python/generated_cases.c.h:1353 #44 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #45 0x0000556107b72cc9 in _PyEval_Vector (tstate=0x556107eebba0 <_PyRuntime+282784>, func=0x7f35bc7d0400, locals=locals@entry=0x0, args=0x7ffe9343dda0, argcount=2, kwnames=0x0) at Python/ceval.c:1819 #46 0x0000556107a5297c in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:413 #47 0x0000556107a52cad in _PyObject_VectorcallTstate (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc7d0400, args=args@entry=0x7ffe9343dda0, nargsf=nargsf@entry=2, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:168 #48 0x0000556107a53a8d in object_vacall (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, base=base@entry=0x0, callable=0x7f35bc7d0400, vargs=vargs@entry=0x7ffe9343de20) at Objects/call.c:819 #49 0x0000556107a53bc1 in PyObject_CallMethodObjArgs (obj=0x0, name=) at Objects/call.c:880 #50 0x0000556107bad3de in import_find_and_load (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, abs_name=abs_name@entry=0x7f35babe0070) at Python/import.c:3651 #51 0x0000556107bb0e63 in PyImport_ImportModuleLevelObject (name=name@entry=0x7f35bbb550b0, globals=, locals=locals@entry=0x7f35babe0d00, fromlist=fromlist@entry=0x7f35bc51dc30, level=level@entry=1) at Python/import.c:3733 #52 0x0000556107b5e847 in import_name (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=frame@entry=0x7f35bd62cb90, name=0x7f35bbb550b0, fromlist=fromlist@entry=0x7f35bc51dc30, level=level@entry=0x556107eaa0c8 <_PyRuntime+13768>) at Python/ceval.c:2675 #53 0x0000556107b6ab47 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62cb90, throwflag=0) at Python/generated_cases.c.h:3199 #54 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #55 0x0000556107b72cc9 in _PyEval_Vector (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, func=func@entry=0x7f35bab720c0, locals=locals@entry=0x7f35babe0d00, args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:1819 #56 0x0000556107b72d92 in PyEval_EvalCode (co=co@entry=0x55611c9b4ed0, globals=globals@entry=0x7f35babe0d00, locals=locals@entry=0x7f35babe0d00) at Python/ceval.c:599 #57 0x0000556107b5b413 in builtin_exec_impl (module=module@entry=0x7f35bc796e80, source=0x55611c9b4ed0, globals=0x7f35babe0d00, locals=0x7f35babe0d00, closure=0x0) at Python/bltinmodule.c:1145 #58 0x0000556107b5b563 in builtin_exec (module=0x7f35bc796e80, args=, args@entry=0x7f35badbd2d8, nargs=nargs@entry=2, kwnames=kwnames@entry=0x0) at Python/clinic/bltinmodule.c.h:556 #59 0x0000556107a9eebc in cfunction_vectorcall_FASTCALL_KEYWORDS (func=0x7f35bc797380, args=0x7f35badbd2d8, nargsf=, kwnames=0x0) at Objects/methodobject.c:441 #60 0x0000556107a544c9 in _PyVectorcall_Call (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, func=0x556107a9ee65 , callable=callable@entry=0x7f35bc797380, tuple=tuple@entry=0x7f35badbd2c0, kwargs=kwargs@entry=0x7f35babe0f40) at Objects/call.c:273 #61 0x0000556107a547c8 in _PyObject_Call (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc797380, args=args@entry=0x7f35badbd2c0, kwargs=kwargs@entry=0x7f35babe0f40) at Objects/call.c:348 #62 0x0000556107a54804 in PyObject_Call (callable=callable@entry=0x7f35bc797380, args=args@entry=0x7f35badbd2c0, kwargs=kwargs@entry=0x7f35babe0f40) at Objects/call.c:373 #63 0x0000556107b6634f in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62cb08, throwflag=0) at Python/generated_cases.c.h:1353 #64 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #65 0x0000556107b72cc9 in _PyEval_Vector (tstate=0x556107eebba0 <_PyRuntime+282784>, func=0x7f35bc7d0400, locals=locals@entry=0x0, args=0x7ffe9343e690, argcount=2, kwnames=0x0) at Python/ceval.c:1819 #66 0x0000556107a5297c in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:413 #67 0x0000556107a52cad in _PyObject_VectorcallTstate (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc7d0400, args=args@entry=0x7ffe9343e690, nargsf=nargsf@entry=2, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:168 #68 0x0000556107a53a8d in object_vacall (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, base=base@entry=0x0, callable=0x7f35bc7d0400, vargs=vargs@entry=0x7ffe9343e710) at Objects/call.c:819 #69 0x0000556107a53bc1 in PyObject_CallMethodObjArgs (obj=0x0, name=) at Objects/call.c:880 #70 0x0000556107bad3de in import_find_and_load (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, abs_name=abs_name@entry=0x7f35bbb550b0) at Python/import.c:3651 #71 0x0000556107bb0e63 in PyImport_ImportModuleLevelObject (name=name@entry=0x7f35bbb550b0, globals=, locals=locals@entry=0x7f35bc1f6480, fromlist=fromlist@entry=0x556107e820e0 <_Py_NoneStruct>, level=level@entry=0) at Python/import.c:3733 #72 0x0000556107b5e847 in import_name (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=frame@entry=0x7f35bd62c820, name=0x7f35bbb550b0, fromlist=fromlist@entry=0x556107e820e0 <_Py_NoneStruct>, level=level@entry=0x556107eaa0a8 <_PyRuntime+13736>) at Python/ceval.c:2675 #73 0x0000556107b6ab47 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62c820, throwflag=0) at Python/generated_cases.c.h:3199 #74 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #75 0x0000556107b72cc9 in _PyEval_Vector (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, func=func@entry=0x7f35bab71e40, locals=locals@entry=0x7f35bc1f6480, args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:1819 #76 0x0000556107b72d92 in PyEval_EvalCode (co=co@entry=0x7f35bab47e10, globals=globals@entry=0x7f35bc1f6480, locals=locals@entry=0x7f35bc1f6480) at Python/ceval.c:599 #77 0x0000556107b5b413 in builtin_exec_impl (module=module@entry=0x7f35bc796e80, source=0x7f35bab47e10, globals=0x7f35bc1f6480, locals=0x7f35bc1f6480, closure=0x0) at Python/bltinmodule.c:1145 #78 0x0000556107b5b563 in builtin_exec (module=0x7f35bc796e80, args=, args@entry=0x7f35bd62c800, nargs=nargs@entry=2, kwnames=kwnames@entry=0x0) at Python/clinic/bltinmodule.c.h:556 #79 0x0000556107a9eebc in cfunction_vectorcall_FASTCALL_KEYWORDS (func=0x7f35bc797380, args=0x7f35bd62c800, nargsf=, kwnames=0x0) at Objects/methodobject.c:441 #80 0x0000556107a52cad in _PyObject_VectorcallTstate (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc797380, args=args@entry=0x7f35bd62c800, nargsf=9223372036854775810, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:168 #81 0x0000556107a52d86 in PyObject_Vectorcall (callable=callable@entry=0x7f35bc797380, args=args@entry=0x7f35bd62c800, nargsf=, kwnames=kwnames@entry=0x0) at Objects/call.c:327 #82 0x0000556107b64d56 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62c750, throwflag=0) at Python/generated_cases.c.h:813 #83 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #84 0x0000556107b72cc9 in _PyEval_Vector (tstate=0x556107eebba0 <_PyRuntime+282784>, func=0x7f35bbc177e0, locals=locals@entry=0x0, args=0x7ffe9343ef08, argcount=1, kwnames=0x0) at Python/ceval.c:1819 #85 0x0000556107a5297c in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:413 #86 0x0000556107a52cad in _PyObject_VectorcallTstate (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bbc177e0, args=args@entry=0x7ffe9343ef08, nargsf=nargsf@entry=9223372036854775809, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:168 #87 0x0000556107a52dd8 in PyObject_CallOneArg (func=func@entry=0x7f35bbc177e0, arg=arg@entry=0x7f35bab63d90) at Objects/call.c:395 #88 0x0000556107a60157 in property_descr_get (self=self@entry=0x7f35bbc0c860, obj=obj@entry=0x7f35bab63d90, type=) at Objects/descrobject.c:1692 #89 0x0000556107aa4b46 in _PyObject_GenericGetAttrWithDict (obj=0x7f35bab63d90, name=0x556107eb66a0 <_PyRuntime+64416>, dict=dict@entry=0x0, suppress=suppress@entry=0) at Objects/object.c:1582 #90 0x0000556107aa4f77 in PyObject_GenericGetAttr (obj=, name=) at Objects/object.c:1664 #91 0x0000556107aa4640 in PyObject_GetAttr (v=v@entry=0x7f35bab63d90, name=0x556107eb66a0 <_PyRuntime+64416>) at Objects/object.c:1178 #92 0x0000556107b6c033 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62c138, throwflag=0) at Python/generated_cases.c.h:3764 #93 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #94 0x0000556107b72cc9 in _PyEval_Vector (tstate=0x556107eebba0 <_PyRuntime+282784>, func=0x7f35bc352020, locals=locals@entry=0x0, args=0x7f35babf0078, argcount=1, kwnames=0x7f35bac9ff10) at Python/ceval.c:1819 #95 0x0000556107a5297c in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:413 #96 0x0000556107a542cd in _PyObject_VectorcallDictTstate (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc352020, args=args@entry=0x7ffe9343f250, nargsf=, nargsf@entry=1, kwargs=kwargs@entry=0x7f35bac0a380) at Objects/call.c:146 #97 0x0000556107a543bb in _PyObject_Call_Prepend (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc352020, obj=obj@entry=0x7f35bbb37b00, args=args@entry=0x556107ebc2f8 <_PyRuntime+88056>, kwargs=kwargs@entry=0x7f35bac0a380) at Objects/call.c:504 #98 0x0000556107ad3448 in slot_tp_call (self=0x7f35bbb37b00, args=0x556107ebc2f8 <_PyRuntime+88056>, kwds=0x7f35bac0a380) at Objects/typeobject.c:9524 #99 0x0000556107a52b23 in _PyObject_MakeTpCall (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bbb37b00, args=args@entry=0x7f35bd62bc58, nargs=, keywords=keywords@entry=0x7f35bbda67d0) at Objects/call.c:242 #100 0x0000556107a52d2d in _PyObject_VectorcallTstate (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bbb37b00, args=args@entry=0x7f35bd62bc58, nargsf=, kwnames=kwnames@entry=0x7f35bbda67d0) at ./Include/internal/pycore_call.h:166 #101 0x0000556107a52d86 in PyObject_Vectorcall (callable=callable@entry=0x7f35bbb37b00, args=args@entry=0x7f35bd62bc58, nargsf=, kwnames=kwnames@entry=0x7f35bbda67d0) at Objects/call.c:327 #102 0x0000556107b66a94 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62bbe0, throwflag=0) at Python/generated_cases.c.h:1500 #103 0x0000556107a6a13b in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=frame@entry=0x7f35bab99388, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #104 0x0000556107a6a404 in gen_send_ex2 (gen=0x7f35bab99340, arg=arg@entry=0x0, presult=presult@entry=0x7ffe9343f570, exc=exc@entry=0, closing=closing@entry=0) at Objects/genobject.c:229 #105 0x0000556107a6b744 in gen_iternext (gen=) at Objects/genobject.c:589 #106 0x0000556107a7f378 in list_extend_iter_lock_held (self=0x7f35bac08740, iterable=) at Objects/listobject.c:1237 #107 0x0000556107a7f424 in _list_extend (self=, iterable=) at Objects/listobject.c:1410 #108 0x0000556107a7f48e in list_extend (self=, iterable=) at Objects/listobject.c:1429 #109 0x0000556107a5f20e in method_vectorcall_O (func=0x7f35bc74d990, args=0x7f35bd62bb30, nargsf=, kwnames=) at Objects/descrobject.c:475 #110 0x0000556107a52cad in _PyObject_VectorcallTstate (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc74d990, args=args@entry=0x7f35bd62bb30, nargsf=9223372036854775810, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:168 #111 0x0000556107a52d86 in PyObject_Vectorcall (callable=callable@entry=0x7f35bc74d990, args=args@entry=0x7f35bd62bb30, nargsf=, kwnames=kwnames@entry=0x0) at Objects/call.c:327 #112 0x0000556107b64d56 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62ba70, throwflag=0) at Python/generated_cases.c.h:813 #113 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #114 0x0000556107b72cc9 in _PyEval_Vector (tstate=0x556107eebba0 <_PyRuntime+282784>, func=0x7f35bc352020, locals=locals@entry=0x0, args=0x7f35bbc47c78, argcount=1, kwnames=0x7f35bada2e30) at Python/ceval.c:1819 #115 0x0000556107a5297c in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:413 #116 0x0000556107a542cd in _PyObject_VectorcallDictTstate (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc352020, args=args@entry=0x7ffe9343f8a0, nargsf=, nargsf@entry=1, kwargs=kwargs@entry=0x7f35bbd9aac0) at Objects/call.c:146 #117 0x0000556107a543bb in _PyObject_Call_Prepend (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc352020, obj=obj@entry=0x7f35bbb37330, args=args@entry=0x556107ebc2f8 <_PyRuntime+88056>, kwargs=kwargs@entry=0x7f35bbd9aac0) at Objects/call.c:504 #118 0x0000556107ad3448 in slot_tp_call (self=0x7f35bbb37330, args=0x556107ebc2f8 <_PyRuntime+88056>, kwds=0x7f35bbd9aac0) at Objects/typeobject.c:9524 #119 0x0000556107a52b23 in _PyObject_MakeTpCall (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bbb37330, args=args@entry=0x7f35bd62b798, nargs=, keywords=keywords@entry=0x7f35bc052170) at Objects/call.c:242 #120 0x0000556107a52d2d in _PyObject_VectorcallTstate (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bbb37330, args=args@entry=0x7f35bd62b798, nargsf=, kwnames=kwnames@entry=0x7f35bc052170) at ./Include/internal/pycore_call.h:166 #121 0x0000556107a52d86 in PyObject_Vectorcall (callable=callable@entry=0x7f35bbb37330, args=args@entry=0x7f35bd62b798, nargsf=, kwnames=kwnames@entry=0x7f35bc052170) at Objects/call.c:327 #122 0x0000556107b66a94 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62b730, throwflag=0) at Python/generated_cases.c.h:1500 #123 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #124 0x0000556107b72cc9 in _PyEval_Vector (tstate=0x556107eebba0 <_PyRuntime+282784>, func=0x7f35bc352020, locals=locals@entry=0x0, args=0x7f35bbc45f38, argcount=1, kwnames=0x7f35bad56f50) at Python/ceval.c:1819 #125 0x0000556107a5297c in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:413 #126 0x0000556107a542cd in _PyObject_VectorcallDictTstate (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc352020, args=args@entry=0x7ffe9343fc30, nargsf=, nargsf@entry=1, kwargs=kwargs@entry=0x7f35bac08800) at Objects/call.c:146 #127 0x0000556107a543bb in _PyObject_Call_Prepend (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc352020, obj=obj@entry=0x7f35bbb368e0, args=args@entry=0x556107ebc2f8 <_PyRuntime+88056>, kwargs=kwargs@entry=0x7f35bac08800) at Objects/call.c:504 #128 0x0000556107ad3448 in slot_tp_call (self=0x7f35bbb368e0, args=0x556107ebc2f8 <_PyRuntime+88056>, kwds=0x7f35bac08800) at Objects/typeobject.c:9524 #129 0x0000556107a52b23 in _PyObject_MakeTpCall (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bbb368e0, args=args@entry=0x7f35bd62b368, nargs=, keywords=keywords@entry=0x7f35bbe4f7f0) at Objects/call.c:242 #130 0x0000556107a52d2d in _PyObject_VectorcallTstate (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bbb368e0, args=args@entry=0x7f35bd62b368, nargsf=, kwnames=kwnames@entry=0x7f35bbe4f7f0) at ./Include/internal/pycore_call.h:166 #131 0x0000556107a52d86 in PyObject_Vectorcall (callable=callable@entry=0x7f35bbb368e0, args=args@entry=0x7f35bd62b368, nargsf=, kwnames=kwnames@entry=0x7f35bbe4f7f0) at Objects/call.c:327 #132 0x0000556107b66a94 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62b2b0, throwflag=0) at Python/generated_cases.c.h:1500 #133 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #134 0x0000556107b72cc9 in _PyEval_Vector (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, func=func@entry=0x7f35bc7d14e0, locals=locals@entry=0x7f35bc6304c0, args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:1819 #135 0x0000556107b72d92 in PyEval_EvalCode (co=co@entry=0x7f35bbc428b0, globals=globals@entry=0x7f35bc6304c0, locals=locals@entry=0x7f35bc6304c0) at Python/ceval.c:599 #136 0x0000556107b5b413 in builtin_exec_impl (module=module@entry=0x7f35bc796e80, source=0x7f35bbc428b0, globals=0x7f35bc6304c0, locals=0x7f35bc6304c0, closure=0x0) at Python/bltinmodule.c:1145 #137 0x0000556107b5b563 in builtin_exec (module=0x7f35bc796e80, args=, args@entry=0x7f35bd62b180, nargs=nargs@entry=2, kwnames=kwnames@entry=0x0) at Python/clinic/bltinmodule.c.h:556 #138 0x0000556107a9eebc in cfunction_vectorcall_FASTCALL_KEYWORDS (func=0x7f35bc797380, args=0x7f35bd62b180, nargsf=, kwnames=0x0) at Objects/methodobject.c:441 #139 0x0000556107a52cad in _PyObject_VectorcallTstate (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc797380, args=args@entry=0x7f35bd62b180, nargsf=9223372036854775810, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:168 #140 0x0000556107a52d86 in PyObject_Vectorcall (callable=callable@entry=0x7f35bc797380, args=args@entry=0x7f35bd62b180, nargsf=, kwnames=kwnames@entry=0x0) at Objects/call.c:327 #141 0x0000556107b64d56 in _PyEval_EvalFrameDefault (tstate=0x556107eebba0 <_PyRuntime+282784>, frame=0x7f35bd62b0d8, throwflag=0) at Python/generated_cases.c.h:813 #142 0x0000556107b72ba6 in _PyEval_EvalFrame (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, frame=, throwflag=throwflag@entry=0) at ./Include/internal/pycore_ceval.h:119 #143 0x0000556107b72cc9 in _PyEval_Vector (tstate=0x556107eebba0 <_PyRuntime+282784>, func=0x7f35bc6ef240, locals=locals@entry=0x0, args=0x7f35bc6dbb98, argcount=2, kwnames=0x0) at Python/ceval.c:1819 #144 0x0000556107a5297c in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:413 #145 0x0000556107a544c9 in _PyVectorcall_Call (tstate=tstate@entry=0x556107eebba0 <_PyRuntime+282784>, func=0x556107a52924 <_PyFunction_Vectorcall>, callable=callable@entry=0x7f35bc6ef240, tuple=tuple@entry=0x7f35bc6dbb80, kwargs=kwargs@entry=0x0) at Objects/call.c:273 #146 0x0000556107a547c8 in _PyObject_Call (tstate=0x556107eebba0 <_PyRuntime+282784>, callable=callable@entry=0x7f35bc6ef240, args=args@entry=0x7f35bc6dbb80, kwargs=kwargs@entry=0x0) at Objects/call.c:348 #147 0x0000556107a54804 in PyObject_Call (callable=callable@entry=0x7f35bc6ef240, args=args@entry=0x7f35bc6dbb80, kwargs=kwargs@entry=0x0) at Objects/call.c:373 #148 0x0000556107bfa64d in pymain_run_module (modname=, set_argv0=set_argv0@entry=1) at Modules/main.c:297 #149 0x0000556107bfb1f6 in pymain_run_python (exitcode=exitcode@entry=0x7ffe93440434) at Modules/main.c:634 #150 0x0000556107bfb486 in Py_RunMain () at Modules/main.c:719 #151 0x0000556107bfb500 in pymain_main (args=args@entry=0x7ffe93440490) at Modules/main.c:749 #152 0x0000556107bfb5d7 in Py_BytesMain (argc=, argv=) at Modules/main.c:773 #153 0x00005561079f58e6 in main (argc=, argv=) at ./Programs/python.c:15 ```

What is the expected behavior?

Tests passing.

Steps to reproduce the problem

  1. Build Python 3.13.0b3 (or newer) with --with-assertions.
  2. Install needed dependencies (I've used Gentoo packages).
  3. Build rustworkx (I've used setup.py build_rust -i -d).
  4. Run pytest (I've used -s to get the error message in output).
IvanIsCoding commented 6 days ago

1220 is not running yet so I appreciate manually testing rustworkx with the latest Python beta.

I have a feeling that this is a PyO3 issue and that updating PyO3 to 0.22.x could potentially fix it.

mgorny commented 6 days ago

I'm afraid I don't really know Rust, and my quick attempts at upgrading pyo3 there failed. If there's anything you wish me to test, please let me know.

IvanIsCoding commented 6 days ago

I think we have enough information to fix on our side. You are attempting to build from source, which in general will limit the latest Python you can build with. Most of our downstream users download binaries that we build with Python 3.8 and test with 3.8 to 3.12

mgorny commented 5 days ago

Oh, that's interesting. The stable ABI wheel (both build via python -m build and downloaded from PyPI) crashes as well.

mgorny commented 4 days ago

Ah, sorry, I've just noticed the same failure in another package that worked previously, and I see that it's a regression with Python 3.13.0b3 (compared to b2). I've filed https://github.com/PyO3/pyo3/issues/4309 for that.

That said, if I downgrade to 3.13.0b2 some tests pass and some crash with another assertion.

tests/digraph/test_adjacency_matrix.py::TestDAGAdjacencyMatrix::test_graph_to_digraph_adjacency_matrix python3.13: ./Include/internal/pycore_object.h:284: _PyObject_Init: Assertion `_PyType_HasFeature(typeobj, Py_TPFLAGS_HEAPTYPE) || _Py_IsImmortal(typeobj)' failed.    
Fatal Python error: Aborted

That said, I think it's better to wait for the immediate issue to be fixed. If you upgraded to pyo3 0.22.0, I'd be happy to test again.

mgorny commented 4 days ago

It turns out it's a change in CPython 3.13 that PyO3 wasn't adjusted for — but since it also affects the stable ABI, CPython upstream has prepared a revert for the failing assertion, and I've confirmed that it fixes the problem with rustworkx.

As for the other issues with CPython 3.13, I'm going to look into them later. However, given stable ABI, I think they'd also be CPython or PyO3 bugs.

IvanIsCoding commented 4 days ago

It turns out it's a change in CPython 3.13 that PyO3 wasn't adjusted for — but since it also affects the stable ABI, CPython upstream has prepared a revert for the failing assertion, and I've confirmed that it fixes the problem with rustworkx.

As for the other issues with CPython 3.13, I'm going to look into them later. However, given stable ABI, I think they'd also be CPython or PyO3 bugs.

Thanks for finding an ABI regression on the Python interpreter! This would have been a huge headache, you caught it early on