Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 493BA200B45 for ; Fri, 15 Jul 2016 20:44:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 47AA8160A61; Fri, 15 Jul 2016 18:44:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8F7B4160A57 for ; Fri, 15 Jul 2016 20:44:32 +0200 (CEST) Received: (qmail 92960 invoked by uid 500); 15 Jul 2016 18:44:31 -0000 Mailing-List: contact bugs-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: "Apache HTTPD Bugs Notification List" List-Id: Delivered-To: mailing list bugs@httpd.apache.org Received: (qmail 92951 invoked by uid 99); 15 Jul 2016 18:44:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2016 18:44:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 31B12C0472 for ; Fri, 15 Jul 2016 18:44:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.426 X-Spam-Level: X-Spam-Status: No, score=-0.426 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Sbl1zq4naea5 for ; Fri, 15 Jul 2016 18:44:30 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 128795F56E for ; Fri, 15 Jul 2016 18:44:30 +0000 (UTC) Received: from asf-bz1-us-mid.priv.apache.org (unknown [162.242.174.13]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTPS id 4D961E0425 for ; Fri, 15 Jul 2016 18:44:29 +0000 (UTC) Received: by asf-bz1-us-mid.priv.apache.org (ASF Mail Server at asf-bz1-us-mid.priv.apache.org, from userid 33) id 2A5BE60BDA; Fri, 15 Jul 2016 18:44:12 +0000 (UTC) From: bugzilla@apache.org To: bugs@httpd.apache.org Subject: [Bug 59864] segfault when using route-redirect pairs and both servers are disabled/in error mode Date: Fri, 15 Jul 2016 18:44:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Apache httpd-2 X-Bugzilla-Component: mod_proxy_balancer X-Bugzilla-Version: 2.5-HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rpluem@apache.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: bugs@httpd.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 archived-at: Fri, 15 Jul 2016 18:44:33 -0000 https://bz.apache.org/bugzilla/show_bug.cgi?id=59864 --- Comment #4 from Ruediger Pluem --- Sorry white space issue with the first post of the patch: Index: modules/proxy/mod_proxy_balancer.c =================================================================== --- modules/proxy/mod_proxy_balancer.c (revision 1752793) +++ modules/proxy/mod_proxy_balancer.c (working copy) @@ -212,7 +212,8 @@ /* Find the worker that has the 'route' defined */ static proxy_worker *find_route_worker(proxy_balancer *balancer, - const char *route, request_rec *r) + const char *route, request_rec *r, + int recursion) { int i; int checking_standby; @@ -249,10 +250,15 @@ * This enables to safely remove the member from the * balancer. Of course you will need some kind of * session replication between those two remote. + * Also check that we haven't gone thru all the + * balancer members by means of redirects. + * This should avoid redirect cycles. */ - if (*worker->s->redirect) { + if ((*worker->s->redirect) + && (recursion < balancer->workers->nelts)) { proxy_worker *rworker = NULL; - rworker = find_route_worker(balancer, worker->s->redirect, r); + rworker = find_route_worker(balancer, worker->s->redirect, + r, recursion + 1); /* Check if the redirect worker is usable */ if (rworker && !PROXY_WORKER_IS_USABLE(rworker)) { /* @@ -315,7 +321,7 @@ /* We have a route in path or in cookie * Find the worker that has this route defined. */ - worker = find_route_worker(balancer, *route, r); + worker = find_route_worker(balancer, *route, r, 1); if (worker && strcmp(*route, worker->s->route)) { /* * Notice that the route of the worker chosen is different from -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org