lua-users home
lua-l archive

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


> In Lua 5.3.5, the VM occasionally looked at L->hookmask inside of
> tight loops to determine whether to run the hook function. In Lua
> 5.4.0-rc3, it now looks at ci->u.l.trap instead. The problem here is
> that there's a bunch of ci's, and if you're unlucky, you might not
> update all of them. A comment on the settraps function says that in
> this case, "the worst that can happen is that the signal will not
> interrupt the script." Well, that's pretty bad if you wanted to set a
> hook as a timeout to guard against code running an infinite loop. Am I
> understanding this correctly? If so, is there a way to mitigate this?

In all versions of Lua there are several cases where a signal will not
interrupt a script (e.g., a loop inside a C function or a coroutine or a
protected call).  Lua 5.4 just added one more case to that list. In any
case, if there is another signal, it will kill the program.

-- Roberto
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org