ok, so the globals were position dependent.  I did have bind-process in the
stats listen section but started stripping entries from the configuration
to make the segfault reproduce with a minimal config.

So, without the patch

global
  nbproc 2
  stats  socket /var/lib/haproxy/stats user haproxy group haproxy mode 0660
level admin
  stats  bind-process 1

listen stats
  bind-process 1
  mode  http
  bind  :8000
  stats enable
  stats admin if TRUE
  stats uri       /

works but if the order of the global "stats socket" and "stats
bind-process" are switched, it segfaults

global
  nbproc 2
  stats  bind-process 1
  stats  socket /var/lib/haproxy/stats user haproxy group haproxy mode 0660
level admin

listen stats
  bind-process 1
  mode  http
  bind  :8000
  stats enable
  stats admin if TRUE
  stats uri       /


The patch fixes the segfault for me.

Thanks,
-Bryan




On Sat, Apr 20, 2013 at 12:54 AM, Willy Tarreau <[email protected]> wrote:

> On Fri, Apr 19, 2013 at 06:13:12PM -0700, Bryan Talbot wrote:
> > I'm testing out nbproc for ssl offloading for the first time and ran into
> > an issue with "stats bind-process" which seems to segfault on startup.
> >
> > # cat x.cfg
> > global
> >   nbproc 2
> >   stats bind-process 1
> >
> > listen stats
> >   bind :8000
> >   mode http
> >   stats enable
> >   stats admin if TRUE
> >   stats uri       /
> >
> >
> > # /usr/sbin/haproxy -c -V -f /etc/haproxy/x.cfg
> > Segmentation fault
>
> Fix attached, thank you Bryan.
>
> The reason for this is that you don't have a "stats socket" before
> "stats bind-process" and this last one forgot to allocate the stats
> frontend.
>
> I now understand what you tried to do but this is wrong :-)
> The global "stats bind-process" forces the process of the global stats
> socket.
>
> What you want to do above (it seems) is to bind your listener to a
> specific process. This is done this way :
>
>  global
>    nbproc 2
>
>  listen stats
>    bind :8000
>    bind-process 1
>    mode http
>    stats enable
>    stats admin if TRUE
>    stats uri       /
>
> Anyway I'm attaching the fix for the bug you reported.
>
> Cheers,
> Willy
>
>

Reply via email to