[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Potential patch for Lua-5.1.2 bug #4
- From: roberto@... (Roberto Ierusalimschy)
- Date: Tue, 27 Nov 2007 17:32:24 -0200
> Maintain a count in each state representing the 'depth' of coroutine
> resumptions (nresumes) which are active at that moment, and use the sum
> of resumes and C calls for stack depth tests. This is incremented and
> tested before the nested luaV_execute, and then decremented after it.
> The value is propagated from state to state at the same time execution
> moves into the coroutine's thread.
> > > The author would appreciate any feedback you can provide.
I have two concerns about this patch:
1) I am not very comfortable with the use of lua_xmove to pass the depth
from one coroutine to the next. It looks like a trick that may have
2) I am not sure it really solves the bug. It seems that if each
coroutine calls the next inside a deep nest of pcalls (or something
similar that consumes C stack), the code will count only 1 for each
coroutine nesting, so that the C stack may overflow before the counting
reaches its limit.
I still prefer the idea of moving nCcalls from lua_State into