php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33190 Union of external documents causes timeout
Submitted: 2005-05-30 20:25 UTC Modified: 2005-05-31 00:18 UTC
From: php dot bugs at jamie-thompson dot co dot uk Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 4.3.10 OS: Debian Sarge
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php dot bugs at jamie-thompson dot co dot uk
New email:
PHP Version: OS:

 

 [2005-05-30 20:25 UTC] php dot bugs at jamie-thompson dot co dot uk
Description:
------------
I'm using external xml files to populate a select control. As XSLT 1.0 doesn't allow arbitray node-sets, I load these from external documents using the document() function. One file contains the actual data, the other contains a wildcard entry. I want to union these nodesets and use the result to populate the control.

This works fine with Firefox's Transformiix engine, but Sablotron seems to dislike the union operator immensely when used on external data, E.g. merging a local nodeset with an external one causes a lockup, as does merging two identical exterbal nodesets (though only from different sources).

Info:
-----
I am using Debian Sarge, with fully updated packages as of 30/05/05, currently that's PHP 4.3.10-15 and Apache 2.0.54-4.

Here's the configure line from phpinfo():
'../configure' '--prefix=/usr' '--with-apxs2=/usr/bin/apxs2' '--with-config-file-path=/etc/php4/apache2' '--enable-memory-limit' '--disable-debug' '--with-regex=php' '--disable-rpath' '--disable-static' '--with-pic' '--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db4' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--disable-xml' '--with-expat-dir=/usr' '--with-xmlrpc' '--enable-yp' '--with-zlib' '--without-pgsql' '--with-kerberos=/usr' '--with-openssl=/usr' '--with-zip=/usr' '--enable-dbx' '--with-mime-magic=/usr/share/misc/file/magic.mime' '--with-exec-dir=/usr/lib/php4/libexec' '--without-mm' '--without-mysql' '--without-sybase-ct'



Reproduce code:
---------------
I have attempted to cobble together some testcases, these can be found at:

http://random.jamie-thompson.co.uk/sablotron/bug.xsl
http://random.jamie-thompson.co.uk/sablotron/bug1.xml
http://random.jamie-thompson.co.uk/sablotron/bug2.xml
http://random.jamie-thompson.co.uk/sablotron/bug1clone.xml

The xsl file is single-source file, (a stylesheet wrapped in an xml wrapper so as to be able to include arbitray local nodesets for testing), which loads the xml files using the document function.

In the xsl file's main template you will find a number of tests, with those that cause lock-ups commented out. These scenarios are:

* performing a union of two external nodesets. This seems to work, sometimes. It started working in my testcase at some indeterminate point, however it still causes lockups in my actual code.
* performing a union of an external xml file with a local node set. This causes Sablotron to lock up
* performing a union of an external xml file with another containing the same node set. This also causes Sablotron to lock up

Expected result:
----------------
I expect to get the union of the two node sets without a lockup occurring.

Firefox's output with all of the tests enabled is:
one:
equipment
list
item
equipment
id
0
name
Any Equipment

two:
equipment
list
item
equipment
id
1
name
More Equipment

local:
random
hi
random
woo

remote 1:
equipment
list
item
equipment
id
0
name
Any Equipment

remote 2:
equipment
list
item
equipment
id
1
name
More Equipment

dual remote:
list
item
equipment
id
1
name
More Equipment
list
item
equipment
id
0
name
Any Equipment

single remote and local:
random
hi
equipment
list
item
equipment
id
0
name
Any Equipment

clone remote:
equipment
list
item
equipment
id
0
name
Any Equipment
equipment
list
item
equipment
id
0
name
Any Equipment



Actual result:
--------------
With logging turned on, I get this:
Sablotron Message on line none, level log: Parsing 'file:///var/www/random/sablotron/bug.xsl'...
Sablotron Message on line none, level log: Parse done in 0.042 seconds
Sablotron Message on line none, level log: Parsing 'file:///var/www/random/sablotron/bug.xsl'...
Sablotron Message on line none, level log: Parse done in 0.015 seconds
Sablotron Message on line none, level log: Executing stylesheet 'file:///var/www/random/sablotron/bug.xsl'...
Sablotron Message on line none, level log: Parsing 'file:///var/www/random/sablotron/bug1.xml'...
Sablotron Message on line none, level log: Parse done in 0.003 seconds
Sablotron Message on line none, level log: Parsing 'file:///var/www/random/sablotron/bug2.xml'...
Sablotron Message on line none, level log: Parse done in 0.002 seconds
Sablotron Message on line none, level log: Parsing 'file:///var/www/random/sablotron/bug1clone.xml'...
Sablotron Message on line none, level log: Parse done in 0.002 seconds

...and thats it, the script just times out after using most of the cpu for the duration.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-30 23:06 UTC] sniper@php.net
And you're sure it's not bug in Sablotron?
I'm having a bit hard time believing this is anything genuine since your configure line won't produce a PHP with xslt support..and the lack of the example PHP script makes it also pretty hard to reproduce. Report to the sablotron people, they maintain the extension too.. (which, btw. will not exist in PHP 5)

 [2005-05-31 00:08 UTC] php dot bugs at jamie-thompson dot co dot uk
Ok, fair enough. The configure line thing is probably due to Debian shipping extentions as modules. I was under the impression that php extention bugs go here, but fair enough, I'll let the sablotron people know. 

Thanks for your time.
 [2005-05-31 00:18 UTC] php dot bugs at jamie-thompson dot co dot uk
...and whilst I remember, I left off the sample PHP code I used as it's irrelevant to the problem, but irrespective of that it's also about as trivial as you can get:

<?php

set_time_limit ( 10 );

$xh = xslt_create();

xslt_set_log($xh, true);
xslt_set_log($xh, getcwd() . '/myfile.log');

$result = xslt_process($xh, 'bug.xsl', 'bug.xsl');
echo $result;

xslt_free($xh);

?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC