Ah, I see. Tried it, but it seems it's not the only thing that causes the
segfault.

On Thu, Feb 21, 2019 at 8:31 AM Willy Tarreau <w...@1wt.eu> wrote:

> 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
>

Attachment: 0002-move-server-rule-expr-out-of-union.patch
Description: Binary data

Attachment: 0001-make-use-server-accept-log-format.patch
Description: Binary data

Reply via email to