Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F1EC31034E for ; Fri, 13 Dec 2013 13:06:14 +0000 (UTC) Received: (qmail 42790 invoked by uid 500); 13 Dec 2013 13:06:11 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 42758 invoked by uid 500); 13 Dec 2013 13:06:10 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 42744 invoked by uid 99); 13 Dec 2013 13:06:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 13:06:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ylavic.dev@gmail.com designates 209.85.223.170 as permitted sender) Received: from [209.85.223.170] (HELO mail-ie0-f170.google.com) (209.85.223.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 13:06:01 +0000 Received: by mail-ie0-f170.google.com with SMTP id qd12so2754472ieb.29 for ; Fri, 13 Dec 2013 05:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=dCaxKmHYThTT8gfQjXGrC3l644pjh9hEWbcnUancxVI=; b=A0j41dsGH/JGcylAWR0m9C1WYwQycK32jW5It+S++jf2VvmlB9vCsUYFftyrqb3gQq 7IbLsxm0Z+l055wxmM6pXiylfbq8Iv0ehQrhwghk7eKc/IlGEU60/iGtpdt54YJet3c2 0AL5SvsB8UulmUYRemGlZM2uI1xH3KplkpKgYhDgb+9AAwzWFgtsu9Qd8YpU7DPVKty7 BS9hScBBf4DSOwbaQIy8M6ZNMxPZcV6gIShiFsCPwfwveDoe/LjtvBSDb9yzNWQlrpGN EFGh949X2c0Sde6SCC3Nl8TkSzqvKQeBugkLWcF64OoQhkCIl5P78J981F8enqScYvUM xWTw== MIME-Version: 1.0 X-Received: by 10.50.82.41 with SMTP id f9mr2491640igy.26.1386939940772; Fri, 13 Dec 2013 05:05:40 -0800 (PST) Received: by 10.43.60.205 with HTTP; Fri, 13 Dec 2013 05:05:40 -0800 (PST) In-Reply-To: <52AAD459.6010808@apache.org> References: <52AAD459.6010808@apache.org> Date: Fri, 13 Dec 2013 14:05:40 +0100 Message-ID: Subject: Re: [PATCH] ap_proxy_http_process_response double lifetime transform From: Yann Ylavic To: httpd Content-Type: multipart/alternative; boundary=047d7bd8fe387ea03b04ed6a1e84 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd8fe387ea03b04ed6a1e84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Dec 13, 2013 at 10:33 AM, Ruediger Pluem wrote: > > > Yann Ylavic wrote: > > Hi devs, > > > > This was pointed out by Joe Orton's comment at > https://issues.apache.org/bugzilla/show_bug.cgi?id=3D50335#c40. > > > > Here is a proposal (patch against ap_proxy_http_process_response) to > address the double lifetime transformation of the > > buckets from the backend when its connection is released early (on EOS, > before the last buckets are forwarded to the > > client). > > In this case the buckets that would be sent to the output filters would > have been allocated from the wrong allocator > which can lead to crashes. IMHO the code is fine as is. It might be > possible to optimize here, but the patch below just > sents down buckets with the wrong lifetime down the chain. > Yes you are right, the patch only cares about the pool... I guess the optimisation should be in proxy_buckets_lifetime_transform(), but an efficient APR way of copying/setting aside buckets (including the bucket_alloc, ie. refcounting), depending on the bucket type, would be welcome... > > Regards > > R=FCdiger > > --047d7bd8fe387ea03b04ed6a1e84 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On F= ri, Dec 13, 2013 at 10:33 AM, Ruediger Pluem <rpluem@apache.org> wrote:


Yann Ylavic wrote:
> Hi devs,
>
> This was pointed out by Joe Orton's comment at h= ttps://issues.apache.org/bugzilla/show_bug.cgi?id=3D50335#c40.
>
> Here is a proposal (patch against ap_proxy_http_process_response) to a= ddress the double lifetime transformation of the
> buckets from the backend when its connection is released early (on EOS= , before the last buckets are forwarded to the
> client).

In this case the buckets that would be sent to the output filters wou= ld have been allocated from the wrong allocator
which can lead to crashes. IMHO the code is fine as is. It might be possibl= e to optimize here, but the patch below just
sents down buckets with the wrong lifetime down the chain.
=

Yes you are right, the patch only cares about the pool...

I guess the optimisation should be in proxy_buckets_lifetime_t= ransform(), but an efficient APR way of copying/setting aside buckets (incl= uding the bucket_alloc, ie. refcounting), depending on the bucket type, wou= ld be welcome...
=A0

Regards

R=FCdiger


--047d7bd8fe387ea03b04ed6a1e84--