Thanks for the info, I had neglected to check if ubuntu provided zlib.

ldd /usr/sbin/haproxy
linux-vdso.so.1 =>  (0x00007ffe4ed80000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fc9e975f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc9e955b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc9e9196000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc9e9998000)

Here's how I've been building zlib:

cd /opt
export ZLIB_VERSION=1.2.8

tar -xzvf zlib-$ZLIB_VERSION.tar.gz

cd /opt/zlib-$ZLIB_VERSION
make clean
./configure --static
make

And the relevant section of the haproxy make:

USE_ZLIB=1 ZLIB_INC=/opt/zlib-$ZLIB_VERSION/ ZLIB_LIB=/opt/zlib-$ZLIB_VERSION/


Today we will try building with os provided zlib, and also running without 
compression and possibly building without zlib.


________________________________
From: Lukas Tribus <[email protected]>
Sent: Tuesday, August 2, 2016 10:57:24 AM
To: James Hartshorn; [email protected]
Subject: Re: Haproxy 1.6.7 segmentation fault under load

Hi James,



Am 02.08.2016 um 19:09 schrieb James Hartshorn:
> (gdb) bt
> #0  __memcpy_sse2_unaligned () at
> ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:36
> #1  0x0000000000498717 in fill_window ()
> #2  0x0000000000498c20 in deflate_fast ()
> #3  0x000000000049a2e3 in deflate ()
> #4  0x0000000000483897 in deflate_flush_or_finish (comp_ctx=0xdb9fa0,
> out=0xb139f0, flag=<optimized out>) at src/compression.c:790
> #5  0x00000000004847a3 in http_compression_buffer_end
> (s=s@entry=0xe3c400, in=in@entry=0xe3c458, out=out@entry=0x872d40
> <tmpbuf>, end=<optimized out>) at src/compression.c:249

We can see that it crashes because of zlib compression. A workaround
could be to disable gzip compression in the meantime (if you need a
quick workaround for the production environment).

A few high level questions, to rule out any "stupid" compile issue:

Has zlib been compiled on the same box where the crash happens?
Are you sure, that both include and lib zlib path are correct?
Is zlib compiled statically (only)?
Whats the output of "ldd haproxy" on the box with the crash?
Ubuntu 14.04 ships zlib 1.2.8, any reason not to use the package from
the repository ("apt-get install zlib1g-dev")?



Thanks,

Lukas

Reply via email to