Re: GMP memory allocator, various issues

From: Date: Fri, 10 Oct 2014 21:12:42 +0000
Subject: Re: GMP memory allocator, various issues
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-77862@lists.php.net to get a copy of this message
On 10 Oct 2014, at 17:50, Stas Malyshev <smalyshev@sugarcrm.com> wrote: > Hi! > >> Can you please elaborate a little ? >> Doesn't such leak have to be fixed in ext/gmp ? > > 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/

« previous php.internals (#77862) next »