|  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: Assigned:
Status: Wont fix Package: DOM XML related
PHP Version: 4.3.3 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-10-31 10:03 UTC]
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-01 06:05 UTC]
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]
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]
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 Apr 13 12:01:28 2024 UTC