[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.0 metatable and stack safety
- From: Eero Pajarre <epajarre@...>
- Date: Tue, 19 Nov 2002 20:03:19 +0200
Roberto Ierusalimschy wrote:
>I just noticed that an incorrect (written in Lua) __newindex
>method can crash the application by overflowing the C-language
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.)
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.