lua-users home
lua-l archive

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


Also, look at the debugging hooks in the C API.  http://www.lua.org/manual/5.1/manual.html#lua_Hook

I'd be interested in seeing a good solution to limiting memory over-allocation.

-Kurt


On Tue, Jun 8, 2010 at 8:17 AM, Patrick Donnelly <batrick@batbytes.com> wrote:
On Tue, Jun 8, 2010 at 9:10 AM,  <moltrecht@topconcepts.com> wrote:
> Hi!
>
> I'm working on a sandboxed version of Lua which can be called from PHP to allow users to run their own scripts. It's quite safe so far, the only problem is that users may create infinite loops, use all system memory or have their scripts run for a very long time.
> Is there any way of solving these problems? A function like set_time_limit() in PHP would be great, or the possibility to overwrite the normal while- and for-loops with a custom implementation that e.g. allows only up to 1000 iterations.
> Another issue is the memory problem, how can I be sure the user doesn't create variables over variables and thus spams the system memory?

See:

http://lua-users.org/wiki/SandBoxes
http://lua-users.org/lists/lua-l/2010-04/msg00667.html
http://lua-users.org/lists/lua-l/2009-05/msg00373.html

There are many threads on this subject. Google more if those don't
answer all your questions :).

--
- Patrick Donnelly



--
http://www.blar.net/kurt/blog/