From:             php dot bugs at jamie-thompson dot co dot uk
Operating system: Debian Sarge
PHP version:      4.3.10
PHP Bug Type:     XSLT related
Bug description:  Union of external documents causes timeout

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.

-- 
Edit bug report at http://bugs.php.net/?id=33190&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33190&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33190&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33190&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33190&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33190&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33190&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33190&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33190&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33190&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33190&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33190&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33190&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33190&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33190&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33190&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33190&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33190&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33190&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33190&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33190&r=mysqlcfg

Reply via email to