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?):