php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24989 PHP 4.3.3RC3 & Sablot 1.0 problem
Submitted: 2003-08-08 15:58 UTC Modified: 2003-08-09 10:41 UTC
From: sitnikov at infonet dot ee Assigned:
Status: Closed Package: XSLT related
PHP Version: 4.3.3RC3 OS: Linux
Private report: No CVE-ID: None
 [2003-08-08 15:58 UTC] sitnikov at infonet dot ee
Description:
------------
b.xml
------------------------------------
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="b.xsl"?>
<test>
</test>
------------------------------------

b.xsl
------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/test">
<html>
   <head>
   <title>TEST</title>
   </head>
   <body bgcolor="blue" text="#000000">
   <center>HELLO</center>
   </body>
</html>
</xsl:template>
</xsl:stylesheet>
------------------------------------

b.php
------------------------------------
<?
// Allocate a new XSLT processor
$xh = xslt_create() or die('Can not do; xslt_create()');

xslt_set_log($xh, true);
xslt_set_log($xh, '/tmp/sablot.log');

// Process the document
if ($result = xslt_process($xh, './data/b.xml', './data/b.xsl')) {
    print "SUCCESS, test.xml was transformed by test.xsl into result.xml";
    print ", result.xml has the following contents\n<br>\n";
    print "<pre>\n";
    echo $result;
    print "</pre>\n";
}
else {
    print "Sorry, test.xml could not be transformed by test.xsl into";
    print "  result.xml the reason is that " . xslt_error($xh) . " and the ";
    print "error code is " . xslt_errno($xh);
}

xslt_free($xh);
?>
--------------------------------------

Results:

sabcmd: SUCCESS
PHP 4.3.2:  SUCCESS
PHP 4.3.3RC3: ERROR (duplicate attribute and the error code is 2)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-08 18:43 UTC] sniper@php.net
I can not reproduce this with latest PHP CVS and Sabltron 1.0. The output is 'SUCCESS' always.

How did you configure Sablotron? And PHP?

 [2003-08-09 00:34 UTC] sitnikov at infonet dot ee
PHP:
./configure \
--enable-inline-optimization \
--prefix=/usr/local/apache-dev/php \
--with-apxs=/usr/local/apache-dev/bin/apxs \
--with-config-file-path=/usr/local/apache-dev/Zend/etc \
--enable-track-vars \
--enable-magic-quotes \
--enable-safe-mode \
--enable-memory-limit \
--enable-sysvshm \
--enable-sysvsem \
--enable-shmop \
--enable-sockets \
--enable-wddx \
--enable-xslt \
--enable-ctype \
--enable-bcmath \
--enable-mailparse \
--enable-ftp \
--enable-dba \
--enable-dbase \
--with-ndbm \
--with-gdbm \
--with-db2 \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-ttf \
--with-t1lib \
--with-mysql=/usr/local/mysql \
--with-epipe \
--with-mcrypt \
--with-mhash \
--with-zlib \
--with-mm \
--with-xmlrpc \
--with-iconv=/usr/local \
--with-iconv-dir=/usr/local \
--with-curl \
--with-bz2 \
--with-gmp  \
--with-ldap=/usr/local/openldap \
--with-xml  \
--with-zip  \
--with-gettext \
--with-dom \
--with-dom-xslt \
--with-xslt-sablot=/usr/local/Sablot-1.0 \
--with-sablot-js=/usr \
--with-imap=/home/work/install/imap-2002b \
--with-pgsql 

Sablot:
./configure --prefix=/usr/local/Sablot-1.0 --enable-javascript --with-js-prefix=/usr --with-iconv-prefix=/usr/local
 [2003-08-09 06:49 UTC] derick@php.net
Crashes for me with sablotron 0.96 and 4.3.3rc3, bt follows:

#0  0x081f5eb5 in normal_nameLength (enc=0x1, 
    ptr=0x400d7f70 "U\211?WVS\203?H?????\201??\005\a")
    at /dat/dev/php/php-4.3.3RC3/ext/xml/expat/xmltok_impl.c:1702
1702	    switch (BYTE_TYPE(enc, ptr)) {
(gdb) print enc
$1 = (ENCODING *) 0x1
(gdb) bt
#0  0x081f5eb5 in normal_nameLength (enc=0x1, 
    ptr=0x400d7f70 "U\211?WVS\203?H?????\201??\005\a")
    at /dat/dev/php/php-4.3.3RC3/ext/xml/expat/xmltok_impl.c:1702
#1  0x401979a5 in reportProcessingInstruction () from /usr/lib/libexpat.so.0
#2  0x40196c82 in doProlog () from /usr/lib/libexpat.so.0
#3  0x40195634 in prologProcessor () from /usr/lib/libexpat.so.0
#4  0x40192e39 in XML_ParseBuffer () from /usr/lib/libexpat.so.0
#5  0x40192de6 in XML_Parse () from /usr/lib/libexpat.so.0
#6  0x400d5f48 in TreeConstructer::feedDocumentToParser ()
   from /usr/lib/libsablot.so.0
#7  0x400d4dcf in TreeConstructer::parseDataLineUsingGivenExpat ()
   from /usr/lib/libsablot.so.0
#8  0x400d503c in TreeConstructer::parseDataLineUsingExpat ()
   from /usr/lib/libsablot.so.0
#9  0x400f5aeb in Tree::parse () from /usr/lib/libsablot.so.0
#10 0x400dbf27 in Processor::addLineParse () from /usr/lib/libsablot.so.0
#11 0x400dc64c in Processor::readTreeFromURI () from /usr/lib/libsablot.so.0
#12 0x400da14a in Processor::open () from /usr/lib/libsablot.so.0
#13 0x400e1317 in SablotRunProcessorGen () from /usr/lib/libsablot.so.0
#14 0x0820f169 in zif_xslt_process (ht=3, return_value=0x83c844c, 
    this_ptr=0x0, return_value_used=1)
    at /dat/dev/php/php-4.3.3RC3/ext/xslt/sablot.c:590
#15 0x0825f17f in execute (op_array=0x83c774c)
    at /dat/dev/php/php-4.3.3RC3/Zend/zend_execute.c:1616
#16 0x0824efae in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /dat/dev/php/php-4.3.3RC3/Zend/zend.c:885
#17 0x0821d948 in php_execute_script (primary_file=0xbffff8f0)
    at /dat/dev/php/php-4.3.3RC3/main/main.c:1720
#18 0x0826d3bc in main (argc=2, argv=0xbffff994)
    at /dat/dev/php/php-4.3.3RC3/sapi/cli/php_cli.c:818
#19 0x407ad306 in __libc_start_main (main=0x826ca74 <main>, argc=2, 
    ubp_av=0xbffff994, init=0x8080284 <_init>, fini=0x826db20 <_fini>, 
    rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbffff98c)
    at ../sysdeps/generic/libc-start.c:129

 [2003-08-09 09:30 UTC] sniper@php.net
Try this patch, it cured the segfault for me:

  http://www.php.net/~jani/bug24989.txt

 [2003-08-09 09:53 UTC] sitnikov at infonet dot ee
This patch has solved my problem.
 [2003-08-09 10:41 UTC] sniper@php.net
Fixed in CVS now. Will be in final 4.3.3.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC