Home » XML » XML_HTMLSax » Bug #1261
Veriosn 2.1.2 result in memory leak
Details
| Submitted | 2004-04-22 15:37 UTC |
|---|---|
| From | sonny at sun dot com |
| Assigned | hfuecks |
| Status | Bogus |
| Package | XML_HTMLSax |
| PHP Version | 4.3.2 |
| OS | Solaris 9 |
| Roadmaps | (Not assigned) |
Comments
[2004-04-22 15:37 UTC] sonny at sun dot com
Description:
------------
Previos bersion what I have used was 1.1, which seems to work.
But an upgrade to 2.1.2 result in a memory leak.
[root@lab022 new]# php final.php | m
/sourcesoftware/php-4.3.2/Zend/zend_execute.c(1996) : Freeing 0x009A9FC0 (44 bytes), script=final.php
/sourcesoftware/php-4.3.2/Zend/zend_API.c(562) : Actual location (location was relayed)
Last leak repeated 1 time
/sourcesoftware/php-4.3.2/Zend/zend_execute.c(1178) : Freeing 0x009A9C78 (16 bytes), script=final.php
/sourcesoftware/php-4.3.2/Zend/zend_hash.c(178) : Freeing 0x009A96D0 (32 bytes), script=final.php
Last leak repeated 14 times
/sourcesoftware/php-4.3.2/Zend/zend_hash.c(262) : Freeing 0x009A9530 (41 bytes), script=final.php
Last leak repeated 36 times
/sourcesoftware/php-4.3.2/main/streams.c(1157) : Freeing 0x00A19218 (59501 bytes), script=final.php
/sourcesoftware/php-4.3.2/ext/standard/file.c(437) : Actual location (location was relayed)
/sourcesoftware/php-4.3.2/Zend/zend_execute.c(489) : Freeing 0x009A9068 (16 bytes), script=final.php
Last leak repeated 1 time
Reproduce code:
---------------
Same as in the README File.
Expected result:
----------------
without leak!
[2004-04-22 15:40 UTC] sonny at sun dot com
Here is my little testcase.
The open and close handler is the same like in the Readme file.
require_once 'RALparser.php';
require_once 'XML/XML_HTMLSax.php';
$handler =& new RALparser();
$parser =& new XML_HTMLSax();
$parser->set_object($handler);
$parser->set_option('XML_OPTION_CASE_FOLDING',false);
$parser->set_element_handler('openHandler', 'closeHandler');
$htmlCode = file_get_contents( 'out.html');
$parser->parse($htmlCode);
print_r($handler_return);
[2004-06-03 13:18 UTC] sonny at sun dot com
I can't do an upgrade on an newer version of php which would cause a too long downtime of the server.
What do you mean with 'm' tool?
[2004-06-04 08:00 UTC] sonny at sun dot com
I have changed the code in the constructor but it have the same behavior. Maybe it's one of my codes/scripts which will cause this memory leak. The 'm' tool is just 'more' not more ;-).
I have uploaded my scripts where you can take a look on it.
RALparser.php - http://dj.laxly.de/php/ral/RALparser.phps
final.php - http://dj.laxly.de/php/ral/final.phps
out3.html - http://dj.laxly.de/php/ral/out3.html
complete package: http://dj.laxly.de/php/ral/ral-tar
Maybe you can reconstruct it with my scripts. Or does i have an strange php config which cause the memory leaks.
phpinfo - http://dj.laxly.de/php/ral/phpinfo.php
[2004-06-04 10:58 UTC] sonny at sun dot com
No we're still running on 1.3.26.
In case of php I don't wanna use Apache 2.x.
The Multithreading seems not to work very well with php.
Bummer not to reproduce this.
But thanks for you coding hints.
I'm not very amused about the leak but I it's does not gone there is nothing I can do.
Might be in several constelation of funtions because this memory leak I have seen as well with phpDocumentor.
So I'd like to thank you for your support.