Skip to content

UBSan: Calling a function through pointer to incorrect function type is undefined behavior #111178

Closed

Description

@chrstphrchvz

Bug report

Bug description:

UBSan (UndefinedBehaviorSanitizer) in LLVM.org Clang 17 makes -fsanitize=function available for C; previously, it was only for C++. (So it may also be made available in future Apple Xcode clang and GCC.) By default, it is implied by -fsanitize=undefined (which is what ./configure --with-undefined-behavior-sanitizer uses), but it can be disabled using -fno-sanitize=function.

For a project such as CPython, which has long relied on function pointers for callbacks, yet seems to have only required that callbacks behave as expected under typical ABI calling conventions, rather than more strictly be declared/defined as a type compatible with the function pointer they will be called as, this leads to numerous errors from UBSan.

Examples when starting Python REPL:
% ./python.exe           
Objects/object.c:2731:5: runtime error: call to function list_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
listobject.c:347: note: list_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:2731:5 in 
Objects/object.c:878:16: runtime error: call to function long_hash through pointer to incorrect function type 'long (*)(struct _object *)'
longobject.c:3295: note: long_hash defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:878:16 in 
Include/internal/pycore_object.h:365:43: runtime error: call to function type_is_gc through pointer to incorrect function type 'int (*)(struct _object *)'
typeobject.c:5347: note: type_is_gc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Include/internal/pycore_object.h:365:43 in 
Objects/abstract.c:157:26: runtime error: call to function dict_subscript through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *)'
dictobject.c:2511: note: dict_subscript defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:157:26 in 
Objects/abstract.c:2954:14: runtime error: call to function tupleiter_next through pointer to incorrect function type 'struct _object *(*)(struct _object *)'
tupleobject.c:999: note: tupleiter_next defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:2954:14 in 
Objects/abstract.c:236:19: runtime error: call to function dict_ass_sub through pointer to incorrect function type 'int (*)(struct _object *, struct _object *, struct _object *)'
dictobject.c:2546: note: dict_ass_sub defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:236:19 in 
Objects/call.c:242:18: runtime error: call to function type_call through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
typeobject.c:1647: note: type_call defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/call.c:242:18 in 
Objects/typeobject.c:10309:24: runtime error: call to function classmethod_get through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
descrobject.c:94: note: classmethod_get defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:10309:24 in 
Modules/gcmodule.c:493:16: runtime error: call to function list_traverse through pointer to incorrect function type 'int (*)(struct _object *, int (*)(struct _object *, void *), void *)'
listobject.c:2704: note: list_traverse defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Modules/gcmodule.c:493:16 in 
Modules/gcmodule.c:605:20: runtime error: call to function list_traverse through pointer to incorrect function type 'int (*)(struct _object *, int (*)(struct _object *, void *), void *)'
listobject.c:2704: note: list_traverse defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Modules/gcmodule.c:605:20 in 
Objects/dictobject.c:3569:17: runtime error: call to function visit_reachable through pointer to incorrect function type 'int (*)(struct _object *, void *)'
gcmodule.c:502: note: visit_reachable defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/dictobject.c:3569:17 in 
Objects/descrobject.c:694:5: runtime error: call to function visit_reachable through pointer to incorrect function type 'int (*)(struct _object *, void *)'
gcmodule.c:502: note: visit_reachable defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/descrobject.c:694:5 in 
[…]
Objects/typeobject.c:4892:19: runtime error: call to function classmethod_get through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
descrobject.c:94: note: classmethod_get defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:4892:19 in 
Python/generated_cases.c.h:3859:17: runtime error: call to function func_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
funcobject.c:913: note: func_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3859:17 in 
Objects/object.c:1442:19: runtime error: call to function member_get through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
descrobject.c:160: note: member_get defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1442:19 in 
Objects/object.c:1503:15: runtime error: call to function method_get through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
descrobject.c:136: note: method_get defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1503:15 in 
Python/generated_cases.c.h:3857:13: runtime error: call to function meth_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
methodobject.c:160: note: meth_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3857:13 in 
Objects/typeobject.c:2212:19: runtime error: call to function method_get through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
descrobject.c:136: note: method_get defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:2212:19 in 
Objects/descrobject.c:188:16: runtime error: call to function func_get_name through pointer to incorrect function type 'struct _object *(*)(struct _object *, void *)'
funcobject.c:582: note: func_get_name defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/descrobject.c:188:16 in 
Python/generated_cases.c.h:3248:20: runtime error: call to function tupleiter_next through pointer to incorrect function type 'struct _object *(*)(struct _object *)'
tupleobject.c:999: note: tupleiter_next defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3248:20 in 
Objects/object.c:1564:19: runtime error: call to function member_set through pointer to incorrect function type 'int (*)(struct _object *, struct _object *, struct _object *)'
descrobject.c:227: note: member_set defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1564:19 in 
Objects/descrobject.c:241:16: runtime error: call to function func_set_name through pointer to incorrect function type 'int (*)(struct _object *, struct _object *, void *)'
funcobject.c:588: note: func_set_name defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/descrobject.c:241:16 in 
Python/generated_cases.c.h:3364:21: runtime error: call to function tupleiter_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:984: note: tupleiter_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3364:21 in 
Python/ceval.c:591:5: runtime error: call to function func_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
funcobject.c:913: note: func_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/ceval.c:591:5 in 
Objects/object.c:1031:18: runtime error: call to function _Py_module_getattro through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *)'
moduleobject.c:877: note: _Py_module_getattro defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1031:18 in 
Objects/abstract.c:2895:25: runtime error: call to function dictitems_iter through pointer to incorrect function type 'struct _object *(*)(struct _object *)'
dictobject.c:5180: note: dictitems_iter defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:2895:25 in 
Python/generated_cases.c.h:3193:13: runtime error: call to function dictview_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
dictobject.c:4587: note: dictview_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3193:13 in 
Python/ceval.c:1929:13: runtime error: call to function tupleiter_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:984: note: tupleiter_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/ceval.c:1929:13 in 
Objects/abstract.c:2334:19: runtime error: call to function tuplecontains through pointer to incorrect function type 'int (*)(struct _object *, struct _object *)'
tupleobject.c:354: note: tuplecontains defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:2334:19 in 
Objects/typeobject.c:1698:19: runtime error: call to function AttributeError_init through pointer to incorrect function type 'int (*)(struct _object *, struct _object *, struct _object *)'
exceptions.c:2279: note: AttributeError_init defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:1698:19 in 
Python/generated_cases.c.h:1351:13: runtime error: call to function AttributeError_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
exceptions.c:2315: note: AttributeError_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:1351:13 in 
Python/generated_cases.c.h:623:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:623:13 in 
Python/generated_cases.c.h:749:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:749:13 in 
Python/generated_cases.c.h:3809:17: runtime error: call to function method_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
classobject.c:236: note: method_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3809:17 in 
Objects/descrobject.c:393:24: runtime error: call to function dict_pop through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *const *, long)'
dictobject.c.h:138: note: dict_pop defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/descrobject.c:393:24 in 
Python/generated_cases.c.h:3260:17: runtime error: call to function dictiter_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
dictobject.c:4047: note: dictiter_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3260:17 in 
Objects/object.c:1699:15: runtime error: call to function long_bool through pointer to incorrect function type 'int (*)(struct _object *)'
longobject.c:4890: note: long_bool defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1699:15 in 
Python/generated_cases.c.h:4816:13: runtime error: call to function dict_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
dictobject.c:2373: note: dict_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4816:13 in 
Python/generated_cases.c.h:3896:17: runtime error: call to function method_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
classobject.c:236: note: method_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3896:17 in 
Python/generated_cases.c.h:4625:19: runtime error: call to function dict_pop through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *const *, long)'
dictobject.c.h:138: note: dict_pop defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4625:19 in 
Objects/descrobject.c:467:24: runtime error: call to function list_append through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *)'
listobject.c:842: note: list_append defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/descrobject.c:467:24 in 
Include/internal/pycore_object.h:142:9: runtime error: call to function PyObject_Free through pointer to incorrect function type 'void (*)(struct _object *)'
obmalloc.c:829: note: PyObject_Free defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Include/internal/pycore_object.h:142:9 in 
Objects/call.c:361:18: runtime error: call to function type_call through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
typeobject.c:1647: note: type_call defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/call.c:361:18 in 
Python/generated_cases.c.h:2931:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2931:13 in 
Python/generated_cases.c.h:3362:25: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3362:25 in 
Python/generated_cases.c.h:928:13: runtime error: call to function list_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
listobject.c:347: note: list_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:928:13 in 
Python/ceval.c:1604:5: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/ceval.c:1604:5 in 
Python/bltinmodule.c:378:16: runtime error: call to function gen_iternext through pointer to incorrect function type 'struct _object *(*)(struct _object *)'
genobject.c:609: note: gen_iternext defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/bltinmodule.c:378:16 in 
Objects/object.c:1702:15: runtime error: call to function list_length through pointer to incorrect function type 'long (*)(struct _object *)'
listobject.c:438: note: list_length defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1702:15 in 
Python/generated_cases.c.h:3519:13: runtime error: call to function method_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
classobject.c:236: note: method_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3519:13 in 
Objects/methodobject.c:540:18: runtime error: call to function rlock_acquire through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *, struct _object *)'
_threadmodule.c:314: note: rlock_acquire defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/methodobject.c:540:18 in 
Python/generated_cases.c.h:2767:13: runtime error: call to function list_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
listobject.c:347: note: list_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2767:13 in 
Objects/methodobject.c:551:18: runtime error: call to function rlock_release through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct _object *)'
_threadmodule.c:364: note: rlock_release defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/methodobject.c:551:18 in 
Objects/typeobject.c:2096:5: runtime error: call to function list_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
listobject.c:347: note: list_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:2096:5 in 
Python/generated_cases.c.h:130:13: runtime error: call to function method_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
classobject.c:236: note: method_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:130:13 in 
Objects/object.c:1181:15: runtime error: call to function type_setattro through pointer to incorrect function type 'int (*)(struct _object *, struct _object *, struct _object *)'
typeobject.c:4938: note: type_setattro defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1181:15 in 
Python/generated_cases.c.h:1510:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (*)(struct _object *)'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:1510:13 in 
Python/generated_cases.c.h:164:13: runtime error: call to function listiter_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
listobject.c:3222: note: listiter_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:164:13 in 
[…]

