mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MEDIUM: lua: undetected infinite loop
If the Lua code causes an infinite loop without yield possible, the clock is not updated. This patch check the clock when the Lua control code cannot yield.
This commit is contained in:
parent
01c30124ae
commit
a85cfb1db5
@ -856,7 +856,8 @@ void hlua_hook(lua_State *L, lua_Debug *ar)
|
|||||||
if (lua_isyieldable(L))
|
if (lua_isyieldable(L))
|
||||||
WILL_LJMP(hlua_yieldk(L, 0, 0, NULL, TICK_ETERNITY, HLUA_CTRLYIELD));
|
WILL_LJMP(hlua_yieldk(L, 0, 0, NULL, TICK_ETERNITY, HLUA_CTRLYIELD));
|
||||||
|
|
||||||
/* If we cannot yield, check the timeout. */
|
/* If we cannot yield, update the clock and check the timeout. */
|
||||||
|
tv_update_date(0, 1);
|
||||||
if (tick_is_expired(hlua->expire, now_ms)) {
|
if (tick_is_expired(hlua->expire, now_ms)) {
|
||||||
lua_pushfstring(L, "execution timeout");
|
lua_pushfstring(L, "execution timeout");
|
||||||
WILL_LJMP(lua_error(L));
|
WILL_LJMP(lua_error(L));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user