Bug #14522 Updated: Crash with using $node->unlink();

From: Date: Thu, 07 Mar 2002 22:59:06 +0000
Subject: Bug #14522 Updated: Crash with using $node->unlink();
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-1971@lists.php.net to get a copy of this message
ID: 14522 Updated by: lukas@edeal.de Reported By: klebermass@limtec.de Status: Closed Bug Type: DOM XML related Operating System: SuSe 7.3 PHP Version: CVS Download New Comment: beware: the bug is marked as closed, but a fix has not been applied to cvs yet. Previous Comments: ------------------------------------------------------------------------ [2002-02-19 15:16:27] klebermass@limtec.de The patch from lukas@edeal.de worked on my Server. Hope it will be soon in the CVS Version ------------------------------------------------------------------------ [2002-02-19 13:43:50] lukas@edeal.de This patch against latest CVS should fix it: (basically it makes domxml not free a node on unlink and rather wait for request shutdown to free a node). btw, this patch also enables a domxml user to re-add a previously unlink()ed node, which is impossible with the current code. regards, -lukas Index: ext/domxml/php_domxml.c =================================================================== RCS file: /repository/php4/ext/domxml/php_domxml.c,v retrieving revision 1.116 diff -u -r1.116 php_domxml.c --- ext/domxml/php_domxml.c 4 Feb 2002 21:07:39 -0000 1.116 +++ ext/domxml/php_domxml.c 19 Feb 2002 18:38:57 -0000 @@ -1801,8 +1801,6 @@ DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); xmlUnlinkNode(nodep); - xmlFreeNode(nodep); - zval_dtor(id); /* This is not enough because the children won't be deleted */ } /* }}} */ ------------------------------------------------------------------------ [2002-02-19 12:23:38] klebermass@limtec.de Nothing happening about the bug? Un Downloading regularly the newest CVS Version but doesnt help ------------------------------------------------------------------------ [2002-02-12 16:22:20] rrichards@digarc.com We have also reproduced this error on both RedHat 7.2 and FreeBSD 4.4 both running PHP 4.1.1. It completely takes down FREEBSD as apache continues to log seg faults until the drive is full. We had the same results with 4.0.6 prior to the upgrade as well. ------------------------------------------------------------------------ [2002-01-07 12:16:47] klebermass@limtec.de Sorry i havent been at home the second part of December. Here a sample code: <?php $xmlstruc=xmldoc("<?xml version=\"1.0\" standalone=\"no\" ?><root><down>bla</down></root>"); $xmlnode=$xmlstruc->root(); $xmlchilds=$xmlnode->children(); if(!is_array($xmlchilds)) $xmlchilds=array($xmlchilds); foreach ( $xmlchilds as $workingchild) { $workingchild->unlink();} echo $xmlstruc->dumpmem(); ?> martin ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/14522 -- Edit this bug report at http://bugs.php.net/?id=14522&edit=1

« previous php.bugs (#1971) next »