Re: Re: cvs: php-src(PHP_5_2) /main/streams streams.c
| From: | Antony Dovgal | Date: | Sun, 02 Jul 2006 18:43:00 +0000 |
| Subject: | Re: Re: cvs: php-src(PHP_5_2) /main/streams streams.c | ||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-39016@lists.php.net to get a copy of this message | ||
I wasn't able to reproduce it either, but I didn't look at it too deeply.
On 01.07.2006 15:55, Nuno Lopes wrote:
Hi Hannes,I've tested this thing again, with and without a debug build, and I really can't reproduce the memory leak. Can somebody please also test this? (run the ext/standard/tests/file/bug37864.phpt test without the patch above). I'm only trying to figure out where the problem is, because this introduces a little performance penalty when reading files. Nuno -- Wbr, Antony DovgalOn 6/22/06, Nuno Lopes <nlopess@php.net> wrote:You'd rather have it if(p) {if(!mapped) return NULL; .... } ?Hi,@@ -1216,7 +1216,7 @@p = php_stream_mmap_range(src, php_stream_tell(src),maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped);- if (p) { + if (p && mapped) { *buf = pemalloc_rel_orig(mapped + 1, persistent);if (*buf) {I don't think this "fix" is correct. With your patch, PHP will do more 2 syscalls without any reason (because PHP will try to read the file again).Anyway, I don't get any memory leak without your patch (at least with PHP 5.2). And take a look at _php_stream_passthru() or _php_stream_copy_to_stream(). If your patch is correct, these function would also need to be patched. Again, I get zero leaks.You need debug build to reproduce it. I reproduced it in 5.1, 5.2 and HEAD.. I however can't reproduce leak in _php_stream_copy_to_stream nor _php_stream_passthru() -Hannes