summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-11-12 20:43:28 +0000
committerTim Peters <tim.peters@gmail.com>2003-11-12 20:43:28 +0000
commit7f4224803ffb7b26b5175caea3b1f018a3a29f70 (patch)
tree89d7e10ab2420fb24f539fe02cda5e8b34dabf83 /Python/pythonrun.c
parentafc2916e1ef6f8737f0660a1e02fd6b2ae0fda16 (diff)
downloadcpython-7f4224803ffb7b26b5175caea3b1f018a3a29f70.tar.gz
SF bug 840829: weakref callbacks and gc corrupt memory.
subtype_dealloc(): This left the dying object exposed to gc, so that if cyclic gc triggered during the weakref callback, gc tried to delete the dying object a second time. That's a disaster. subtype_dealloc() had a (I hope!) unique problem here, as every normal dealloc routine untracks the object (from gc) before fiddling with weakrefs etc. But subtype_dealloc has obscure technical reasons for re-registering the dying object with gc (already explained in a large comment block at the bottom of the function). The fix amounts to simply refraining from reregistering the dying object with gc until after the weakref callback (if any) has been called. This is a critical bug (hard to predict, and causes seemingly random memory corruption when it occurs). I'll backport it to 2.3 later.
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions