[Stackless] Assert in scheduling.c

Kristján Valur Jónsson kristjan at ccpgames.com
Fri Jan 16 18:03:26 CET 2009

I think this was fixed a while ago.
I don't experience your crash in the stackless trunk.  Which version are you using?

-----Original Message-----
From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of lee hurley
Sent: 14. janúar 2009 20:44
To: stackless at stackless.com
Subject: [Stackless] Assert in scheduling.c

I'm working on embedding stackless into a win32 app, and i'm getting an 
assert in scheduling.c when i build in debug.
Line 1006 in scheduling.c :     assert(ts->recursion_depth == 0 || 
ts->st.main == NULL && ts->st.current == NULL && prev == next);

When a task destructs it always seems that ts->st.current is never NULL, 
and thus the assert fires off.

I've used multiple scripts to reproduce this, and here's one of them:

import stackless
import time

def call_wrapper(f, args, kwargs, result_ch):
    result_ch.send(f(*args, **kwargs))

def call(f, *args, **kwargs):
    result_ch= stackless.channel()
    stackless.tasklet(call_wrapper)(f, args, kwargs, result_ch)
    return result_ch.receive()
def factorial(n):
    if n <= 1:
        return 1
    return n * call(factorial, n-1)

st = time.time()

print time.time() - st

Is this a known issue?  And can i safely disable this assert on my end?



Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list