[Stackless] A new crash bug

Richard Tew richard.m.tew at gmail.com
Fri Oct 12 22:14:55 CEST 2007


I've working on a comprehensive test suite for Stackless and came
across this crash bug.  I have not yet fixed it myself, but it looks
like a pretty straightforward problem related to garbage collection of
objects when the frame is exited because of an exception.

I am using the release Windows Stackless build.  Experience dictates
that this should happen consistently on all platforms.

If anyone wishes to get more familiar with Stackless internals and the
Python virtual machine/implementation, this should be a good bug to
start with.

import unittest, stackless

if True:
    class CrashBugBehaviour(unittest.TestCase):
        "Tests for current and past reproduction cases for crash bugs."

        def testChannelFailureCrash(self):
            """ Related to channel blocking and garbage collection order
                for objects freed when this frame exits.  More detail
                should be added once it has been fixed. """

            def channelBlockingFunction(channel, crashCausingList):
                # Condition 3: The tasklet must block on the channel.

            # Condition 1: The channel must be created before the list.
            c = stackless.channel()

            # Condition 2: The list must be passed into the created tasklet.
            v = []
            channelBlockingTasklet =
stackless.tasklet(channelBlockingFunction)(c, v)

            # This intentionally fails.  It will trigger the crash bug.


More information about the Stackless mailing list