New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tick rate control #45
Comments
Could you describe how this can be done in lua 5.1 for reference? |
Right now I'm on phone, so I'll get you the quickest answer. Once I go to my computer I'll repost an implemented answer. debug.sethook(function, "", quota) |
Also: if you put set the quota to 1000 and in Lua code you do the following. The function should be called, and if it triggers an error, the execution should stop on i = 1000 |
Thanks, I got it. It's the sethook function in debug library. |
probably it will be pointless if I repost it now, because you seem to have got it. But I'll do it anyway. |
Hey, after I did some more tests with the debug library I noticed that the "l" mode does not detect infinite loops. This is quite essential to execute untrusted code in the server environment. When you start making this function, could you add another mode like "a" that would detect any kind of loops (from the "l" mode) and incluiding while and repeat-loops (the undetectable ones)? |
Hey, it's been about two or three months. So I'm just wondering if you can do it or not, how much more time would that take? The only purpose I have on this is to run untrustable code with UniLua so I could stop people from doing infinite loops that crashes the VM. |
In Lua 5.1 we were able to limit the tick rate with the debug library, but it hasn't been implemented on UniLua. Can you at least implement some functions to control the tick rate/infinite loops/stack overflow?
The text was updated successfully, but these errors were encountered: