[Stackless] Problem building release27-maint in 64-bit linux.

Richard Tew richard.m.tew at gmail.com
Wed Aug 17 08:13:36 CEST 2011


On Wed, Aug 17, 2011 at 12:36 AM, Alexey Borzenkov <snaury at gmail.com> wrote:
> 2. crashes can happen if there's any C-stack switch during garbage
> collection. The reason for this is that Python is creating gc lists on
> the stack, and if during tp_clear there are C-stack switches (as in,
> to kill an alive greenlet/tasklet), then those variables might get
> clobbered. If during the switch there are deallocations, and list head
> is updated, it would lead to random stack corruptions. Now these
> conditions are extremely rare, but they can happen and can lead to
> weird crashes. If anyone is interested you can read how I found this
> issue here: https://bitbucket.org/ambroff/greenlet/issue/24/debian-64-errors-with-pydebug

Not a problem in Stackless, see the following code:

#ifdef STACKLESS
    /* unlinking may occur in a different tasklet during collection
     * so these must not be on the stack
     */
    static PyGC_Head unreachable; /* non-problematic unreachable trash */
    static PyGC_Head finalizers;  /* objects with, & reachable from, __del__ */
#else
    PyGC_Head unreachable; /* non-problematic unreachable trash */
    PyGC_Head finalizers;  /* objects with, & reachable from, __del__ */
#endif

Cheers,
Richard.



More information about the Stackless mailing list