Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77862 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92945 invoked from network); 10 Oct 2014 21:12:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2014 21:12:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:48253] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/73-06615-1DB48345 for ; Fri, 10 Oct 2014 17:12:50 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 4F22DB00085; Fri, 10 Oct 2014 17:12:47 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lTzoTi0JoJ2A; Fri, 10 Oct 2014 17:12:47 -0400 (EDT) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id D9D85B0007B; Fri, 10 Oct 2014 17:12:45 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <54380E49.3060401@sugarcrm.com> Date: Fri, 10 Oct 2014 22:12:42 +0100 Cc: Remi Collet , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <0B72F49C-084E-4600-8313-21AEFDA4DBBC@ajf.me> References: <54379B40.6020403@fedoraproject.org> <5437CC48.6060806@fedoraproject.org> <54380E49.3060401@sugarcrm.com> To: Stas Malyshev X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] GMP memory allocator, various issues From: ajf@ajf.me (Andrea Faulds) On 10 Oct 2014, at 17:50, Stas Malyshev wrote: > Hi! >=20 >> Can you please elaborate a little ? >> Doesn't such leak have to be fixed in ext/gmp ? >=20 > We clean up the memory at the end of the request. But if the request > ended abnormally and we had some active gmp objects, with gmp data > allocated outside emalloc we could not clean that and it ends up being > persistent memory leak. Also, of course, that also excepts gmp objects > from PHP memory limit, which makes it less useful. This causes a particular problem for me with my bigint patch, were it to = ever make it into master. It sets gmp to use emalloc as its allocators = (much like ext/gmp). This means it obeys memory limits. Being able to = circumvent the memory limit and DoS the server by doing a stupidly large = exponentiation would be quite scary. -- Andrea Faulds http://ajf.me/