Modules/gcmodule.c:1033:24: runtime error: call to function _list_clear through pointer to incorrect function type 'int (*)(struct _object )'
listobject.c:597: note: _list_clear defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Modules/gcmodule.c:1033:24 in
Objects/abstract.c:62:26: runtime error: call to function list_length through pointer to incorrect function type 'long (
)(struct _object )'
listobject.c:438: note: list_length defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:62:26 in
Objects/abstract.c:270:19: runtime error: call to function dict_ass_sub through pointer to incorrect function type 'int (
)(struct _object *, struct _object *, struct _object *)'
dictobject.c:2546: note: dict_ass_sub defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:270:19 in
Python/bltinmodule.c:329:16: runtime error: call to function gen_iternext through pointer to incorrect function type 'struct _object ()(struct _object *)'
genobject.c:609: note: gen_iternext defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/bltinmodule.c:329:16 in
Objects/abstract.c:1141:18: runtime error: call to function tupleconcat through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object )'
tupleobject.c:443: note: tupleconcat defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:1141:18 in
Objects/abstract.c:440:15: runtime error: call to function bytes_buffer_getbuffer through pointer to incorrect function type 'int (
)(struct _object *, Py_buffer *, int)'
bytesobject.c:1663: note: bytes_buffer_getbuffer defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:440:15 in
Objects/methodobject.c:441:24: runtime error: call to function int_from_bytes through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object *const *, long, struct _object )'
longobject.c.h:396: note: int_from_bytes defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/methodobject.c:441:24 in
[…]
Python/generated_cases.c.h:4814:13: runtime error: call to function method_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
classobject.c:236: note: method_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4814:13 in
Python/generated_cases.c.h:4815:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (
)(struct _object )'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4815:13 in
Python/generated_cases.c.h:1529:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (
)(struct _object )'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:1529:13 in
Python/generated_cases.c.h:648:17: runtime error: call to function slice_dealloc through pointer to incorrect function type 'void (
)(struct _object *)'
sliceobject.c:359: note: slice_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:648:17 in
Objects/abstract.c:953:13: runtime error: call to function long_add through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object )'
longobject.c:3473: note: long_add defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:953:13 in
Python/generated_cases.c.h:3322:21: runtime error: call to function listiter_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
listobject.c:3222: note: listiter_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3322:21 in
Python/generated_cases.c.h:2821:13: runtime error: call to function PyObject_Free through pointer to incorrect function type 'void (
)(struct _object *)'
obmalloc.c:829: note: PyObject_Free defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2821:13 in
Objects/listobject.c:946:26: runtime error: call to function gen_iternext through pointer to incorrect function type 'struct _object ()(struct _object *)'
genobject.c:609: note: gen_iternext defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/listobject.c:946:26 in
Python/generated_cases.c.h:4503:19: runtime error: call to function list_extend through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object )'
listobject.c:861: note: list_extend defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4503:19 in
Python/generated_cases.c.h:4507:13: runtime error: call to function gen_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
genobject.c:128: note: gen_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4507:13 in
Python/generated_cases.c.h:2378:17: runtime error: call to function structseq_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
structseq.c:119: note: structseq_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2378:17 in
Python/ceval.c:1605:5: runtime error: call to function dict_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
dictobject.c:2373: note: dict_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/ceval.c:1605:5 in
Python/generated_cases.c.h:1548:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (
)(struct _object *)'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:1548:13 in
Objects/descrobject.c:439:24: runtime error: call to function _io_FileIO_isatty through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object *)'
fileio.c.h:532: note: _io_FileIO_isatty defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/descrobject.c:439:24 in
Objects/methodobject.c:484:24: runtime error: call to function _io_FileIO_readall through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object *)'
fileio.c.h:284: note: _io_FileIO_readall defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/methodobject.c:484:24 in
Objects/descrobject.c:372:24: runtime error: call to function _io_FileIO_close through pointer to incorrect function type 'struct _object ()(struct _object *, struct _typeobject *, struct _object *const *, unsigned long, struct _object *)'
fileio.c.h:29: note: _io_FileIO_close defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/descrobject.c:372:24 in
Objects/object.c:783:15: runtime error: call to function bytes_richcompare through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object , int)'
bytesobject.c:1524: note: bytes_richcompare defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:783:15 in
Python/generated_cases.c.h:650:13: runtime error: call to function memory_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
memoryobject.c:1141: note: memory_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:650:13 in
Objects/abstract.c:804:9: runtime error: call to function memory_releasebuf through pointer to incorrect function type 'void (
)(struct _object *, Py_buffer *)'
memoryobject.c:1593: note: memory_releasebuf defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:804:9 in
Objects/abstract.c:1950:25: runtime error: call to function list_item through pointer to incorrect function type 'struct _object ()(struct _object , long)'
listobject.c:460: note: list_item defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/abstract.c:1950:25 in
Modules/timemodule.c:2087:5: runtime error: call to function visit_reachable through pointer to incorrect function type 'int (
)(struct _object *, void )'
gcmodule.c:502: note: visit_reachable defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Modules/timemodule.c:2087:5 in
Python/generated_cases.c.h:2660:21: runtime error: call to function set_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
setobject.c:489: note: set_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2660:21 in
Python/generated_cases.c.h:4440:13: runtime error: call to function tupledealloc through pointer to incorrect function type 'void (
)(struct _object )'
tupleobject.c:187: note: tupledealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4440:13 in
Python/generated_cases.c.h:2822:13: runtime error: call to function PyObject_Free through pointer to incorrect function type 'void (
)(struct _object )'
obmalloc.c:829: note: PyObject_Free defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2822:13 in
Python/generated_cases.c.h:2157:13: runtime error: call to function dict_dealloc through pointer to incorrect function type 'void (
)(struct _object *)'
dictobject.c:2373: note: dict_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2157:13 in
Objects/typeobject.c:4872:19: runtime error: call to function getset_get through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object *, struct _object )'
descrobject.c:180: note: getset_get defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:4872:19 in
Python/generated_cases.c.h:4730:17: runtime error: call to function func_dealloc through pointer to incorrect function type 'void (
)(struct _object *)'
funcobject.c:913: note: func_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:4730:17 in
Objects/typeobject.c:4905:15: runtime error: call to function method_get through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object *, struct _object )'
descrobject.c:136: note: method_get defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:4905:15 in
Objects/typeobject.c:1863:16: runtime error: call to function tupletraverse through pointer to incorrect function type 'int (
)(struct _object , int ()(struct _object *, void *), void *)'
tupleobject.c:606: note: tupletraverse defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/typeobject.c:1863:16 in
[…]
Include/internal/pycore_call.h:187:11: runtime error: call to function range_vectorcall through pointer to incorrect function type 'struct _object ()(struct _object *, struct _object *const *, unsigned long, struct _object )'
rangeobject.c:148: note: range_vectorcall defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Include/internal/pycore_call.h:187:11 in
Python/generated_cases.c.h:2878:13: runtime error: call to function mappingproxy_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
descrobject.c:1160: note: mappingproxy_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2878:13 in
Python/generated_cases.c.h:3320:25: runtime error: call to function list_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
listobject.c:347: note: list_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3320:25 in
Python/generated_cases.c.h:2766:13: runtime error: call to function set_dealloc through pointer to incorrect function type 'void (
)(struct _object )'
setobject.c:489: note: set_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:2766:13 in
Modules/_abc.c:52:5: runtime error: call to function visit_reachable through pointer to incorrect function type 'int (
)(struct _object *, void *)'
gcmodule.c:502: note: visit_reachable defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Modules/_abc.c:52:5 in
Python/bltinmodule.c:1408:25: runtime error: call to function tupleiter_next through pointer to incorrect function type 'struct _object ()(struct _object )'
tupleobject.c:999: note: tupleiter_next defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/bltinmodule.c:1408:25 in
Python/generated_cases.c.h:673:17: runtime error: call to function slice_dealloc through pointer to incorrect function type 'void (
)(struct _object *)'
sliceobject.c:359: note: slice_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:673:17 in


