Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43467 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18609 invoked from network); 25 Mar 2009 18:57:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2009 18:57:46 -0000 Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:55731] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/E5-30978-9AE7AC94 for ; Wed, 25 Mar 2009 13:57:45 -0500 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id 4025B1EBC025; Wed, 25 Mar 2009 19:00:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fagyQiw7mzdT; Wed, 25 Mar 2009 20:00:49 +0100 (CET) Received: from [192.168.0.151] (77-58-151-147.dclient.hispeed.ch [77.58.151.147]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 48E911EBC024; Wed, 25 Mar 2009 20:00:48 +0100 (CET) Cc: php-dev List Message-ID: <56860495-F208-4F14-A85F-22FB094AD549@pooteeweet.org> To: Christian Seiler In-Reply-To: <49C05943.10003@gmx.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Wed, 25 Mar 2009 19:57:39 +0100 References: <49C05943.10003@gmx.net> X-Mailer: Apple Mail (2.930.3) Subject: Re: [PHP-DEV] Memory Leak in ob_get_clean() / ob_get_flush () From: mls@pooteeweet.org (Lukas Kahwe Smith) Hi, Did this get addressed yet? regards, Lukas On 18.03.2009, at 03:15, Christian Seiler wrote: > Hi, > > When running 'make test' on my system I discovered that > tests/output/ob_start_basic_unerasable_003.phpt and > tests/output/ob_start_basic_unerasable_004.phpt produced memory > leaks - > due to the fact that they first fetch the buffer into return_value but > then do RETURN_FALSE if they detect an error and thus leak the copied > buffer. > > I attached a patch that fixes that to this mail. > > Any objections to me applying this for 5.3 and HEAD? (after 5.3 RC1 > when > commits are allowed again of course) Any side-effects I didn't think > about? > > Regards, > Christian > Index: main/output.c > =================================================================== > RCS file: /repository/php-src/main/output.c,v > retrieving revision 1.167.2.3.2.4.2.12 > diff -u -p -r1.167.2.3.2.4.2.12 output.c > --- main/output.c 13 Feb 2009 11:48:17 -0000 1.167.2.3.2.4.2.12 > +++ main/output.c 18 Mar 2009 02:09:13 -0000 > @@ -867,10 +867,12 @@ PHP_FUNCTION(ob_get_flush) > /* error checks */ > if (!OG(ob_nesting_level)) { > php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to > delete and flush buffer. No buffer to delete or flush."); > + zval_dtor(return_value); > RETURN_FALSE; > } > if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && ! > OG(active_ob_buffer).erase) { > php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to > delete buffer %s.", OG(active_ob_buffer).handler_name); > + zval_dtor(return_value); > RETURN_FALSE; > } > /* flush */ > @@ -892,10 +894,12 @@ PHP_FUNCTION(ob_get_clean) > /* error checks */ > if (!OG(ob_nesting_level)) { > php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to > delete buffer. No buffer to delete."); > + zval_dtor(return_value); > RETURN_FALSE; > } > if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && ! > OG(active_ob_buffer).erase) { > php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to > delete buffer %s.", OG(active_ob_buffer).handler_name); > + zval_dtor(return_value); > RETURN_FALSE; > } > /* delete buffer */ > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Lukas Kahwe Smith mls@pooteeweet.org