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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bs@php.net
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 18 13:03:38 2021 UTC