[issue3100] weakref subclass segfault

Adam Olsen report at bugs.python.org
Fri Jun 13 08:44:18 CEST 2008

Adam Olsen <rhamph at gmail.com> added the comment:

Patch to add extra sanity checks to Py_INCREF (only if Py_DEBUG is set).
 If the refcount is 0 or negative if calls Py_FatalError.  This should
catch revival bugs such as this one a little more clearly.

The patch also adds a little more checking to _Py_ForgetReference, so
it's more likely to print an error rather than segfaulting.

keywords: +patch
Added file: http://bugs.python.org/file10614/python-incref-from-zero.diff

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list