Hi Joe,

On Thu, Feb 21, 2019 at 08:23:29AM +0000, Joe K wrote:
> Hello everybody again ...
> 
> So here's what I have right now, just from copy-pasting and slightly
> editing 702d44f.
> 
> The config check passes, but haproxy crashes with segmentation fault after
> the first request with an enabled server.

You need (at least) to change this one :

diff --git a/include/types/proxy.h b/include/types/proxy.h
index 14b6046c..3f8ede58 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -490,9 +490,11 @@ struct switching_rule {
 struct server_rule {
        struct list list;                       /* list linked to from the 
proxy */
        struct acl_cond *cond;                  /* acl condition to meet */
+       int dynamic;                            /* this is a dynamic rule using 
the logformat expression */
        union {
                struct server *ptr;             /* target server */
                char *name;                     /* target server name during 
config parsing */
+               struct list expr;               /* logformat expression to use 
for dynamic rules */
        } srv;
 };

The "expr" field must move out of the union, otherwise it's shared
with the server's pointer. Just move it before the "dynamic" field
above. It definitely is one cause of segfault (though possibly not
the only one).

Willy

Reply via email to