Repository navigation
Python 3.13b repeatedly setting superclass attribute in subclass leads to crashes #119462
Description
Crash report
What happened?
I'm trying to run the qutebrowser testsuite with Python 3.13, and am running into an issue where a test reproducibly fails (usually by crashing the interpreter), but only when I run the entire testsuite (not when run in isolation, or even just the tests in the same subfolder).
Given those circumstances, it seems tricky to get to a minimal example. I thought I'd open this issue in the hope of distilling things down further, and arriving at such an example. In the meantime, the best reproduction steps I can come up with are:
git clone https://github.com/qutebrowser/qutebrowser
cd qutebrowser
tox -e py313-pyqt66 -- tests/unit -v -s
A few tests will fail with a --with-pydebug build due to timeouts, those can be ignored. After a while (~13 minutes with --with-pydebug under gdb on my system), one of the tests in tests/unit/mainwindow/test_messageview.py will fail, usually due to a failing assertion because PyUnicode_KIND did return an invalid value.
Failing Python code:
value = value.replace('default_family', self.default_family)
stacktrace:
Details
#0 0x00007211a3fda32c in ??? () at /usr/lib/libc.so.6
#1 0x00007211a3f896c8 in raise () at /usr/lib/libc.so.6
#2 0x00007211a3f89770 in <signal handler called> () at /usr/lib/libc.so.6
#3 0x00007211a3fda32c in ??? () at /usr/lib/libc.so.6
#4 0x00007211a3f896c8 in raise () at /usr/lib/libc.so.6
#5 0x00007211a3f714b8 in abort () at /usr/lib/libc.so.6
#6 0x00007211a3f713dc in ??? () at /usr/lib/libc.so.6
#7 0x00007211a3f81d46 in __assert_fail () at /usr/lib/libc.so.6
#8 0x00007211a389feb4 in PyUnicode_MAX_CHAR_VALUE (op=<optimized out>) at ./Include/cpython/unicodeobject.h:374
#9 0x00007211a39ab346 in PyUnicode_MAX_CHAR_VALUE (op=<optimized out>) at ./Include/cpython/unicodeobject.h:371
#10 replace (self=Python Exception <class 'gdb.error'>: There is no member named ready.
, str1=Python Exception <class 'gdb.error'>: There is no member named ready.
, str2=<unknown at remote 0x72110f89c130>, maxcount=<optimized out>)
at Objects/unicodeobject.c:10133
#11 0x00007211a388e6e6 in _PyEval_EvalFrameDefault
(tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414be50, throwflag=6) at Python/generated_cases.c.h:1688
#12 0x00007211a3a1a488 in _PyObject_VectorcallTstate
(kwnames=0x0, nargsf=2, args=0x7ffecd2707a0, callable=<function at remote 0x72118e52c7d0>, tstate=0x7211a3ecb1f0 <_PyRuntime+294032>) at ./Include/internal/pycore_call.h:168
#13 PyObject_Vectorcall (kwnames=0x0, nargsf=2, args=0x7ffecd2707a0, callable=<function at remote 0x72118e52c7d0>)
at Objects/call.c:327
#14 call_attribute (name=Python Exception <class 'gdb.error'>: There is no member named ready.
, attr=<function at remote 0x72118e52c7d0>, self=<optimized out>)
at Objects/typeobject.c:9435
#15 call_attribute (name=Python Exception <class 'gdb.error'>: There is no member named ready.
, attr=<function at remote 0x72118e52c7d0>, self=<optimized out>)
at Objects/typeobject.c:9429
#16 _Py_slot_tp_getattr_hook (self=<optimized out>, name=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:9485
#17 0x00007211a3a1b123 in PyObject_GetAttr (v=Python Exception <class 'AssertionError'>:
, name=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/object.c:1175
#18 0x00007211a3892454 in _PyEval_EvalFrameDefault
(tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414bc98, throwflag=6) at Python/generated_cases.c.h:1165
#19 0x00007211a3c3d04d in _PyEval_EvalFrame
(throwflag=0, frame=0x7211198c8208, tstate=0x7211a3ecb1f0 <_PyRuntime+294032>)
at ./Include/internal/pycore_ceval.h:119
#20 gen_send_ex2
(gen=0x7211198c81c0, arg=arg@entry=0x0, presult=presult@entry=0x7ffecd270a90, exc=exc@entry=0, closing=closing@entry=0) at Objects/genobject.c:229
#21 0x00007211a3c3d242 in gen_iternext (gen=<optimized out>) at Objects/genobject.c:589
#22 0x00007211a3acbb60 in list_extend_iter_lock_held
(iterable=<generator at remote 0x7211198c81c0>, self=0x72110f8d1770) at Objects/listobject.c:1231
#23 _list_extend (self=self@entry=0x72110f8d1770, iterable=iterable@entry=<generator at remote 0x7211198c81c0>)
at Objects/listobject.c:1404
#24 0x00007211a3acc7b7 in list_extend (iterable=<generator at remote 0x7211198c81c0>, self=0x72110f8d1770)
at Objects/listobject.c:1430
#25 _PyList_Extend (iterable=<generator at remote 0x7211198c81c0>, self=0x72110f8d1770) at Objects/listobject.c:1432
#26 PySequence_List (v=<generator at remote 0x7211198c81c0>) at Objects/abstract.c:2135
#27 0x00007211a3ad6128 in PySequence_Fast (m=0x7211a3cae034 "can only join an iterable", v=<optimized out>)
at Objects/abstract.c:2166
#28 PySequence_Fast (v=<optimized out>, m=0x7211a3cae034 "can only join an iterable") at Objects/abstract.c:2145
#29 0x00007211a3ad81bf in PyUnicode_Join (separator=Python Exception <class 'gdb.error'>: There is no member named ready.
, seq=<optimized out>) at Objects/unicodeobject.c:9557
--Type <RET> for more, q to quit, c to continue without paging--
#30 0x00007211a3892ba1 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414bbe0, throwflag=6) at Python/generated_cases.c.h:1264
#31 0x00007211a3a10d2a in PyObject_Call (kwargs=0x0, args=Python Exception <class 'gdb.error'>: There is no member named ready.
, callable=<function at remote 0x72118e3ed790>) at Objects/call.c:373
#32 bounded_lru_cache_wrapper (self=0x72118e3ed850, args=Python Exception <class 'gdb.error'>: There is no member named ready.
, kwds=0x0) at ./Modules/_functoolsmodule.c:1050
#33 0x00007211a39ec88d in _PyObject_MakeTpCall (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=Python Exception <class 'gdb.error'>: There is no member named ready.
, args=<optimized out>, nargs=1, keywords=<optimized out>) at Objects/call.c:242
#34 0x00007211a388d023 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414baf0, throwflag=6) at Python/generated_cases.c.h:1837
#35 0x00007211a39ece98 in _PyObject_VectorcallDictTstate (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<function at remote 0x72118e3edd90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146 _hook.py'...
#36 0x00007211a39ed0a6 in _PyObject_Call_Prepend (tstate=tstate@entry=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x72118e3edd90>, obj=obj@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/call.c:504
#37 0x00007211a3a1a645 in slot_tp_init (self=Python Exception <class 'gdb.error'>: There is no member named ready.
, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:9646
#38 0x00007211a39afafd in type_call (self=<PyQt6.sip.wrappertype at remote 0x5e3a1fe4e720>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:1909
#39 0x00007211a39ec88d in _PyObject_MakeTpCall (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<PyQt6.sip.wrappertype at remote 0x5e3a1fe4e720>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#40 0x00007211a3884cc8 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414b880, throwflag=6) at Python/generated_cases.c.h:1500
#41 0x00007211a39ece98 in _PyObject_VectorcallDictTstate (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7211a2b85d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146 piling '/home/florian/proj/aur/rixx/python313/pkg/python313/usr/lib/python3.13/test/test_importlib/import_/test_hel
#42 0x00007211a39ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7211a2b85d90>, obj=obj@entry=<HookCaller at remote 0x7211a2395d30>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/call.c:504
#43 0x00007211a3a17ff5 in slot_tp_call (self=<HookCaller at remote 0x7211a2395d30>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:9400
#44 0x00007211a39ec88d in _PyObject_MakeTpCall (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7211a2395d30>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#45 0x00007211a3884cc8 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414b370, throwflag=6) at Python/generated_cases.c.h:1500
#46 0x00007211a39ece98 in _PyObject_VectorcallDictTstate (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7211a2b85d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146 es/example2/example2/__init__.py'...
#47 0x00007211a39ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7211a2b85d90>, obj=obj@entry=<HookCaller at remote 0x7211a23964b0>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/call.c:504
#48 0x00007211a3a17ff5 in slot_tp_call (self=<HookCaller at remote 0x7211a23964b0>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:9400
#49 0x00007211a3a0e1ee in _PyObject_Call (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7211a23964b0>, args=(), kwargs=<optimized out>) at Objects/call.c:361
#50 0x00007211a3881380 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414b008, throwflag=6) at Python/generated_cases.c.h:1353
#51 0x00007211a39ece98 in _PyObject_VectorcallDictTstate (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7211a2b85d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146 a_namespace_pkg/foo/one.py'...
#52 0x00007211a39ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7211a2b85d90>, obj=obj@entry=<HookCaller at remote 0x7211a2396b70>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/call.c:504
#53 0x00007211a3a17ff5 in slot_tp_call (self=<HookCaller at remote 0x7211a2396b70>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:9400
#54 0x00007211a39ec88d in _PyObject_MakeTpCall (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7211a2396b70>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#55 0x00007211a3884cc8 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414aa10, throwflag=6) at Python/generated_cases.c.h:1500
#56 0x00007211a39ece98 in _PyObject_VectorcallDictTstate (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7211a2b85d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146 piling '/home/florian/proj/aur/rixx/python313/pkg/python313/usr/lib/python3.13/test/test_importlib/namespace_pkgs/p
#57 0x00007211a39ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7211a2b85d90>, obj=obj@entry=<HookCaller at remote 0x7211a2396f90>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/call.c:504
#58 0x00007211a3a17ff5 in slot_tp_call (self=<HookCaller at remote 0x7211a2396f90>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:9400
#59 0x00007211a39ec88d in _PyObject_MakeTpCall (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7211a2396f90>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#60 0x00007211a3884cc8 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414a730, throwflag=6) at Python/generated_cases.c.h:1500
#61 0x00007211a39ece98 in _PyObject_VectorcallDictTstate (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7211a2b85d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146 piling '/home/florian/proj/aur/rixx/python313/pkg/python313/usr/lib/python3.13/test/test_httpservers.py'...
#62 0x00007211a39ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7211a2b85d90>, obj=obj@entry=<HookCaller at remote 0x7211a238b2f0>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/call.c:504
#63 0x00007211a3a17ff5 in slot_tp_call (self=<HookCaller at remote 0x7211a238b2f0>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Objects/typeobject.c:9400
#64 0x00007211a39ec88d in _PyObject_MakeTpCall (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7211a238b2f0>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#65 0x00007211a3884cc8 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414a2b0, throwflag=6) at Python/generated_cases.c.h:1500
#66 0x00007211a3c3f6d6 in PyEval_EvalCode (co=<code at remote 0x7211a25a96d0>, globals=<optimized out>, locals=Python Exception <class 'gdb.error'>: There is no member named ready.
) at Python/ceval.c:598
#67 0x00007211a3c51950 in builtin_exec_impl (module=<optimized out>, closure=<optimized out>, locals=Python Exception <class 'gdb.error'>: There is no member named ready.
, globals=Python Exception <class 'gdb.error'>: There is no member named ready.
, source=<code at remote 0x7211a25a96d0>) at Python/bltinmodule.c:1145
#68 builtin_exec (module=<optimized out>, args=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Python/clinic/bltinmodule.c.h:556
#69 0x00007211a395a4ea in cfunction_vectorcall_FASTCALL_KEYWORDS (func=<built-in method exec of module object at remote 0x7211a36cc410>, args=0x7211a414a180, nargsf=<optimized out>, kwnames=0x0) at Objects/methodobject.c:441
#70 0x00007211a39fcce9 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=9223372036854775810, args=0x7211a414a180, callable=<built-in method exec of module object at remote 0x7211a36cc410>, tstate=0x7211a3ecb1f0 <_PyRuntime+294032>)
at ./Include/internal/pycore_call.h:168
#71 PyObject_Vectorcall (callable=<built-in method exec of module object at remote 0x7211a36cc410>, args=0x7211a414a180, nargsf=9223372036854775810, kwnames=0x0) at Objects/call.c:327
#72 0x00007211a3889b59 in _PyEval_EvalFrameDefault (tstate=0x7211a3ecb1f0 <_PyRuntime+294032>, frame=0x7211a414a0d8, throwflag=6) at Python/generated_cases.c.h:813
#73 0x00007211a3c36c04 in PyObject_Call (kwargs=0x0, args=Python Exception <class 'gdb.error'>: There is no member named ready.
, callable=<function at remote 0x7211a2d38290>) at Objects/call.c:373
#74 pymain_run_module (modname=<optimized out>, set_argv0=set_argv0@entry=1) at Modules/main.c:297
#75 0x00007211a3c498d2 in pymain_run_python (exitcode=0x7ffecd272a68) at Modules/main.c:633
#76 Py_RunMain () at Modules/main.c:718
#77 0x00007211a3f72cd0 in ??? () at /usr/lib/libc.so.6
#78 0x00007211a3f72d8a in __libc_start_main () at /usr/lib/libc.so.6
#79 0x00005e3a1e856055 in _start ()Sometimes I've also seen a MemoryError on the line calling str.replace, or an ominous:
TypeError: replace() argument 2 must be str, not +with the following Python stack (note that jinja is involved, which might or might not be a trigger?):
qtbot = <pytestqt.qtbot.QtBot object at 0x7552ae9d6200>, view = <qutebrowser.mainwindow.messageview.MessageView object at 0x7552acd7fb10>
config_stub = <qutebrowser.config.config.Config object at 0x7552acbe6170>
def test_changing_timer_with_messages_shown(qtbot, view, config_stub):
"""When we change messages.timeout, the timer should be restarted."""
config_stub.val.messages.timeout = 900000 # 15s
> view.show_message(message.MessageInfo(usertypes.MessageLevel.info, 'test'))
tests/unit/mainwindow/test_messageview.py:172:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
qutebrowser/mainwindow/messageview.py:148: in show_message
widget = Message.from_info(info)
qutebrowser/mainwindow/messageview.py:71: in from_info
return cls(
qutebrowser/mainwindow/messageview.py:62: in __init__
stylesheet.set_register(self, qss, update=False)
qutebrowser/config/stylesheet.py:32: in set_register
observer.register()
qutebrowser/config/stylesheet.py:97: in register
qss = self._get_stylesheet()
qutebrowser/config/stylesheet.py:86: in _get_stylesheet
return _render_stylesheet(self._stylesheet)
qutebrowser/config/stylesheet.py:41: in _render_stylesheet
return template.render(conf=config.val)
.tox/py313-pyqt66/lib/python3.13/site-packages/jinja2/environment.py:1304: in render
self.environment.handle_exception()
.tox/py313-pyqt66/lib/python3.13/site-packages/jinja2/environment.py:939: in handle_exception
raise rewrite_traceback_stack(source=source)
<template>:7: in top-level template code
???
qutebrowser/utils/jinja.py:117: in getattr
return getattr(obj, attribute)
qutebrowser/config/config.py:633: in __getattr__
return self._config.get(name)
qutebrowser/config/config.py:385: in get
return opt.typ.to_py(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <qutebrowser.config.configtypes.Font completions=None none_ok=False>, value = 'default_size default_family'
def to_py(self, value: _StrUnset) -> _StrUnsetNone:
self._basic_py_validation(value, str)
if isinstance(value, usertypes.Unset):
return value
elif not value:
return None
if not self.font_regex.fullmatch(value): # pragma: no cover
# This should never happen, as the regex always matches everything
# as family.
raise configexc.ValidationError(value, "must be a valid font")
if (value.endswith(' default_family') and
self.default_family is not None):
> value = value.replace('default_family', self.default_family)
E TypeError: replace() argument 2 must be str, not +
qutebrowser/config/configtypes.py:1244: TypeErrorwhich leads me to the conclusion that there must be some sort of memory corruption going on there.
On one run, I've also see a GC-related crash, which I'm not sure is related:
Python stack:
Details
Fatal Python error: Aborted
Thread 0x00007f31066006c0 (most recent call first):
File "/usr/lib/python3.13/socket.py", line 295 in accept
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pytest_rerunfailures.py", line 433 in run_server
File "/usr/lib/python3.13/threading.py", line 990 in run
File "/usr/lib/python3.13/threading.py", line 1039 in _bootstrap_inner
File "/usr/lib/python3.13/threading.py", line 1010 in _bootstrap
Current thread 0x00007f311ca29740 (most recent call first):
Garbage-collecting
File "/home/florian/proj/qutebrowser/git/qutebrowser/config/configfiles.py", line 255 in __init__
File "/home/florian/proj/qutebrowser/git/tests/helpers/fixtures.py", line 315 in yaml_config_stub
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 884 in call_fixture_func
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 1122 in pytest_fixture_setup
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 1073 in execute
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 603 in _get_active_fixturedef
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 1035 in execute
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 603 in _get_active_fixturedef
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 1035 in execute
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 603 in _get_active_fixturedef
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 518 in getfixturevalue
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/fixtures.py", line 683 in _fillfixtures
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/python.py", line 1630 in setup
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/runner.py", line 512 in setup
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/runner.py", line 159 in pytest_runtest_setup
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/runner.py", line 241 in <lambda>
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/runner.py", line 341 in from_call
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/runner.py", line 240 in call_and_report
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/runner.py", line 129 in runtestprotocol
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/runner.py", line 116 in pytest_runtest_protocol
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/main.py", line 364 in pytest_runtestloop
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/main.py", line 339 in _main
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/main.py", line 285 in wrap_session
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/main.py", line 332 in pytest_cmdline_main
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/config/__init__.py", line 178 in main
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/_pytest/config/__init__.py", line 206 in console_main
File "/home/florian/proj/qutebrowser/git/.tox/py313-pyqt66/lib/python3.13/site-packages/pytest/__main__.py", line 7 in <module>
File "/usr/lib/python3.13/runpy.py", line 88 in _run_code
File "/usr/lib/python3.13/runpy.py", line 198 in _run_module_as_main
Extension modules: hunter._predicates, hunter._tracer, hunter.vendor._cymem.cymem, hunter._event, markupsafe._speedups, PyQt6.QtCore, PyQt6.QtGui, PyQt6.QtWidgets, PyQt6.QtNetwork, PyQt6.QtPrintSupport, PyQt6.QtQml, PyQt6.QtOpenGL, PyQt6.QtWebChannel, PyQt6.QtWebEngineCore, PyQt6.QtSql, PyQt6.QtWebEngineWidgets, PyQt6.QtTest, PyQt6.QtDBus (total: 18)C stack:
Details
#0 0x00007f311c0ab32c in ??? () at /usr/lib/libc.so.6
#1 0x00007f311c05a6c8 in raise () at /usr/lib/libc.so.6
#2 0x00007f311c05a770 in <signal handler called> () at /usr/lib/libc.so.6
#3 0x00007f311c0ab32c in ??? () at /usr/lib/libc.so.6
#4 0x00007f311c05a6c8 in raise () at /usr/lib/libc.so.6
#5 0x00007f311c0424b8 in abort () at /usr/lib/libc.so.6
#6 0x00007f311c0423dc in ??? () at /usr/lib/libc.so.6
#7 0x00007f311c052d46 in __assert_fail () at /usr/lib/libc.so.6
#8 0x00007f311c2a2bd1 in validate_old (gcstate=<optimized out>) at Python/gc.c:432
#9 validate_old (gcstate=gcstate@entry=0x7f311c89deb8 <_PyRuntime+108888>) at Python/gc.c:425
#10 0x00007f311c6076cc in gc_collect_increment (stats=0x7ffc5a234f70, tstate=<optimized out>) at Python/gc.c:1453
#11 _PyGC_Collect
(tstate=tstate@entry=0x7f311c8cb1f0 <_PyRuntime+294032>, generation=generation@entry=1, reason=reason@entry=_Py_GC_REASON_HEAP) at Python/gc.c:1811
#12 0x00007f311c607b4b in _Py_RunGC (tstate=0x7f311c8cb1f0 <_PyRuntime+294032>) at Python/gc.c:2010
#13 _Py_RunGC (tstate=0x7f311c8cb1f0 <_PyRuntime+294032>) at Python/gc.c:2007
#14 _Py_HandlePending (tstate=0x7f311c8cb1f0 <_PyRuntime+294032>) at Python/ceval_gil.c:1244
#15 0x00007f311c289f30 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb34ed8, throwflag=6) at Python/generated_cases.c.h:846
#16 0x00007f311c3ece2f in _PyObject_VectorcallDictTstate
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7f3106d8d010>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:135
#17 0x00007f311c3ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7f3106d8d010>, obj=obj@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
, args=args@entry=(), kwargs=kwargs@entry=0x0) at Objects/call.c:504
#18 0x00007f311c41a645 in slot_tp_init (self=Python Exception <class 'gdb.error'>: There is no member named ready.
, args=(), kwds=0x0) at Objects/typeobject.c:9646
#19 0x00007f311c3afafd in type_call (self=<PyQt6.sip.wrappertype at remote 0x64c813562e80>, args=(), kwds=0x0)
at Objects/typeobject.c:1909
#20 0x00007f311c3ec88d in _PyObject_MakeTpCall
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<PyQt6.sip.wrappertype at remote 0x64c813562e80>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#21 0x00007f311c28d023 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb34e78, throwflag=6) at Python/generated_cases.c.h:1837
#22 0x00007f311c3ece98 in _PyObject_VectorcallDictTstate
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7f311b519d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146
#23 0x00007f311c3ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7f311b519d90>, obj=obj@entry=<HookCaller at remote 0x7f311ad507d0>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/call.c:504
#24 0x00007f311c417ff5 in slot_tp_call (self=<HookCaller at remote 0x7f311ad507d0>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/typeobject.c:9400
#25 0x00007f311c3ec88d in _PyObject_MakeTpCall
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7f311ad507d0>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#26 0x00007f311c284cc8 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb349d8, throwflag=6) at Python/generated_cases.c.h:1500
#27 0x00007f311c3ece98 in _PyObject_VectorcallDictTstate
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7f311b519d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146
#28 0x00007f311c3ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7f311b519d90>, obj=obj@entry=<HookCaller at remote 0x7f311ad52cf0>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/call.c:504
#29 0x00007f311c417ff5 in slot_tp_call (self=<HookCaller at remote 0x7f311ad52cf0>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/typeobject.c:9400
#30 0x00007f311c40e1ee in _PyObject_Call
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7f311ad52cf0>, args=(), kwargs=<optimized out>) at Objects/call.c:361
#31 0x00007f311c281380 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb34008, throwflag=6) at Python/generated_cases.c.h:1353
#32 0x00007f311c3ece98 in _PyObject_VectorcallDictTstate
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7f311b519d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146
#33 0x00007f311c3ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7f311b519d90>, obj=obj@entry=<HookCaller at remote 0x7f311ad52bd0>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/call.c:504
#34 0x00007f311c417ff5 in slot_tp_call (self=<HookCaller at remote 0x7f311ad52bd0>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/typeobject.c:9400
#35 0x00007f311c3ec88d in _PyObject_MakeTpCall
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7f311ad52bd0>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#36 0x00007f311c284cc8 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb33a10, throwflag=6) at Python/generated_cases.c.h:1500
#37 0x00007f311c3ece98 in _PyObject_VectorcallDictTstate
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7f311b519d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146
#38 0x00007f311c3ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7f311b519d90>, obj=obj@entry=<HookCaller at remote 0x7f311ad52ff0>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/call.c:504
#39 0x00007f311c417ff5 in slot_tp_call (self=<HookCaller at remote 0x7f311ad52ff0>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/typeobject.c:9400
#40 0x00007f311c3ec88d in _PyObject_MakeTpCall
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7f311ad52ff0>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#41 0x00007f311c284cc8 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb33730, throwflag=6) at Python/generated_cases.c.h:1500
#42 0x00007f311c3ece98 in _PyObject_VectorcallDictTstate
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<function at remote 0x7f311b519d90>, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:146
#43 0x00007f311c3ed0a6 in _PyObject_Call_Prepend
(tstate=tstate@entry=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=callable@entry=<function at remote 0x7f311b519d90>, obj=obj@entry=<HookCaller at remote 0x7f311ad47410>, args=args@entry=(), kwargs=kwargs@entry=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/call.c:504
#44 0x00007f311c417ff5 in slot_tp_call (self=<HookCaller at remote 0x7f311ad47410>, args=(), kwds=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Objects/typeobject.c:9400
#45 0x00007f311c3ec88d in _PyObject_MakeTpCall
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, callable=<HookCaller at remote 0x7f311ad47410>, args=<optimized out>, nargs=0, keywords=<optimized out>) at Objects/call.c:242
#46 0x00007f311c284cc8 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb332b0, throwflag=6) at Python/generated_cases.c.h:1500
#47 0x00007f311c63f6d6 in PyEval_EvalCode (co=<code at remote 0x7f311af616d0>, globals=<optimized out>, locals=Python Exception <class 'gdb.error'>: There is no member named ready.
)
at Python/ceval.c:598
#48 0x00007f311c651950 in builtin_exec_impl (module=<optimized out>, closure=<optimized out>, locals=Python Exception <class 'gdb.error'>: There is no member named ready.
, globals=Python Exception <class 'gdb.error'>: There is no member named ready.
, source=<code at remote 0x7f311af616d0>)
at Python/bltinmodule.c:1145
#49 builtin_exec (module=<optimized out>, args=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>)
at Python/clinic/bltinmodule.c.h:556
#50 0x00007f311c35a4ea in cfunction_vectorcall_FASTCALL_KEYWORDS
(func=<built-in method exec of module object at remote 0x7f311bbb8410>, args=0x7f311cb33180, nargsf=<optimized out>, kwnames=0x0) at Objects/methodobject.c:441
#51 0x00007f311c3fcce9 in _PyObject_VectorcallTstate
(kwnames=0x0, nargsf=9223372036854775810, args=0x7f311cb33180, callable=<built-in method exec of module object at remote 0x7f311bbb8410>, tstate=0x7f311c8cb1f0 <_PyRuntime+294032>) at ./Include/internal/pycore_call.h:168
#52 PyObject_Vectorcall
(callable=<built-in method exec of module object at remote 0x7f311bbb8410>, args=0x7f311cb33180, nargsf=9223372036854775810, kwnames=0x0) at Objects/call.c:327
#53 0x00007f311c289b59 in _PyEval_EvalFrameDefault
(tstate=0x7f311c8cb1f0 <_PyRuntime+294032>, frame=0x7f311cb330d8, throwflag=6) at Python/generated_cases.c.h:813
#54 0x00007f311c636c04 in PyObject_Call (kwargs=0x0, args=Python Exception <class 'gdb.error'>: There is no member named ready.
, callable=<function at remote 0x7f311b664290>)
at Objects/call.c:373
#55 pymain_run_module (modname=<optimized out>, set_argv0=set_argv0@entry=1) at Modules/main.c:297
#56 0x00007f311c6498d2 in pymain_run_python (exitcode=0x7ffc5a236bd8) at Modules/main.c:633
#57 Py_RunMain () at Modules/main.c:718
#58 0x00007f311c043cd0 in ??? () at /usr/lib/libc.so.6
#59 0x00007f311c043d8a in __libc_start_main () at /usr/lib/libc.so.6
#60 0x000064c810b08055 in _start ()I'm lost here on how to best debug this further. My best bet would be to try and at least get an example that I can run more quickly, and then try and bisect CPython in order to find the offending change. If there are any other guesses or approaches to debug what could be going on here, I'd be happy to dig in further.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.13.0b1 (main, May 23 2024, 09:21:12) [GCC 13.2.1 20240417]
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity
rhettinger commentedon May 23, 2024
I did a quick check for recent changes to
Objects/unicodeobject.c::replace()but the code has been stable. The last edit was17b4733f2ff Serhiy Storchaka 2020-04-01. That said, a lot of other things have changed in CPython (the memory allocator, method dispatch, and the next of include files).It would help a great deal if you could bisect the problem to a particular edit or construct a minimal reproducer that excludes third-party extensions.
The-Compiler commentedon May 23, 2024
I got it down from 15 minutes to 7 minutes runtime, but at this point, even just removing a handful of test files from the run makes it not reproduce anymore, from what I've tried. I don't think a minimal example is realistic at this point given that I can only get it to trigger after running >3000 test cases, but I'll keep trying to reduce it a bit more, and then do a git bisect. It will probably take me few days, unless I can get things reliable enough for a
git bisect run.The-Compiler commentedon May 27, 2024
Quick status update: After trying to reduce the test files being run one by one, I found a more minimal combination that still reliably triggers the bug:
tox -e py313-pyqt66 -- \ tests/unit/browser/test_browsertab.py \ tests/unit/browser/test_caret.py \ tests/unit/browser/test_downloadview.py \ tests/unit/browser/test_history.py \ tests/unit/browser/test_hints.py \ tests/unit/browser/test_navigate.py \ tests/unit/config/test_configdata.py \ tests/unit/config/test_configtypes.py \ tests/unit/config/test_configinit.py \ tests/unit/config/test_configfiles.py \ tests/unit/mainwindow/test_messageview.py -v -sthat's still almost 2000 tests with runtime of 4 minutes though. I'll now proceed to bisecting CPython and hope that'll help find the culprit.
The-Compiler commentedon May 27, 2024
Bisected to 992446d:
Not sure what to make of this. The change looks quite innocent, but I've double-checked it's indeed that commit that causes the memory corruption to happen.
cc @markshannon
The-Compiler commentedon May 28, 2024
I got it to fail under valgrind with
PYTHONMALLOC=malloc:Valgrind reports:
Details
I'll play around with
-X tracemallocand maybe clang's sanitizers next, in the hope that they can say something more.The-Compiler commentedon May 28, 2024
Similar result with ASan:
Details
The-Compiler commentedon May 28, 2024
I've finally been able to reduce this a lot at least within the qutebrowser project - those two tests trigger the bug as soon as the second one runs for the 1010th time.
I've not yet been able to reproduce this outside of pytest (or qutebrowser), as it still seems to be pretty sensitive about what's going on before the bug gets triggered (probably because gc related?). But at this point it looks like I should be able to cook up a minimal-ish example with a couple more hours of try and error.
The-Compiler commentedon May 28, 2024
Aaaand I arrived at a minimal example:
Crashes reliably when using a
--with-address-sanitizeror withPYTHONMALLOC=mallocfor me. With the default allocator, it needs 2-3 times, but the for loop will take care of that.@rhettinger @markshannon Hope that works? It still requires PyQt6, I have not tested yet if the string can also be from another third-party library. A normal Python string won't trigger it.
Sorry for the notification-heavy notes to myself here - since this was a longer process, I figured it'd be better to have my notes here than just for myself.
The-Compiler commentedon May 29, 2024
From the PyQt maintainer:
markshannon commentedon Jun 18, 2024
Is the string you are creating escaping to other code before it is fully initialized?
If the hash and data contradict, strange things can happen.
Can you link to the source of
qpycore_PyObject_FromQString()? That might give me a clue.vstinner commentedon Jun 18, 2024
I ran a
git bisectand the regression was introduced by: commit 992446d.vstinner commentedon Jun 18, 2024
I can reproduce the bug in a reliable way without PyQt with a debug build of Python:
Example of output:
[-]3.13b1 regression: Memory corruption (?) in str.replace[/-][+]Python 3.13b1 regression in class versionning leading to crashes[/+]7 remaining items
markshannon commentedon Jun 19, 2024
We were failing to maintain the invariant that superclass versions must be updated before subclass versions.
992446d exposed the bug.
It should be possible to cause the same failure with 992446d reverted by changing the
1010in the reproducer to ~4 billion.Add test for python#119462
GH-119462: Enforce invariants of type versioning (GH-120731)
pythonGH-119462: Enforce invariants of type versioning (pythonGH-120731)
vstinner commentedon Jun 19, 2024
Would it make sense to revert the change for now (in 3.13 and main branches), and consider a more long term approach in Python 3.14?
[3.13] GH-119462: Enforce invariants of type versioning. Backport of G…
markshannon commentedon Jun 20, 2024
@The-Compiler can you confirm that this is fixed for you on both the main and 3.13 branches?
markshannon commentedon Jun 20, 2024
It's fixed now (pending confirmation)
vstinner commentedon Jun 20, 2024
I confirm that I can no longer reproduce the #119462 (comment) crash on the 3.13 development branch. I close the issue.
The-Compiler commentedon Jun 20, 2024
The
mainbranch seems to be failing for me in ways that look to be unrelated (will dig into those at a later point); and indeed 3.13 now is working fine for me. Thanks @markshannon and @vstinner! 👍pythonGH-119462: Enforce invariants of type versioning (pythonGH-120731)
pythonGH-119462: Enforce invariants of type versioning (pythonGH-120731)
pythonGH-119462: Enforce invariants of type versioning (pythonGH-120731)