lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, 2010-12-22 at 13:11 -0200, Roberto Ierusalimschy wrote:
> > Running a fairly complex script, in the middle of it I get this error:
> > 
> > LuaAPI Failure L->top < L->ci->top lua-5.1.2\src\lapi.c line 569
> > 
> > Any thoughts?
> 
> It seems that someone is pushing a value in the API stack without
> ensuring that there is space for it.

I've also had this problem, the solution was to add

  lua_checkstrack(L, n);

in a method with a lot of operations on the stack (more than 20 items
were pushed in a long-running operation), with an appropriate value of
'n', and then cleaning the stack afterwards. The reason for the failure
was hard to debug (well, at least I got to know the Lua internals),
however, a message such as "Out of stack space" would be more helpful
than "L->top < L->ci->top".