Segfault in c/test_c.py::test_callback_receiving_tiny_struct on 3.9 debug build
With 1.14.3 on the python 3.9.0 debug build, I get a segfault in c/test_c.py::test_callback_receiving_tiny_struct
c/test_c.py::test_a_lot_of_callbacks PASSED [ 4%]
c/test_c.py::test_callback_receiving_tiny_struct
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6d8c678 in cdataowninggc_repr (cd=0x7ffff6ec0c50) at /usr/include/python3.9d/object.h:630
630 return ((flags & feature) != 0);
(gdb) bt
#0 0x00007ffff6d8c678 in cdataowninggc_repr (cd=0x7ffff6ec0c50) at /usr/include/python3.9d/object.h:630
#1 cdataowninggc_repr (cd=0x7ffff6ec0c50) at c/_cffi_backend.c:2182
#2 0x0000000000468d73 in PyObject_Repr (v=v@entry=0x7ffff6ec0c50) at ../Objects/object.c:420
#3 0x0000000000469009 in PyObject_Print (op=op@entry=0x7ffff6ec0c50, fp=0x7ffff7e015c0 <_IO_2_1_stderr_>,
flags=flags@entry=0) at ../Objects/object.c:275
#4 0x00000000004691f0 in _PyObject_Dump (op=op@entry=0x7ffff6ec0c50) at ../Objects/object.c:378
#5 0x00000000004693e4 in _PyObject_AssertFailed (obj=obj@entry=0x7ffff6ec0c50, expr=expr@entry=0x0,
msg=msg@entry=0x757340 "PyObject_GC_Track() object is not valid", file=file@entry=0x756e48 "../Modules/gcmodule.c",
line=line@entry=2162, function=function@entry=0x757768 <__func__.7> "visit_validate") at ../Objects/object.c:2192
#6 0x0000000000541d1d in visit_validate (op=<optimized out>, parent_raw=0x7ffff6ec0c50) at ../Modules/gcmodule.c:2162
#7 0x00000000005442fd in PyObject_GC_Track (op_raw=op_raw@entry=0x7ffff6ec0c50) at ../Modules/gcmodule.c:2188
#8 0x00007ffff6d96b3a in b_callback (self=<optimized out>, args=<optimized out>) at c/_cffi_backend.c:6280
#9 0x000000000065da16 in cfunction_call (func=0x7ffff6dceef0, args=<optimized out>, kwargs=<optimized out>)
at ../Objects/methodobject.c:546
#10 0x0000000000430d9d in _PyObject_MakeTpCall (tstate=tstate@entry=0x9d9730, callable=callable@entry=0x7ffff6dceef0,
args=args@entry=0xf4b760, nargs=<optimized out>, keywords=keywords@entry=0x0) at ../Objects/call.c:191
#11 0x00000000004d736e in _PyObject_VectorcallTstate (tstate=0x9d9730, callable=0x7ffff6dceef0, args=0xf4b760,
nargsf=<optimized out>, kwnames=0x0) at ../Include/cpython/abstract.h:116
#12 0x00000000004da6a6 in PyObject_Vectorcall (kwnames=0x0, nargsf=9223372036854775810, args=0xf4b760,
callable=0x7ffff6dceef0) at ../Include/cpython/abstract.h:127
#13 call_function (tstate=tstate@entry=0x9d9730, pp_stack=pp_stack@entry=0x7fffffff76e0, oparg=oparg@entry=2,
kwnames=kwnames@entry=0x0) at ../Python/ceval.c:5044
#14 0x00000000004e62e7 in _PyEval_EvalFrameDefault (tstate=0x9d9730, f=0xf4b570, throwflag=<optimized out>)
at ../Python/ceval.c:3490
#15 0x0000000000430168 in _PyEval_EvalFrame (throwflag=0, f=0xf4b570, tstate=0x9d9730)
at ../Include/internal/pycore_ceval.h:40
#16 function_code_fastcall (tstate=0x9d9730, co=<optimized out>, args=0x7ffff7bca068, nargs=0, globals=<optimized out>)
at ../Objects/call.c:329
#17 0x0000000000430a05 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>,
kwnames=<optimized out>) at ../Objects/call.c:366
#18 0x0000000000430471 in PyVectorcall_Call (callable=callable@entry=0x7ffff6dd7e10, tuple=tuple@entry=0x7ffff7bca050,
kwargs=kwargs@entry=0x7ffff6d69410) at ../Include/object.h:630
#19 0x0000000000430757 in _PyObject_Call (tstate=0x9d9730, callable=callable@entry=0x7ffff6dd7e10,
args=args@entry=0x7ffff7bca050, kwargs=kwargs@entry=0x7ffff6d69410) at ../Objects/call.c:265
#20 0x00000000004307c7 in PyObject_Call (callable=callable@entry=0x7ffff6dd7e10, args=args@entry=0x7ffff7bca050,
kwargs=kwargs@entry=0x7ffff6d69410) at ../Objects/call.c:292
#21 0x00000000004da962 in do_call_core (tstate=tstate@entry=0x9d9730, func=func@entry=0x7ffff6dd7e10,
callargs=callargs@entry=0x7ffff7bca050, kwdict=kwdict@entry=0x7ffff6d69410) at ../Python/ceval.c:5092
#22 0x00000000004e6783 in _PyEval_EvalFrameDefault (tstate=0x9d9730, f=0x7ffff61a7a50, throwflag=<optimized out>)
at ../Python/ceval.c:3552
#23 0x00000000004e8628 in _PyEval_EvalFrame (throwflag=0, f=0x7ffff61a7a50, tstate=0x9d9730)
at ../Include/internal/pycore_ceval.h:40
#24 _PyEval_EvalCode (tstate=0x9d9730, _co=0x7ffff7191ba0, globals=<optimized out>, locals=locals@entry=0x0,
args=<optimized out>, argcount=1, kwnames=0x0, kwargs=0x7ffff5be4160, kwcount=0, kwstep=1, defs=0x0, defcount=0,
kwdefs=0x0, closure=0x0, name=0x7ffff7361fa0, qualname=0x7ffff7361fa0) at ../Python/ceval.c:4299
#25 0x0000000000430910 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>,
kwnames=<optimized out>) at ../Include/object.h:630
#26 0x0000000000430471 in PyVectorcall_Call (callable=callable@entry=0x7ffff71a9a50, tuple=tuple@entry=0x7ffff5be4140,
kwargs=kwargs@entry=0x0) at ../Include/object.h:630
#27 0x0000000000430757 in _PyObject_Call (tstate=0x9d9730, callable=callable@entry=0x7ffff71a9a50,
args=args@entry=0x7ffff5be4140, kwargs=kwargs@entry=0x0) at ../Objects/call.c:265
#28 0x00000000004307c7 in PyObject_Call (callable=callable@entry=0x7ffff71a9a50, args=args@entry=0x7ffff5be4140,
kwargs=kwargs@entry=0x0) at ../Objects/call.c:292
#29 0x00000000004da962 in do_call_core (tstate=tstate@entry=0x9d9730, func=func@entry=0x7ffff71a9a50,
callargs=callargs@entry=0x7ffff5be4140, kwdict=kwdict@entry=0x0) at ../Python/ceval.c:5092
#30 0x00000000004e6783 in _PyEval_EvalFrameDefault (tstate=0x9d9730, f=0xf71bc0, throwflag=<optimized out>)
at ../Python/ceval.c:3552
#31 0x00000000004e8628 in _PyEval_EvalFrame (throwflag=0, f=0xf71bc0, tstate=0x9d9730)
at ../Include/internal/pycore_ceval.h:40
#32 _PyEval_EvalCode (tstate=0x9d9730, _co=0x7ffff7520450, globals=<optimized out>, locals=locals@entry=0x0,
args=<optimized out>, argcount=2, kwnames=0x7ffff7590838, kwargs=0xf649a8, kwcount=1, kwstep=1, defs=0x7ffff751f518,
defcount=1, kwdefs=0x0, closure=0x0, name=0x7ffff7521160, qualname=0x7ffff7521160) at ../Python/ceval.c:4299
#33 0x0000000000430910 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>,
...
Edited by Stefano Rivera