#34952 [Opn->Csd]: double free when passing node from external document() to a PHP function

From: Date: Fri, 21 Oct 2005 21:30:05 +0000
Subject: #34952 [Opn->Csd]: double free when passing node from external document() to a PHP function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-86907@lists.php.net to get a copy of this message
ID: 34952 Updated by: tony2001@php.net Reported By: theo at crazygreek dot co dot uk -Status: Open +Status: Closed Bug Type: XSLT related Operating System: Linux PHP Version: 5.0.5 New Comment: I didn't ask you to setup a separate server or to test PHP contstantly or did I? I asked you to download the latest snapshot and give it a try (you do know that you don't have to do make install, right?). It works fine for me with latest CVS. Please reopen the report if you still can reproduce it with latest snapshots. Previous Comments: ------------------------------------------------------------------------ [2005-10-21 23:20:50] theo at crazygreek dot co dot uk I'm afraid I don't have the time to keep a seperate server running with latest PHP on. As it happens, a colleauge happens to have a cvs version installed and i've asked him to test and report findings here. As a note, if he didn't have a copy installed, my reponse would still have been just the first paragraph of this comment. I'm a developer, not a quality assurance tester, and i do not expect to have to constantly keep latest CVS compiled somewhere just so i can test something every time PHP crashes. ------------------------------------------------------------------------ [2005-10-21 22:59:07] tony2001@php.net Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2005-10-21 22:57:48] theo at crazygreek dot co dot uk Description: ------------ Performing a PHP callback from within an XSLT template with a parameter of an element that is inside a external XML document causes a double free, followed by crash. Running latest stable PHP. Reproduce code: --------------- ========= crash.php ========= $xslt = new XsltProcessor(); $xslt->registerPHPFunctions(); $xslt->importStyleSheet(DOMDocument::load('test.xsl')); echo $xslt->transformToDoc(new DOMDocument())->saveXml(); function crashMe() { return null; } ========= crash.xsl ========= <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" version="1.0"> <xsl:template match="/"> <xsl:copy-of select="php:function('crashMe', document('crash.xml'))"/> </xsl:template> </xsl:stylesheet> ========= crash.xml ========= <?xml version="1.0"?> <crashed/> Expected result: ---------------- Just the following: <?xml version="1.0"?> Actual result: -------------- A crash! *** glibc detected *** double free or corruption (fasttop): 0x085d8540 *** Aborted ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34952&edit=1

« previous php.bugs (#86907) next »