[issue3100] weakref subclass segfault

Adam Olsen report at bugs.python.org
Fri Jun 13 20:32:25 CEST 2008


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

Well, my attempt at a patch didn't work, and yours does, so I guess I
have to support yours. ;)

Can you review my python-incref-from-zero patch?  It verifies the
invariant that you need, that once an object hits a refcount of 0 it
won't get raised again.  (The possibility of __del__ makes me worry, but
it *looks* okay.)

gcmodule.c has an inline copy of handle_callbacks.  Is it possible a
collection could have the same problem we're fixing here?

Minor nit: you're asserting cbcalled, but you're not using the generic
callback, so it's meaningless.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3100>
_______________________________________


More information about the Python-bugs-list mailing list