bpo-45061: Detect refcount bug on empty tuple singleton (GH-28503)
Detect refcount bugs in C extensions when the empty tuple singleton is destroyed by mistake. Add the _Py_FatalRefcountErrorFunc() function.
This commit is contained in:
@@ -2805,6 +2805,16 @@ _Py_FatalErrorFormat(const char *func, const char *format, ...)
|
||||
}
|
||||
|
||||
|
||||
void _Py_NO_RETURN
|
||||
_Py_FatalRefcountErrorFunc(const char *func, const char *msg)
|
||||
{
|
||||
_Py_FatalErrorFormat(func,
|
||||
"%s: bug likely caused by a refcount error "
|
||||
"in a C extension",
|
||||
msg);
|
||||
}
|
||||
|
||||
|
||||
void _Py_NO_RETURN
|
||||
Py_ExitStatusException(PyStatus status)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user