Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8600 invoked from network); 6 Feb 2014 20:34:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2014 20:34:55 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.100 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.100 blu0-omc2-s25.blu0.hotmail.com Windows 2000 SP4, XP SP1 Received: from [65.55.111.100] ([65.55.111.100:36132] helo=blu0-omc2-s25.blu0.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/D0-04585-DE1F3F25 for ; Thu, 06 Feb 2014 15:34:54 -0500 Received: from BLU0-SMTP204 ([65.55.111.71]) by blu0-omc2-s25.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 6 Feb 2014 12:34:50 -0800 X-TMN: [OJdVaEKATjRUmKmP+q/VuYfYLjLiuRR8] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Received: from bobweinandsimac.fritz.box ([83.99.81.102]) by BLU0-SMTP204.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 6 Feb 2014 12:34:47 -0800 Content-Type: multipart/alternative; boundary="Apple-Mail=_54B511CA-B2D1-40AE-B684-ABA1237CFA25" MIME-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) In-Reply-To: Date: Thu, 6 Feb 2014 21:34:44 +0100 CC: Ferenc Kovacs , PHP Internals References: To: Tjerk Meesters X-Mailer: Apple Mail (2.1827) X-OriginalArrivalTime: 06 Feb 2014 20:34:47.0534 (UTC) FILETIME=[E06E48E0:01CF237A] Subject: Re: memory leak in the new power operator tests From: bobwei9@hotmail.com (Bob Weinand) --Apple-Mail=_54B511CA-B2D1-40AE-B684-ABA1237CFA25 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Am 6.2.2014 um 21:02 schrieb Tjerk Meesters : > Hi, >=20 >=20 > On Fri, Feb 7, 2014 at 12:34 AM, Ferenc Kovacs = wrote: >=20 >=20 >=20 > On Thu, Feb 6, 2014 at 4:40 PM, Ferenc Kovacs = wrote: > Hi, >=20 > After Bob merged the pow related changes, executing the new tests with = --enable-debug I've got two memory leaks: >=20 > [tyrael@Ferencs-MacBook-Pro-135 php-src.git (PHP-5.6.0 =E2=9C=97)]$ = cat ext/standard/tests/math/pow_variation1_64bit.diff = ext/standard/tests/math/pow_variation2.diff > 083+ [Thu Feb 6 16:20:51 2014] Script: = '/Users/tyrael/checkouts/php-src.git/ext/standard/tests/math/pow_variation= 1_64bit.php' > 084+ /Users/tyrael/checkouts/php-src.git/Zend/zend_API.c(314) : = Freeing 0x10D280C50 (72 bytes), = script=3D/Users/tyrael/checkouts/php-src.git/ext/standard/tests/math/pow_v= ariation1_64bit.php > 085+ /Users/tyrael/checkouts/php-src.git/Zend/zend_variables.c(141) : = Actual location (location was relayed) > 086+ =3D=3D=3D Total 1 memory leaks detected =3D=3D=3D083+ [Thu Feb 6 = 16:20:51 2014] Script: = '/Users/tyrael/checkouts/php-src.git/ext/standard/tests/math/pow_variation= 2.php' > 084+ /Users/tyrael/checkouts/php-src.git/Zend/zend_API.c(314) : = Freeing 0x10CB8CBE0 (72 bytes), = script=3D/Users/tyrael/checkouts/php-src.git/ext/standard/tests/math/pow_v= ariation2.php > 085+ /Users/tyrael/checkouts/php-src.git/Zend/zend_variables.c(141) : = Actual location (location was relayed) > 086+ =3D=3D=3D Total 1 memory leaks detected =3D=3D=3D% >=20 > not sure if these were originally in the PR or just something went = wrong with the merge/cherry pick, but would be nice if somebody could = look into it. > thanks! >=20 > --=20 > Ferenc Kov=C3=A1cs > @Tyr43l - http://tyrael.hu >=20 > it seems the leak occures when pow() is called with an array: > [tyrael@Ferencs-MacBook-Pro-135 php-src.git (PHP-5.6.0 =E2=9C=97)]$ = ./sapi/cli/php -r 'pow(array(),2);' > [Thu Feb 6 17:32:43 2014] Script: '-' > Zend/zend_vm_execute.h(28951) : Freeing 0x1100B9ED8 (72 bytes), = script=3D- > /Users/tyrael/checkouts/php-src.git/Zend/zend_API.c(1011) : Actual = location (location was relayed) > =3D=3D=3D Total 1 memory leaks detected =3D=3D=3D >=20 > Not sure why that didn't pop up earlier; I've attached a patch that = resolves the memory leak. >=20 > One gotcha: the output of `pow(0, [])` is now `int(1)` instead of = `float(1)`. I hope that's alright :) > =20 >=20 > --=20 > Ferenc Kov=C3=A1cs > @Tyr43l - http://tyrael.hu >=20 >=20 >=20 > --=20 > -- > Tjerk > Your patch wasn't 100% correct, but I corrected that. I've pushed the fix now. Bob --Apple-Mail=_54B511CA-B2D1-40AE-B684-ABA1237CFA25--