[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Problem with sieve.lua test program
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 05 Apr 2005 15:49:21 -0300
> I just tried to run the sieve.lua test program (sieve of Eratosthenes
> via coroutines) It runs fine with N=1000 but exits prematurely on larger
> args. It exits silently after printing 30029 with Lua 5.1 work 5 ,
> raises exception c00000fd after printing 15073 with Lua 5.1 work 2 and
> also exits silently after printing 25013 with Lua 5.02.
The problem is an overflow of the C stack. Lua has a counter to detect
that, but the use of coroutines deceived the counter. Actually this is a
bug. That counter should be global (one for all trheads) instead of one
per thread (after all, the C stack is global).