Hi List, Thierry,
Below script makes haproxy perform a coredump when a function that
doesnt loop forever is put into register_task.. is it possible to add
some safety checks around such calls.?.
The coredump does not seem to contain any useful info when read by gdb..
unkown functions at unkown addresses...
Also i tried to register a new second task inside the c==5 check, but
then it just seemed to hang..
Maybe not really important as people should probably never use a
function that can exit for a task.. , but its never nice to have
something perform a coredump..
Regards,
PiBa-NL (Pieter)
#### haproxy.conf ####
global
nbthread 1
lua-load /root/haproxytest/print_r.lua
lua-load /root/haproxytest/test.lua
defaults
mode http
timeout connect 5s
timeout client 30s
timeout server 60s
frontend TestSite
bind *:80
#### Lua script ####
mytask = function()
c = 0
repeat
core.Info("Task")
core.sleep(1)
c = c + 1
if c == 3 then
break
end
until false
core.Info("Stopping task")
end
core.register_task(mytask)
#### output ###
[info] 112/224221 (7881) : Task
[info] 112/224222 (7881) : Task
[info] 112/224223 (7881) : Task
[info] 112/224224 (7881) : Stopping task
Segmentation fault (core dumped)