On 10 Oct 2014, at 17:50, Stas Malyshev <smalys...@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/





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to