[Stackless] crash on exit while daemon thread is still running

Kristján Valur Jónsson kristjan at ccpgames.com
Fri Feb 1 11:26:29 CET 2013


This is not likely to be a 3.3 issue, but a problem with all branches.
The code that is trying to kill all tasklets on exit is incorrect when there are tasklets on other threads that need to be killed.
I'll try to come up with a way to do this more  nicely.
K

> -----Original Message-----
> From: stackless-bounces at stackless.com [mailto:stackless-
> bounces at stackless.com] On Behalf Of Y. Sapir
> Sent: 31. janúar 2013 22:48
> To: stackless at stackless.com
> Subject: [Stackless] crash on exit while daemon thread is still running
> 
> I'm running the 3.3-slp branch on Ubuntu 12.10. The script below gives me a
> segfault. Is this a known problem?
> 
> 
> import threading
> import stackless
> 
> chan = stackless.channel()
> 
> def producer():
>     while True:
>         chan.send(1)
> 
> def consumer():
>     while True:
>         chan.receive()
> 
> def run_tasklet(func, iterations):
>     stackless.tasklet(func)()
>     for i in range(iterations):
>         stackless.run()
> 
> thread = threading.Thread(
>     target=run_tasklet,
>     args=(producer, 1000000),
>     daemon=True)
> thread.start()
> 
> run_tasklet(consumer, 10)
> 
> 
> And here's the stacktrace I get from gdb:
> 
> #0  0xb7e43850 in slp_kill_tasks_with_stacks (ts=ts at entry=0x0) at
> Stackless/core/stacklesseval.c:364
> #1  0xb7e4397a in PyStackless_kill_tasks_with_stacks
> (allthreads=allthreads at entry=1) at Stackless/core/stacklesseval.c:397
> #2  0xb7e70f4a in Py_Finalize () at Python/pythonrun.c:506
> #3  Py_Finalize () at Python/pythonrun.c:485
> #4  0xb7e89e44 in Py_Main (argc=argc at entry=2,
> argv=argv at entry=0x804b008) at Modules/main.c:761
> #5  0x080488a2 in main (argc=2, argv=0xbffff174) at ./Modules/python.c:66
> 
> 
> Thanks.
> 
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless





More information about the Stackless mailing list