Hi Olivier,

Op 11-1-2019 om 19:17 schreef Olivier Houchard:
Ok so erm, I'd be lying if I claimed I enjoy working on the check code, or
that I understand it fully. However, after talking with Willy and Christopher,
I think I may have comed with an acceptable solution, and the attached patch
should fix it (at least by getting haproxy to segfault, but it shouldn't
mailbomb you anymore).
Pieter, I'd be very interested to know if it still work with your setup.
It's a different way of trying to fix what you tried ot fix with
1714b9f28694d750d446917672dd59c46e16afd7
I'd like to be sure I didn't break it for you again:)

Regards,

Olivier
(Slightly modified patches, I think there were a potential race condition
when running with multiple threads).

Olivier

Thanks for this 'change in behavior' ;). Indeed the mailbomb is fixed, and it seems the expected mails get generated and delivered, but a segfault also happens on occasion. Not with the regtest as it was, but with a few minor modifications (adding a unreachable mailserver, and giving it a little more time seems to be the most reliable reproduction a.t.m.) it will crash consistently after 11 seconds.. So i guess the patch needs a bit more tweaking.

Regards,
PiBa-NL (Pieter)

Core was generated by `haproxy -d -f /tmp/vtc.37274.4b8a1a3a/h1/cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000500955 in chk_report_conn_err (check=0x802616a10, errno_bck=0, expired=1) at src/checks.c:689
689 dns_trigger_resolution(check->server->dns_requester);
(gdb) bt full
#0  0x0000000000500955 in chk_report_conn_err (check=0x802616a10, errno_bck=0, expired=1) at src/checks.c:689
        cs = 0x8027de0c0
        conn = 0x802683180
        err_msg = 0x80266d0c0 " at step 1 of tcp-check (connect)"
        chk = 0x80097b848
        step = 1
        comment = 0x0
#1  0x00000000005065a5 in process_chk_conn (t=0x802656640, context=0x802616a10, state=513) at src/checks.c:2261
        check = 0x802616a10
        proxy = 0x8026c3000
        cs = 0x8027de0c0
        conn = 0x802683180
        rv = 0
        ret = 0
        expired = 1
#2  0x000000000050596e in process_chk (t=0x802656640, context=0x802616a10, state=513) at src/checks.c:2330
        check = 0x802616a10
#3  0x00000000004fe0a2 in process_email_alert (t=0x802656640, context=0x802616a10, state=513) at src/checks.c:3210
        check = 0x802616a10
        q = 0x802616a00
        alert = 0x7fffffffe340
#4  0x00000000005f2523 in process_runnable_tasks () at src/task.c:435
        t = 0x802656640
        state = 513
        ctx = 0x802616a10
        process = 0x4fdeb0 <process_email_alert>
        t = 0x8026566e0
        max_processed = 200
#5  0x00000000005163a2 in run_poll_loop () at src/haproxy.c:2619
        next = 1062130135
        exp = 1062129684
#6  0x0000000000512ff8 in run_thread_poll_loop (data=0x8026310f0) at src/haproxy.c:2684
        start_lock = 0
        ptif = 0x935d40 <per_thread_init_list>
---Type <return> to continue, or q <return> to quit---
        ptdf = 0x0
#7  0x000000000050f626 in main (argc=4, argv=0x7fffffffead8) at src/haproxy.c:3313
        tids = 0x8026310f0
        threads = 0x8026310f8
        i = 1
        old_sig = {__bits = {0, 0, 0, 0}}
        blocked_sig = {__bits = {4227856759, 4294967295, 4294967295, 4294967295}}
        err = 0
        retry = 200
        limit = {rlim_cur = 4046, rlim_max = 4046}
        errmsg = "\000\352\377\377\377\177\000\000\000\353\377\377\377\177\000\000\330\352\377\377\377\177\000\000\004\000\000\000\000\000\000\00 0\b\250\037\315})5:`)\224\000\000\000\000\000\320\352\377\377\377\177\000\000\000\353\377\377\377\177\000\000\330\352\377\377\377\177\000\000\004 \000\000\000\000\000\00
 reg-tests/mailers/k_healthcheckmail.vtc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/reg-tests/mailers/k_healthcheckmail.vtc 
b/reg-tests/mailers/k_healthcheckmail.vtc
index d3af3589..820191c8 100644
--- a/reg-tests/mailers/k_healthcheckmail.vtc
+++ b/reg-tests/mailers/k_healthcheckmail.vtc
@@ -48,6 +48,7 @@ defaults
 #      timeout mail 20s
 #      timeout mail 200ms
       mailer smtp1 ${h1_femail_addr}:${h1_femail_port}
+      mailer smtp2 ipv4@192.0.2.100:1025
 
 } -start
 
@@ -62,7 +63,7 @@ client c1 -connect ${h1_luahttpservice_sock} {
 
 delay 2
 server s2 -repeat 5 -start
-delay 5
+delay 10
 
 client c2 -connect ${h1_luahttpservice_sock} {
     timeout 2

Reply via email to