(Omitting remaining errors due to GitHub comment length limit.)


Python 3.13.0a1+ (heads/patch-103194-dirty:0a6e69f9a2, Oct 21 2023, 14:45:09) [Clang 17.0.3 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Example workaround for the first error and likely many others, where instead of casting functions to incompatible pointers, the functions use compatible signatures and cast their parameter(s):

--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -343,8 +343,9 @@ PyList_Append(PyObject *op, PyObject *newitem)
 /* Methods */
 
 static void
-list_dealloc(PyListObject *op)
+list_dealloc(PyObject *self)
 {
+    PyListObject *op = (PyListObject *)self;
     Py_ssize_t i;
     PyObject_GC_UnTrack(op);
     Py_TRASHCAN_BEGIN(op, list_dealloc)
@@ -3104,7 +3105,7 @@ PyTypeObject PyList_Type = {
     "list",
     sizeof(PyListObject),
     0,
-    (destructor)list_dealloc,                   /* tp_dealloc */
+    list_dealloc,                               /* tp_dealloc */
     0,                                          /* tp_vectorcall_offset */
     0,                                          /* tp_getattr */
     0,                                          /* tp_setattr */

In other cases, it may be less disruptive to introduce a wrapper function with the correct signature:

@@ -615,6 +617,13 @@ _list_clear(PyListObject *a)
     return 0;
 }
 
+static int
+_list_clear_wrap(PyObject *self)
+{
+    PyListObject *a = (PyListObject *)self;
+    return _list_clear(a);
+}
+
 /* a[ilow:ihigh] = v if v != NULL.
  * del a[ilow:ihigh] if v == NULL.
  *
@@ -3123,7 +3133,7 @@ PyTypeObject PyList_Type = {
         _Py_TPFLAGS_MATCH_SELF | Py_TPFLAGS_SEQUENCE,  /* tp_flags */
     list___init____doc__,                       /* tp_doc */
     (traverseproc)list_traverse,                /* tp_traverse */
-    (inquiry)_list_clear,                       /* tp_clear */
+    _list_clear_wrap,                           /* tp_clear */
     list_richcompare,                           /* tp_richcompare */
     0,                                          /* tp_weaklistoffset */
     list_iter,                                  /* tp_iter */

Likely instances of this can be found at compile time using e.g. -Wcast-function-type (although this emits false positives for when the function pointer is cast back to the correct type before called, and this warning is suppressed by intermediate casts through (void *)):

Objects/listobject.c:3162:5: warning: cast from 'void (*)(PyListObject *)' to 'destructor' (aka 'void (*)(struct _object *)') converts to incompatible function type [-Wcast-function-type-strict]
 3162 |     (destructor)list_dealloc,                   /* tp_dealloc */
      |     ^~~~~~~~~~~~~~~~~~~~~~~~

I would be interested in combing through and replacing similar instances. But I would not be surprised if sooner or later I encounter an instance that is won’t-fix because it involves a stable API, or if I am told that this problem should be ignored because fixing it is too disruptive or requires disproportionate review effort. I am not aware how immediate any danger is from optimizing compilers exploiting this type of undefined behavior.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS


Written by @picnixz:

See #111178 (comment) for the remaining files to fix.

For detecting the UBSan failures, contributors may configure Python with:

./configure                                                 \
    --with-pydebug                                          \
    --prefix="$(pwd)/build"                                 \
    CC=clang LD=clang                                       \
    CFLAGS="-fsanitize=function     -fsanitize-recover"     \
    LDFLAGS="-fsanitize=function    -fsanitize-recover"

The complete list of failures can be retrieved as follows:

PAT='runtime error: call to function (\w+) through pointer' && \
make -j12 2>&1 >/dev/null | \
    grep -E "$PAT" | \
    sed -r "s#^(.+): $PAT.+#\1@\2#g" | \
    sort -k1,2 -t@ -u | \
    awk 'BEGIN {
            PROCINFO["sorted_in"]="@ind_num_asc";
            FS=SUBSEP="@"
        } {
            A[$1][length(A[$1])+1]=$2
        } END {
            for (m in A) {
                for (i in A[m]) {
                    if (i == 1) printf "%s\n", m;
                    print "#", A[m][i]
                }
                print ""
            }
        }' | \
    sed -r "s#"$(pwd)"/?(\./)?(.+)#\2#g"

Note that different builds should be configured in order to hunt all UBSan failures (e.g., --with-trace-refs or --disable-gil to expose conditional compiled code guarded by macros).


Note by @encukou:

We use the macro _Py_NO_SANITIZE_UNDEFINED to disable the UB sanitizer in some hard-to-fix cases, so that we can get a stable, regression-monitoring checker sooner. This issue should only be closed after the macro is removed.


Linked PRs

Activity

  1. gpshead commented on Dec 6, 2023

    @gpshead
    Member

    how likely is it that instances of this issue will keep being introduced or reintroduced, at least without greater awareness and acceptance of the relevant C rules? How much does having CI run with -fsanitize=function or even -Werror=cast-function-type help prevent this?

    It helps. Particularly once we've gotten to a stable point so that the ubsan build is not Red again. As people notice when things start failing after a change.

    I believe a lot of what we do within our C code for these design patterns is cargo cult from other existing examples. So if we've cleaned things up in a consistent manner, including the code generators, to do something in a "right" way, that'll naturally become what gets done in new code.

  2. added a commit that references this issue on Dec 6, 2023
  3. added 2 commits that reference this issue on Dec 6, 2023
  4. added 2 commits that reference this issue on Dec 6, 2023
  5. encukou commented on Dec 6, 2023

    @encukou
    Member

    I have opened a couple of PRs for a few examples of this issue. I intended to separate them by codeowner(s), if that is helpful.

    It'll cut down on spurious GitHub notifications. I expect codeowners to be experts in the application logic much more than in C minutiæ, so they aren't necessarily the right reviewers to ping.
    I'd still wait for them about a week after approving PRs.

    For files without codeowners, a good strategy might be to open a PR each after the old one is merged, with files that are reasonably “done” (e.g. no more function casts in the PyTypeObject definitions). Or if some area is getting too many conflicts, single it out.

    You don't need to keep PR branches up to date, if there are no conflicts -- that eats CI time.

    I can't promise my availability this year, but starting January I could be your default reviewer :)

  6. added a commit that references this issue on Dec 6, 2023
  7. chrstphrchvz commented on Dec 10, 2023

    @chrstphrchvz
    ContributorAuthor

    Regarding PyMethodDef instances: what is important for this issue is whether the function in .ml_meth is compatible with the type indicated by .ml_flags. So I think _PyCFunction_CAST() should not be used in cases where the function should already be compatible with PyCFunction since that is the type it will be called as, and avoid e.g. using types other than PyObject * for the first parameter. _PyCFunction_CAST() still seems useful for functions which are not going to be called as PyCFunction, although trying to use -Wcast-function-type to find likely undefined behavior will also flag such _PyCFunction_CAST() usage.

    Example:

    {"__sizeof__", _PyCFunction_CAST(dict_sizeof), METH_NOARGS,

    METH_NOARGS means dict_sizeof() is going to be called as PyCFunction, so it should be made compatible with that type, and using _PyCFunction_CAST() would then be redundant:

    @@ -3704,8 +3704,9 @@ _PyDict_KeysSize(PyDictKeysObject *keys)
     }
     
     static PyObject *
    -dict_sizeof(PyDictObject *mp, PyObject *Py_UNUSED(ignored))
    +dict_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored))
     {
    +    PyDictObject *mp = (PyDictObject *)self;
         return PyLong_FromSsize_t(_PyDict_SizeOf(mp));
     }
     
    @@ -3769,7 +3770,7 @@ static PyMethodDef mapp_methods[] = {
         DICT___CONTAINS___METHODDEF
         {"__getitem__",     dict_subscript,                 METH_O | METH_COEXIST,
          getitem__doc__},
    -    {"__sizeof__",      _PyCFunction_CAST(dict_sizeof),       METH_NOARGS,
    +    {"__sizeof__",      dict_sizeof,                    METH_NOARGS,
          sizeof__doc__},
         DICT_GET_METHODDEF
         DICT_SETDEFAULT_METHODDEF

    Another example:

    {"get", _PyCFunction_CAST(mappingproxy_get), METH_FASTCALL,

    METH_FASTCALL means that although mappingproxy_get() is not going to be called as PyCFunction, and so using _PyCFunction_CAST() seems fine, it is eventually called as _PyCFunctionFast and should be made compatible with that type:

    --- a/Objects/descrobject.c
    +++ b/Objects/descrobject.c
    @@ -1107,8 +1107,9 @@ static PySequenceMethods mappingproxy_as_sequence = {
     };
     
     static PyObject *
    -mappingproxy_get(mappingproxyobject *pp, PyObject *const *args, Py_ssize_t nargs)
    +mappingproxy_get(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
     {
    +    mappingproxyobject *pp = (mappingproxyobject *)self;
         /* newargs: mapping, key, default=None */
         PyObject *newargs[3];
         newargs[0] = pp->mapping;
  8. added a commit that references this issue on Dec 11, 2023
  9. added 2 commits that reference this issue on Dec 11, 2023
  10. added a commit that references this issue on Dec 20, 2023
  11. added a commit that references this issue on Dec 26, 2023
  12. added 4 commits that reference this issue on Jan 2, 2024
  13. encukou commented on Jan 2, 2024

    @encukou
    Member

    I've been applying “skip news” labels to the PRs, but IMO this should have a news entry -- possibly an aggregate one added in a separate PR.
    You're the best person to word that, but I can also add it, if you'd like.


    So I think _PyCFunction_CAST() should not be used in cases where the function should already be compatible with PyCFunction since that is the type it will be called as

    +1

    _PyCFunction_CAST() still seems useful for functions which are not going to be called as PyCFunction, although trying to use -Wcast-function-type to find likely undefined behavior will also flag such _PyCFunction_CAST() usage.

    IMO, we need a better API here -- a proper tagged union. Let's leave that as the last step?
    Until then, ignoring the benign warnings about _PyCFunction_CAST seems like the best way to go.

  14. added 5 commits that reference this issue on Jan 22, 2024
  15. added 8 commits that reference this issue on Feb 11, 2024
  16. added a commit that references this issue on Aug 14, 2024
  17. picnixz commented on Aug 14, 2024

    @picnixz
    Member

    There are some additional advantages that we can gain by doing the right modifications (apart from avoiding UBs):

    • By using a non-specialized type in the signature, we don't need to cast the object back to PyObject * when calling other functions (with the correct signature). This is sometimes useful but I cannot estimate how frequent this is. On the other hand, we would only gain if the functions we are calling are indeed expecting PyObject * objects and not specialized objects.

    • By using a non-specialized type, we would get rid of all (funcptr)func casts when declaring PyTypeObject or protocol implementations. This could make the code cleaner.

    Because of the sheer amount of work to do (I just looked at what I needed to do, fixed 1-2 things and then gave up), I suggest adding a new build bot with -fsanitize=undefined -fno-sanitize=function -fsanitize-recover. That way, we could catch the other undefined behaviours that are not due to those casts. Currently, the build bot fails fast (and we only see 1 UB per build due to the -fno-sanitize-recover) but I think that most of the time, we won't have a lot of UBs (or else it's bad for us...). As such, having a build bot that builds entirely (with -fsanitize-recover) instead of fast-failing would help a lot in detecting the other cases.

    Once this new build bot is green, we can focus on eliminating the UBs related to function pointers.

    Note: see #123004 (comment) for what was detected as a first pass. I suspect there are UBs that are not detected but that's for another day.

  18. encukou commented on Aug 14, 2024

    @encukou
    Member

    IMO, you should reopen python/buildmaster-config#517 if you're fixing that. This issue is not about the buildbot.

  19. picnixz commented on Aug 14, 2024

    @picnixz
    Member

    Mmmh. Yes, it's better. I'll re-open the other one to discuss the future of this build bot.

  20. added a commit that references this issue on Aug 22, 2024
  21. added 8 commits that reference this issue on Sep 2, 2024
  22. added a commit that references this issue on Sep 27, 2024
  23. picnixz commented on Sep 28, 2024

    @picnixz
    Member

    See the issue for the script printing the UBSan failures.

  24. added 20 commits that reference this issue on Sep 30, 2024
  25. added 20 commits that reference this issue on Oct 2, 2024
  26. added 2 commits that reference this issue on Oct 4, 2024
  27. vstinner commented on Oct 4, 2024

    @vstinner
    Member

    I pushed a serie of changes to reduce the number of undefined behavior: fix the function signatures.

    On the current main branch, running make and python -c pass warns about 39 function calls:

    AttributeError_init
    builtin_id
    bytes_decode
    cell_clear
    code_hash
    del_extensions_cache_value
    deque_len
    dict_fromkeys
    dict_items
    dict_pop
    generic_init_subclass
    gen_iternext
    get_blksize
    get_closed
    ImportError_dealloc
    inst_seq_traverse
    int_from_bytes
    _io_FileIO_close
    _io_FileIO_readall
    list_append
    list_extend
    local_traverse
    lru_cache_call
    match_group
    namespace_traverse
    partial_call
    partial_vectorcall
    pickle_free
    PyObject_Free
    range_subscript
    reversed_next
    set_done
    set_pop
    tb_traverse
    tupleiter_dealloc
    type_set_abstractmethods
    type_set_annotations
    typevar_typing_prepare_subst
    unicode_ascii_iter_next
    
  28. vstinner commented on Oct 4, 2024

    @vstinner
    Member

    PyObject_Free

    The problem comes from types using .tp_dealloc = (destructor)PyObject_Free: tp_dealloc prototype is:

    typedef void (*destructor)(PyObject *);
    

    whereas PyObject_Free() uses:

    void PyObject_Free(void *ptr)
    

    Having to add a wrapper function to cast PyObject* to void* sounds unconvenient and slow :-(


    list_append

    PyCFunction expects PyObject*:

    typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
    

    whereas list_append() in Objects/clinic/listobject.c.h expects PyListObject*:

    static PyObject* list_append(PyListObject *self, PyObject *object)
    

    This code is generated by Argument Clinic.

  29. picnixz commented on Oct 4, 2024

    @picnixz
    Member

    Here are the locations of all errors (on latest main):

    Details
    Include/internal/pycore_call.h:167:11
    # partial_vectorcall
    
    Include/internal/pycore_object.h:231:9
    # PyObject_Free
    
    Objects/abstract.c:158:26
    # range_subscript
    
    Objects/abstract.c:2874:18
    # gen_iternext
    
    Objects/abstract.c:63:26
    # deque_len
    
    Objects/call.c:242:18
    # partial_call
    
    Objects/call.c:361:18
    # lru_cache_call
    
    Objects/descrobject.c:193:16
    # get_blksize
    
    Objects/descrobject.c:249:16
    # type_set_abstractmethods
    
    Objects/descrobject.c:324:24
    # match_group
    
    Objects/descrobject.c:380:24
    # _io_FileIO_close
    
    Objects/descrobject.c:401:24
    # dict_pop
    
    Objects/descrobject.c:420:24
    # bytes_decode
    
    Objects/descrobject.c:447:24
    # dict_items
    
    Objects/descrobject.c:475:24
    # list_append
    
    Objects/listobject.c:1194:26
    # gen_iternext
    
    Objects/methodobject.c:436:24
    # dict_fromkeys
    
    Objects/methodobject.c:452:24
    # int_from_bytes
    
    Objects/methodobject.c:495:24
    # _io_FileIO_readall
    
    Objects/methodobject.c:523:24
    # _io_TextIOWrapper_write
    # type___subclasscheck__
    
    Objects/methodobject.c:551:18
    # generic_init_subclass
    
    Objects/moduleobject.c:784:9
    # pickle_free
    
    Objects/object.c:1066:16
    # code_hash
    
    Objects/object.c:1857:15
    # deque_len
    
    Objects/object.c:2888:5
    # tupleiter_dealloc
    
    Objects/typeobject.c:2184:19
    # AttributeError_init
    
    Objects/typeobject.c:2353:16
    # local_traverse
    
    Objects/typeobject.c:2575:5
    # ImportError_dealloc
    
    Python/bltinmodule.c:1434:25
    # unicode_ascii_iter_next
    
    Python/bltinmodule.c:1547:11
    # gen_iternext
    
    Python/bltinmodule.c:2979:20
    # reversed_next
    
    Python/bltinmodule.c:3002:20
    # reversed_next
    
    Python/bltinmodule.c:323:16
    # gen_iternext
    
    Python/bltinmodule.c:372:16
    # gen_iternext
    
    Python/gc.c:1126:24
    # cell_clear
    
    Python/gc.c:1408:16
    # namespace_traverse
    
    Python/gc.c:2023:11
    # inst_seq_traverse
    # tb_traverse
    
    Python/gc.c:568:16
    # namespace_traverse
    
    Python/gc.c:685:20
    # namespace_traverse
    
    Python/generated_cases.c.h:1366:35
    # typevar_typing_prepare_subst
    
    Python/generated_cases.c.h:1514:35
    # list_append
    
    Python/generated_cases.c.h:2268:35
    # dict_pop
    
    Python/generated_cases.c.h:2349:35
    # bytes_decode
    
    Python/generated_cases.c.h:2420:35
    # set_pop
    
    Python/generated_cases.c.h:2488:35
    # list_extend
    
    Python/generated_cases.c.h:3628:36
    # unicode_ascii_iter_next
    
    Python/hashtable.c:385:9
    # del_extensions_cache_value
    
    Python/lock.c:330:23
    # set_done
    
  30. added 4 commits that reference this issue on Oct 5, 2024
  31. added 5 commits that reference this issue on Oct 9, 2024
  32. added a commit that references this issue on Dec 16, 2024
  33. added a commit that references this issue on Jan 3, 2025
  34. added 5 commits that reference this issue on Jan 3, 2025
  35. added 5 commits that reference this issue on Jan 4, 2025
  36. added 3 commits that reference this issue on Jan 6, 2025
  37. added 9 commits that reference this issue on Jan 8, 2025
  38. added 10 commits that reference this issue on Jan 8, 2025
  39. added 3 commits that reference this issue on Jan 20, 2025
  40. added a commit that references this issue on Jan 20, 2025
  41. added 2 commits that reference this issue on Jan 20, 2025
  42. added 2 commits that reference this issue on Jan 20, 2025
  43. added 3 commits that reference this issue on Jan 21, 2025
  44. added a commit that references this issue on Jan 21, 2025
  45. added a commit that references this issue on Jan 25, 2025
  46. picnixz commented on Jan 27, 2025

    @picnixz
    Member

    FTR, I have analyzed the project and IIRC there are roughly 50 files left to be fixed. I should have fixed roughly 20 files and I will post the PRs once I'm back. I am seeing the end of this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions