lua-users home
lua-l archive

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


On Sat, Dec 22, 2018 at 2:15 PM Viacheslav Usov wrote:
> The stack size must be known at link time on Windows.
No. It is a default that the application can override at run time.

It could be overridden only for new threads when creating them.
You can't increase stack size of already running Lua VM thread.

 
> Yes, of course, a host application developer should take into consideration both "how much stack Lua VM needs" and "how much stack the application itself needs"
Even that is impossible if the host provides functions using varying amounts of stack size callable from Lua, and the user is free to supply Lua code, even assuming that Lua can safely predict and control its own stack usage.

Nothing prevents you from checking stack size in your own application (and raise an error if the next operation might use more stack space than you have available).

 
> I believed that Lua VM does guarantee to never crash the host application whatever Lua script is given.
Unfortunately that is not the case (as stated).

I'd like to hear Lua authors' opinion on should we consider Lua safe or not.