Hi Praveen,

On Wed, Apr 11, 2018 at 02:16:28PM +0000, UPPALAPATI, PRAVEEN wrote:
> Hi Haproxy-Team,
> 
> I tried compiling different minor versions of 1.8.x releases and all the 
> minor versions are crashing whe trying to use option http-proxy:
> 
> Configuration that is causing issue:
> 
> listen http_proxy-8888
> bind *:9876
> mode http
> option httplog
> http-request set-uri 
> http://%[url_param(idnsredirHost)]%[capture.req.uri<http://%25[url_param(idnsredirHost)]%25[capture.req.uri>]
> option http_proxy
> 
> If I don't use option http_proxy things work normally. Following is from the 
> core dump:
> 
> : #0 0x0000000000454839 in cs_destroy (cs=0x207edd0) at 
> include/proto/connection.h:704
> 704 cs->conn->mux->detach(cs);
> Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7.x86_64 
> keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-8.el7.x86_64 
> libcom_err-1.42.9-10.el7.x 86_64 libselinux-2.5-11.el7.x86_64 
> openssl-libs-1.0.2k-8.el7.x86_64 pcre-8.32-17.el7.x86_64 
> zlib-1.2.7-17.el7.x86_64
> (gdb) bt
> #0 0x0000000000454839 in cs_destroy (cs=0x207edd0) at 
> include/proto/connection.h:704
> #1 si_release_endpoint (si=0x2083540) at include/proto/stream_interface.h:162
> #2 stream_free (s=0x20832e0) at src/stream.c:398
> #3 process_stream (t=<optimized out>) at src/stream.c:2513
> #4 0x00000000004bc38e in process_runnable_tasks () at src/task.c:229
> #5 0x0000000000408d9c in run_poll_loop () at src/haproxy.c:2399
> #6 run_thread_poll_loop (data=<optimized out>) at src/haproxy.c:2461
> #7 main (argc=<optimized out>, argv=0x7ffe6e2cf2d8) at src/haproxy.c:3065
> (gdb) quit
> 
> 
[...]
> Please let me know what's the root cause this option works fine with 1.7.x 
> version.
> 

It's related to changes we made in the architecture in 1.8.
The attached patch should fix it. It was made for master, but should apply to
1.8 as well.

Thanks for reporting !

Olivier
>From 7c9f06727cf60acf873353ac71283ff9c562aeee Mon Sep 17 00:00:00 2001
From: Olivier Houchard <ohouch...@haproxy.com>
Date: Wed, 11 Apr 2018 17:23:17 +0200
Subject: [PATCH] BUG/MINOR: connection: Setup a mux when in proxy mode.

We were allocating a new connection when in proxy mode, but did not provide
it a mux, thus crashing later.

This should be backported to 1.8.
---
 src/proto_http.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/proto_http.c b/src/proto_http.c
index 80e001d69..817692c48 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -62,6 +62,7 @@
 #include <proto/h1.h>
 #include <proto/log.h>
 #include <proto/hdr_idx.h>
+#include <proto/mux_pt.h>
 #include <proto/pattern.h>
 #include <proto/proto_tcp.h>
 #include <proto/proto_http.h>
@@ -3718,6 +3719,8 @@ int http_process_request(struct stream *s, struct channel 
*req, int an_bit)
 
                        return 0;
                }
+               /* XXX: We probably need a better mux */
+               conn_install_mux(conn, &mux_pt_ops, objt_cs(s->si[1].end));
 
                path = http_get_path(txn);
                url2sa(req->buf->p + msg->sl.rq.u,
-- 
2.14.3

Reply via email to