Hi Lukas,
I tried compiling with "make CFLAGS="-g -O0"", but it complained that the
TARGET variable must be specified. So I compiled using: make CFLAGS="-g
-O0" TARGET=linux2628 USE_OPENSSL=1. Funny enough, the compiled binary did
not crash anymore. I then tried: make CFLAGS="-g -O0"
TARGET=linux2628 USE_OPENSSL=1 USE_STATIC_PCRE=1. This time, request failed
but the process did not crash.
Finally, I tried compiling with the exact options that produce my original
problem: make TARGET=linux2628 CPU=native USE_STATIC_PCRE=1 USE_OPENSSL=1,
and use gdb to trace it.
Below is what I got when a request crashes the process:
*(gdb) run*
Starting program: /usr/bin/sudo haproxy -f /etc/haproxy/haproxy.cfg -p
/var/run/haproxy.pid -sf 18904
process 18911 is executing new program: /usr/local/sbin/haproxy-1.5.1
[WARNING] 189/125516 (18911) : Setting tune.ssl.default-dh-param to 1024 by
default, if your workload permits it you should set it to at least 2048.
Please set a value >= 1024 to make this warning disappear.
Program received signal SIGILL, Illegal instruction.
0x0808d9d6 in http_end_txn_clean_session (s=0x90e9e10) at
src/proto_http.c:4835
4835 s->logs.bytes_in -= s->req->buf->i;
*(gdb) backtrace*
#0 0x0808d9d6 in http_end_txn_clean_session (s=0x90e9e10) at
src/proto_http.c:4835
#1 0x0808e0c7 in http_resync_states (s=0x90e9e10) at src/proto_http.c:5276
#2 0x080910b8 in http_response_forward_body (s=0x90e9e10, res=0x90feaa0,
an_bit=1048576) at src/proto_http.c:6645
#3 0x080b05a1 in process_session (t=0x90c5cf8) at src/session.c:2053
#4 0x080568a8 in process_runnable_tasks (next=0xbfcbbf9c) at src/task.c:238
#5 0x0804c903 in run_poll_loop () at src/haproxy.c:1304
#6 0x0804ef75 in main (argc=7, argv=0xbfcbc194) at src/haproxy.c:1638
*(gdb) backtrace full*
#0 0x0808d9d6 in http_end_txn_clean_session (s=0x90e9e10) at
src/proto_http.c:4835
prev_status = 200
#1 0x0808e0c7 in http_resync_states (s=0x90e9e10) at src/proto_http.c:5276
No locals.
#2 0x080910b8 in http_response_forward_body (s=0x90e9e10, res=0x90feaa0,
an_bit=1048576) at src/proto_http.c:6645
msg = 0x90e9e44
tmpbuf = 0x0
compressing = 0
ret = <value optimized out>
#3 0x080b05a1 in process_session (t=0x90c5cf8) at src/session.c:2053
max_loops = <value optimized out>
ana_list = 1048576
ana_back = 1048576
srv = <value optimized out>
s = 0x90e9e10
rqf_last = <value optimized out>
rpf_last = <value optimized out>
rq_prod_last = <value optimized out>
rq_cons_last = 7
rp_cons_last = <value optimized out>
rp_prod_last = 7
#4 0x080568a8 in process_runnable_tasks (next=0xbfcbbf9c) at src/task.c:238
t = 0x90c5cf8
eb = 0x0
max_processed = 1
expire = <value optimized out>
#5 0x0804c903 in run_poll_loop () at src/haproxy.c:1304
next = 470637990
#6 0x0804ef75 in main (argc=7, argv=0xbfcbc194) at src/haproxy.c:1638
err = <value optimized out>
retry = <value optimized out>
limit = {rlim_cur = 2212, rlim_max = 2212}
errmsg =
"\000\000\000\000\244^\020\b\000\267\r\b\000\000\000\000\230\300˿Ny\005\b$i\020\b\020\000\000\000\001\000\000\000\230\300˿Bk\v\bD\220\020\b\250\300˿}\267\r\b\200\222OP\364_\020\b\270\300˿\\\265\004\b\200@x
\267\364_\020\b\350\300˿\031\267\r\b$\203Y\267\364\177Y\267\000\267\r\b"
pidfd = <value optimized out>
Do you see any problem above? Thanks!
Best regards,
Merton
On Mon, Jul 7, 2014 at 8:13 PM, Lukas Tribus <[email protected]> wrote:
> Hi Merton,
>
>
> > Hi Cyril,
> >
> > Yes, I tried "make clean" first before compiling and still the same
> > problem on 10.04 LTS.
>
> Are you compiling on the same machine that is crashing, correct?
>
> You cannot mix executables from a more recent box, because openssl,
> pcre headers will not match the running library.
>
>
> Anyway, it doesn't seem so from your -vv output.
>
>
> Can you recompile without compiler optimizations (CFLAGS="-g -O0" after
> "make") and trigger a coredump (set "ulimit -c unlimited" before starting
> haproxy, also see [1])?
>
> Then use gdb to create a backtrace and post the output:
> gdb /path/to/application /path/to/corefile
> (gdb) $ backtrace full
>
>
> Also see [1].
>
>
>
> Thanks,
>
> Lukas
>
>
> [1] http://www.cyberciti.biz/tips/linux-core-dumps.html
>
>