Hi,
Cyril, as you said, if removed "txn:close()" from the lua script, I don't get
segfault anymore.
I noticed that if I removed default_backend line from frontend declaration,
segfault does not happen even with "txn:close()" in lua script :
frontend fe:80
bind 127.0.0.1:80
acl debugme req.hdr_cnt(X-debug-me) ge 1
http-request lua mirror if debugme
# default_backend be
Regards,
On Sat, 15 Aug 2015 23:56:57 +0200,
Cyril Bonté <[email protected]> wrote :
> Hi Marc-Antoine,
>
> Le 12/08/2015 19:01, Marc-Antoine a écrit :
> > I forgot lua file content :
> >
> > # cat mylua.lua
> > -- a simple mirror web server
> > -- it generates a response whose body contains the requests headers
> > function mirror(txn)
> > (...)
> > txn:close()
> > end
>
> This is the call which produce a segfault later, combined with the
> haproxy configuration. I give more details below.
>
> > Marc-Antoine <[email protected]> wrote :
> > (...)
> >> defaults
> >> mode http
> >> (...)
> >> frontend fe:80
> >> bind 127.0.0.1:80
> >> acl debugme req.hdr_cnt(X-debug-me) ge 1
> >> http-request lua mirror if debugme
> >> default_backend be
>
> It looks that currently, mode http doesn't allow a call to txn:close().
> To extend the issue, txn:close() won't work for a proxy in HTTP mode for
> both :
> http-request lua
> tcp-request content lua
>
> This is due to the stream processing which still execute some request
> analyzers even if the lua code sends a response and asks to close the
> transaction.
>
> I haven't looked at the code enough yet, but maybe we should try to find
> a way to notify haproxy to stop the processing once txn:close() is called.
>
> This also explains some other segfaults reported in the past :
> http://comments.gmane.org/gmane.comp.web.haproxy/21136
>
--
Marc-Antoine