php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24634 PHP crashes after serveral realods of script that uses importstylesheet()
Submitted: 2003-07-13 10:48 UTC Modified: 2003-09-02 18:16 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: cw at centerwave dot de Assigned:
Status: No Feedback Package: XSLT related
PHP Version: 5CVS-2003-07-13 (dev) OS: Windows 2000, WindowsXP
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: cw at centerwave dot de
New email:
PHP Version: OS:

 

 [2003-07-13 10:48 UTC] cw at centerwave dot de
Description:
------------
PHP (and Apache) crashes after running the importstylesheet()-function on an domdocument serveral times (means serveral reloads of the same script, not use of this function serveral times in the same script).

If the XSL-input is large (> 50kb) PHP crashes after 3-5 site reloads. If the XSL-input is small it seems that PHP crashes after 10-20 site reloads. The very strange thing is that it renders the page with the *same* XSL/XML-input serveral times  without problems before crashing after a certain amount of realods. It seems not to be important what XSL-ruleset is used. I tested serveral xsl-inputs and it always died.

It crashes just on Windows (Apache and Apache 2). I used the libxml that came with PHP as well as the latest from xmlsoft.org.

There are no problems under Linux. 
 

Reproduce code:
---------------
Example 1:
$output is the XML-string (sorry this is very long so I can't post it, but the xml-string is not import to reproduce to error, as well as the XSL-string isn't)

$processor = new xsltprocessor();
$xml = new domdocument();
$xsl = new domdocument();
$xsl_filecontent = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/evolution/gui/" . $passport->get_design("current") . "/html.xsl");
$xsl->loadxml($xsl_filecontent); 
$xml->loadxml($output);
$processor->importstylesheet($xsl);
print ($processor->transformtoxml($xml));

Example 2:
It also crashes when using the example at 
http://news.php.net/article.php?group=php.xml.dev&article=148



Expected result:
----------------
transformed xml output

Actual result:
--------------
Sorry I can't give you a backtrace with my windows-system. I can just tell you that the last call goes to libxml2.dll.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-13 10:59 UTC] cw at centerwave dot de
Please note that the 2nd example still includes the old functionnames (which worked with beta1). I certainly changed them to work with snapsshots.
 [2003-08-07 10:12 UTC] mario at xtras dot de
This issue still applies and also for transformtodoc in Beta 1 through the build of CVS WIN32 Built On: Aug 07, 2003 10:30 GMT.

Same random crashes when the two functions are called on the same page repeatedly. Sometimes after 2 reloads, sometimes 10. It also appears to depend on the size of the XSL file, the XML file does not seem to matter.
 [2003-08-26 05:47 UTC] rrichards@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


 [2003-09-02 18:16 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 16:01:30 2024 UTC