[Stackless] A new crash bug

Christian Tismer tismer at stackless.com
Mon Oct 22 21:35:49 CEST 2007


Kristján Valur Jónsson wrote:
> Okay I have finally figured out what is happening.
> 
> The main tasklet is in garbage collection.  It has a list called "unreachable" and its head is on the stack.
> During colleection of the unreachable objects, we switch to a different tasklet.
> During that tasklet´s execution, some objects in "unreachable" are unlinked.  That is, final collection occurs there.
> However, "unreachable" is now in a different and invalid stack frame and so a memory corruption will occur.
> 
> The fix is to make "unreachable" a static variable.  This should be ok, since python threading model precludes more than one thread doing GC, and gc.collect() is not reentrant anyway.

Whow! Good boy!
Now that you say it, it is obvious. As always :-)

cheers - chris
-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/




More information about the Stackless mailing list