[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: infinity loop / recursion
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 26 Aug 2013 09:19:01 -0300
> The problem with catching these signals is that you cannot simply resume the
> process upon receipt (e.g. with a longjmp). Even excluding threads, the
> application could've been in the middle of a malloc call when the signal
> fired, with inconsistent state. Likewise with the Lua VM. The application
> could easily crash; or worse, it crashes so rarely that it's never caught in
> testing.
Both lua.c and my lalarm library try to handle signals so that the VM can
continue and abort when it is safe to do so. I think there are other, more
complete libraries for Lua that handle signals, such as lua-signal:
https://github.com/LuaDist/lua-signal
See also http://lua-users.org/lists/lua-l/2012-12/msg00789.html .