Hi Willy,

Le 02/10/2014 11:18, Willy Tarreau a écrit :
Hi all,

On Mon, Sep 22, 2014 at 10:04:35PM +0200, Cyril Bonté wrote:
The issue happens because during the configuration parsing, a dynamic
use_backend can't resolve the backend and leaves the union structure as
a string (which is also freed), not a pointer to a proxy.

Before the commits pointed by Seri, bind_proc were not updated when a
dynamic rule is recognized.
Maybe a quick workaround could be the patch attached, but it means that
we still can't propagate processes for proxies used by dynamic rules.

Sorry, I missed this thread. I got a similar report privately yesterday
and fixed it slightly differently : we don't run propagate_processes()
if any error was encountered, since there is no way to know whether *all*
backends are properly resolved in this case. For example, in the use case
that was reported to me, the problem happened with default_backend, not
with use_backend.

Then we're facing several segfault issues, because I still reproduce segfaults with a dynamic use_backend.

#0 propagate_processes (from=from@entry=0x1c44160, to=0x655f656863616367) at src/cfgparse.c:5996 5996 (from->bind_proc & to->bind_proc) == from->bind_proc)
(gdb) bt
#0 propagate_processes (from=from@entry=0x1c44160, to=0x655f656863616367) at src/cfgparse.c:5996 #1 0x0000000000422196 in propagate_processes (from=0x1c44160, from@entry=0x1c44320, to=<optimized out>) at src/cfgparse.c:6014 #2 0x00000000004221bc in propagate_processes (from=0x1c44320, to=<optimized out>) at src/cfgparse.c:6019
#3  0x0000000000423a8c in check_config_validity () at src/cfgparse.c:7121
#4 0x0000000000408064 in init (argc=<optimized out>, argv=<optimized out>, argv@entry=0x7fff00c1ece8) at src/haproxy.c:713 #5 0x00000000004066c9 in main (argc=<optimized out>, argv=0x7fff00c1ece8) at src/haproxy.c:1355

0x655f656863616367 is the hex value of the backend name, not a pointer to a proxy.

The patch I provided looks to solve this specific case.


--
Cyril Bonté

Reply via email to