-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Open
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
UBSan reports errors such as:
modexport_create_string
Objects/moduleobject.c:546:13: runtime error: call to function modexport_create_string through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct PyModuleDef *)' /home/shamil/oss/cpython/main/./Modules/_testmultiphase.c:1066:5: note: modexport_create_string defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/moduleobject.c:546:13
Py_mod_state_free
Objects/moduleobject.c:1101:9: runtime error: call to function modexport_smoke_free through pointer to incorrect function type 'void (*)(void *)' /home/shamil/oss/cpython/main/./Modules/_testmultiphase.c:974: note: modexport_smoke_free defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/moduleobject.c:1101:9
The functions assigned to Py_mod_state_free and modexport_create_string use incorrect signatures, causing calls through mismatched function pointer types and leading to undefined behavior.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
efimov-mikhail and sergey-miryanov
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error