haproy dumps core when unable to resolve host names

2013-03-15 Thread Dmitry Sivachenko
Hello!

I am using haproxy-1.5-dev17.  I use hostnames in my config file rather than 
IPs.
If DNS is not working, haproxy will dump core on start or config check.

How to repeat:
Put some fake stuff in /etc/resolv.conf so resolver does not work.

Run haproxy -c -f /path/to/haproxy.conf:

/tmp# ./haproxy -c -f ./haproxy.conf
Segmentation fault (core dumped)

# ./haproxy -vv
HA-Proxy version 1.5-dev17 2012/12/28
Copyright 2000-2012 Willy Tarreau w...@1wt.eu

Build options :
  TARGET  = freebsd
  CPU = generic
  CC  = cc
  CFLAGS  = -O2 -pipe -O2 -fno-strict-aliasing -pipe -DFREEBSD_PORTS
  OPTIONS = USE_GETADDRINFO=1 USE_ZLIB=1 USE_OPENSSL=1 USE_STATIC_PCRE=1

Default settings :
  maxconn = 2000, bufsize = 16384, maxrewrite = 8192, maxpollevents = 200

Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.7
Compression algorithms supported : identity, deflate, gzip
Built with OpenSSL version : OpenSSL 0.9.8x 10 May 2012
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes

Available polling systems :
 kqueue : pref=300,  test result OK
   poll : pref=200,  test result OK
 select : pref=150,  test result OK
Total: 3 (3 usable), will use kqueue.




Re: haproy dumps core when unable to resolve host names

2013-03-15 Thread Willy Tarreau
Hi Dmitry,

On Fri, Mar 15, 2013 at 03:25:10PM +0400, Dmitry Sivachenko wrote:
 Hello!
 
 I am using haproxy-1.5-dev17.  I use hostnames in my config file rather than 
 IPs.
 If DNS is not working, haproxy will dump core on start or config check.
 
 How to repeat:
 Put some fake stuff in /etc/resolv.conf so resolver does not work.
 
 Run haproxy -c -f /path/to/haproxy.conf:
 
 /tmp# ./haproxy -c -f ./haproxy.conf
 Segmentation fault (core dumped)

This is a known issue with GETADDRINFO which was fixed in a
recent snapshot :

  commit 58ea039115f3faaf29529e0df97f4562436fdd09
  Author: Sean Carey ca...@basho.com
  Date:   Fri Feb 15 23:39:18 2013 +0100

BUG/MEDIUM: config: fix parser crash with bad bind or server address

If an address is improperly formated on a bind or server address
and haproxy is built for using getaddrinfo, then a crash may occur
upon the call to freeaddrinfo().

Thanks to Jon Meredith for helping me patch this for SmartOS,
I am not a C/GDB wizard.

I think you'd better update to latest snapshot until we emit dev18.

Best regards,
Willy




Re: haproy dumps core when unable to resolve host names

2013-03-15 Thread Dmitry Sivachenko

On 15.03.2013, at 15:54, Willy Tarreau w...@1wt.eu wrote:

 Hi Dmitry,
 
 On Fri, Mar 15, 2013 at 03:25:10PM +0400, Dmitry Sivachenko wrote:
 Hello!
 
 I am using haproxy-1.5-dev17.  I use hostnames in my config file rather than 
 IPs.
 If DNS is not working, haproxy will dump core on start or config check.
 
 How to repeat:
 Put some fake stuff in /etc/resolv.conf so resolver does not work.
 
 Run haproxy -c -f /path/to/haproxy.conf:
 
 /tmp# ./haproxy -c -f ./haproxy.conf
 Segmentation fault (core dumped)
 
 This is a known issue with GETADDRINFO which was fixed in a
 recent snapshot :
 
  commit 58ea039115f3faaf29529e0df97f4562436fdd09
  Author: Sean Carey ca...@basho.com
  Date:   Fri Feb 15 23:39:18 2013 +0100
 
BUG/MEDIUM: config: fix parser crash with bad bind or server address
 
If an address is improperly formated on a bind or server address
and haproxy is built for using getaddrinfo, then a crash may occur
upon the call to freeaddrinfo().
 
Thanks to Jon Meredith for helping me patch this for SmartOS,
I am not a C/GDB wizard.
 
 I think you'd better update to latest snapshot until we emit dev18.
 



Ah, okay, thanks!