lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:

>I just noticed that an incorrect (written in Lua) __newindex
>method can crash the application by overflowing the C-language
>stack.


Lua itself limits the number of active calls you can stack before an
error. It seems that its limit is too large for the default VC++ stack.
You can try a bigger stack in C, or a smaller stack in Lua. For
the later, add "-DLUA_MAXCALLS=2048" or "-DLUA_MAXCALLS=1024" to your
project options. (Please let us know if that fixes the problem.)


Thanks,
setting LUA_MAXCALLS to 1024 seems to fix this for me.
(VC++ 6.0 debug build, most propably compiler defaults for stack)

btw each "loop" in the call chain seems to consume something
700 bytes of (C++) stack space -  luaV_execute appears to be the main
consumer. This is all when compiling C++ with debugging options,
I don't know if "release" options change this.



		Eero