lua-users home
lua-l archive

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


> Hello everyone!
> 
>          I use lua some years, thank you all for developing lua language!
> 
>         Some days ago, our program crash. I found the crash in lua code. So
> I check lua code, found the stack overflow. 
> 
> Please look this code In function luaD_precall:
> 
>  [...]

Yes, this is a bug. Many thanks for the detailed report.

One fix is to remove 'luaC_checkGC' from 'adjust_varargs' (as already
suggested). It has a drawback that a program that goes on creating
thousands of vararg tables and not creating any other object will never
call the collector (and therefore will run out of memory). Another fix
is to call 'luaD_checkstack(L, p->maxstacksize)' again just after the
call to 'luaC_checkGC'. (I did not test any of these fixes.)

Just a reminder: that this vararg style is deprecated in Lua 5.1 and
this compatibility code will be removed in 5.2.

-- Roberto