Hi List, Willy,

Current 1.9-dev master ( 6e0d8ae ) crashes with regtest: /reg-tests/connection/h00001.vtc stack below, it fails after commit f157384.

Can someone check? Thanks.

Regards,

PiBa-NL (Pieter)

Program terminated with signal 11, Segmentation fault.
#0  0x000000000057f34f in connect_server (s=0x802616500) at src/backend.c:1384
1384 HA_ATOMIC_ADD(&srv->counters.connect, 1);
(gdb) bt full
#0  0x000000000057f34f in connect_server (s=0x802616500) at src/backend.c:1384
        cli_conn = (struct connection *) 0x8026888c0
        srv_conn = (struct connection *) 0x802688a80
        old_conn = (struct connection *) 0x0
        srv_cs = (struct conn_stream *) 0x8027b8180
        srv = (struct server *) 0x0
        reuse = 0
        reuse_orphan = 0
        err = 0
        i = 5
#1  0x00000000004a8acc in sess_update_stream_int (s=0x802616500) at src/stream.c:928
        conn_err = 8
        srv = (struct server *) 0x0
        si = (struct stream_interface *) 0x802616848
        req = (struct channel *) 0x802616510
#2  0x00000000004a37c2 in process_stream (t=0x80265c320, context=0x802616500, state=257) at src/stream.c:2302
        srv = (struct server *) 0x0
        s = (struct stream *) 0x802616500
        sess = (struct session *) 0x8027be000
        rqf_last = 9469954
        rpf_last = 2147483648
        rq_prod_last = 7
        rq_cons_last = 0
        rp_cons_last = 7
        rp_prod_last = 0
        req_ana_back = 0
        req = (struct channel *) 0x802616510
        res = (struct channel *) 0x802616570
        si_f = (struct stream_interface *) 0x802616808
        si_b = (struct stream_interface *) 0x802616848
#3  0x00000000005e9da7 in process_runnable_tasks () at src/task.c:432
        t = (struct task *) 0x80265c320
        state = 257
        ctx = (void *) 0x802616500
        process = (struct task *(*)(struct task *, void *, unsigned short)) 0x4a0480 <process_stream>
        t = (struct task *) 0x80265c320
        max_processed = 200
#4  0x0000000000511592 in run_poll_loop () at src/haproxy.c:2620
        next = 0
        exp = 0
#5  0x000000000050dc00 in run_thread_poll_loop (data=0x802637080) at src/haproxy.c:2685
---Type <return> to continue, or q <return> to quit---
        start_lock = {lock = 0, info = {owner = 0, waiters = 0, last_location = {function = 0x0, file = 0x0, line = 0}}}
        ptif = (struct per_thread_init_fct *) 0x92ee30
        ptdf = (struct per_thread_deinit_fct *) 0x0
#6  0x000000000050a2b6 in main (argc=4, argv=0x7fffffffea48) at src/haproxy.c:3314
        tids = (unsigned int *) 0x802637080
        threads = (pthread_t *) 0x802637088
        i = 1
        old_sig = {__bits = 0x7fffffffe770}
        blocked_sig = {__bits = 0x7fffffffe780}
        err = 0
        retry = 200
        limit = {rlim_cur = 4042, rlim_max = 4042}
        errmsg = 0x7fffffffe950 ""
        pidfd = -1
Current language:  auto; currently minimal


haproxy -vv
HA-Proxy version 1.9-dev10-6e0d8ae 2018/12/14
Copyright 2000-2018 Willy Tarreau <[email protected]>

Build options :
  TARGET  = freebsd
  CPU     = generic
  CC      = cc
  CFLAGS  = -DDEBUG_THREAD -DDEBUG_MEMORY -pipe -g -fstack-protector -fno-strict-aliasing -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -fno-strict-overflow -Wno-address-of-packed-member -Wno-null-dereference -Wno-unused-label -DFREEBSD_PORTS -DFREEBSD_PORTS   OPTIONS = USE_GETADDRINFO=1 USE_ZLIB=1 USE_ACCEPT4=1 USE_REGPARM=1 USE_OPENSSL=1 USE_LUA=1 USE_STATIC_PCRE=1 USE_PCRE_JIT=1

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

Built with OpenSSL version : OpenSSL 1.0.2k-freebsd  26 Jan 2017
Running on OpenSSL version : OpenSSL 1.0.2k-freebsd  26 Jan 2017
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports : SSLv3 TLSv1.0 TLSv1.1 TLSv1.2
Built with Lua version : Lua 5.3.4
Built with transparent proxy support using: IP_BINDANY IPV6_BINDANY
Built with zlib version : 1.2.11
Running on zlib version : 1.2.11
Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
Built with PCRE version : 8.40 2017-01-11
Running on PCRE version : 8.40 2017-01-11
PCRE library supports JIT : yes
Encrypted password support via crypt(3): yes
Built with multi-threading support.

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.

Available multiplexer protocols :
(protocols marked as <default> cannot be specified using 'proto' keyword)
              h2 : mode=HTTP       side=FE
              h2 : mode=HTX        side=FE|BE
       <default> : mode=HTX        side=FE|BE
       <default> : mode=TCP|HTTP   side=FE|BE

Available filters :
        [SPOE] spoe
        [COMP] compression
        [CACHE] cache
        [TRACE] trace

# commit d02286d
# BUG/MINOR: log: pin the front connection when front ip/ports are logged
#
# Mathias Weiersmueller reported an interesting issue with logs which Lukas
# diagnosed as dating back from commit 9b061e332 (1.5-dev9). When front
# connection information (ip, port) are logged in TCP mode and the log is
# emitted at the end of the connection (eg: because %B or any log tag
# requiring LW_BYTES is set), the log is emitted after the connection is
# closed, so the address and ports cannot be retrieved anymore.
#
# It could be argued that we'd make a special case of these to immediately
# retrieve the source and destination addresses from the connection, but it
# seems cleaner to simply pin the front connection, marking it "tracked" by
# adding the LW_XPRT flag to mention that we'll need some of these elements
# at the last moment. Only LW_FRTIP and LW_CLIP are affected. Note that after
# this change, LW_FRTIP could simply be removed as it's not used anywhere.
#
# Note that the problem doesn't happen when using %[src] or %[dst] since
# all sample expressions set LW_XPRT.

varnishtest "Wrong ip/port logging"
feature ignore_unknown_macro

server s1 {
    rxreq
    txresp
} -start

syslog Slg_1 -level notice {
    recv
    recv
    recv info
    expect ~ 
\"dip\":\"${h1_fe_1_addr}\",\"dport\":\"${h1_fe_1_port}.*\"ts\":\"[cC]D\",\"
} -start

haproxy h1 -conf {
    global
        log stdout format short daemon
        log ${Slg_1_addr}:${Slg_1_port} local0

defaults
    log global
    timeout connect 3000
    timeout client 1
    timeout server  10000

frontend fe1
    bind "fd@${fe_1}"
    mode tcp
    log-format 
{\"dip\":\"%fi\",\"dport\":\"%fp\",\"c_ip\":\"%ci\",\"c_port\":\"%cp\",\"fe_name\":\"%ft\",\"be_name\":\"%b\",\"s_name\":\"%s\",\"ts\":\"%ts\",\"bytes_read\":\"%B\"}
    default_backend    be_app

backend be_app
    server app1 ${s1_addr}:${s1_port}
} -start

client c1 -connect ${h1_fe_1_sock} {
    txreq -url "/"
    delay 0.02
} -run

syslog Slg_1 -wait

Reply via email to