Re: leaks related with virtual_file_ex()
| From: | Nuno Lopes | Date: | Sun, 17 Sep 2006 12:03:01 +0000 |
| Subject: | Re: leaks related with virtual_file_ex() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25743@lists.php.net to get a copy of this message | ||
OK, first patch to fix the 'tests/lang/bug35176.phpt' specific problem: http://mega.ist.utl.pt/~ncpl/zend_include_memleak.txt
There might be other issues with virtual_file_ex() that I haven't fully tested.
Nuno
----- Original Message ----- From: "Nuno Lopes" <nlopess@php.net>
To: "PHPdev" <internals@lists.php.net>
Sent: Saturday, September 16, 2006 12:35 PM
Subject: [PHP-DEV] leaks related with virtual_file_ex()
Hello, There are some leaks in PHP associated with virtual_file_ex() usage. The problem is that that function doesn't free the new 'cwd' on error (path not found). Taking a look at http://lxr.php.net/ident?i=virtual_file_ex we can see the function usage. For example, expand_filepath() free()s the cwd on failure, while ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER() doesn't. I'm not sure if you want virtual_file_ex() to clean the cwd itself, or leave that responsibility to the caller, but we should define the convention and patch the relevant places (and fix those mem leaks). One test that triggers the problem is: tests/lang/bug35176.phpt Nuno