php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26057 domxml_xmltree leaks
Submitted: 2003-10-31 10:03 UTC Modified: 2003-11-03 05:23 UTC
From: bs@php.net Assigned:
Status: Wont fix Package: DOM XML related
PHP Version: 4.3.3 OS: Linux
Private report: No CVE-ID: None
 [2003-10-31 10:03 UTC] bs@php.net
Description:
------------
domxml_xmltree seams to have a memory leak at least with libxml 2.5.11

Reproduce code:
---------------
php -r "while(1) xmltree('<foo />');"

Actual result:
--------------
process crashes because of exceeded memory limit

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-01 06:05 UTC] sniper@php.net
Yeah, I can reproduce this with: "php -r 'while(1) $i.="foo";' 
so I wouldn't call it a bug..

IIRC, there's a 'free()' method in the domxml stuff now, you should use that.

 [2003-11-01 07:40 UTC] bs@php.net
i wonder if you could reproduce it with "while(1) 'foo';" ... there is no free method but the last line of PHP_FUNCTION(domxml_xmltree) is
/*	xmlFreeDoc(docp); */
so that might be the problem
 [2003-11-03 05:23 UTC] moriyoshi@php.net
As ZendEngine1 doesn't provide capability for its extensions to track the lifetime of the userland object that wraps an underlying libxml object, such objects can  never be destroyed during the session (request) at the right time.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 21:01:27 2024 UTC