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:
Victor Stinner 2021-09-21 23:04:34 +02:00 committed by GitHub
parent f604cf1c37
commit 79a3148099
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 5 deletions

View file

@ -1563,8 +1563,7 @@ none_repr(PyObject *op)
static void _Py_NO_RETURN
none_dealloc(PyObject* Py_UNUSED(ignore))
{
Py_FatalError("deallocating None likely caused by a refcount bug "
"in a C extension");
_Py_FatalRefcountError("deallocating None");
}
static PyObject *