[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: coroutine library can cause panic with low memory
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 2 Mar 2009 16:19:22 -0300
> On Mon, 2 Mar 2009, Patrick Donnelly wrote:
> > Using the attached script one can cause Lua to panic. The problem is
> > the API call lua_checkstack which may throw a memory error.
> > lua_checkstack should probably not throw memory errors because it
> > cannot knowingly throw the error on the currently running thread. The
> > thread you are checking stack space for may not actually be running!
> Uhm.. sorry if I'm being dense, but isn't growing stack and possibly
> throwing a memory error the very reason for calling lua_checkstack in
> the first place? What on earth is it supposed to do if it can't throw
> memory errors when it can't grow the stack?
Probably a better correction would be to throw memory errors on the
main thread, if the current thread does not have one.