#38134 [Com]: segfault while calling xslt_process
ID: 38134 Comment by: gabriel dot zerbib at protilab dot com Reported By: gerome dot fournier at infomaniak dot ch Status: Feedback Bug Type: XSLT related Operating System: Debian Sarge PHP Version: 4.4.2 New Comment: Tony, my apologies: I admit that the test data I provided were not enough likely to trigger the crash. I was trying to reduce the sise of the sample's source. Here is a more realistic example: http://www.protilab.com/test/sample2.php The XML used is http://www.protilab.com/test/sample2.xml and the XSL is http://www.protilab.com/test/xslt/home.xsl (plus some incldues that you can read by yourself in the XSL). Regards, Gabriel. Previous Comments: [2006-08-17 11:56:47] [EMAIL PROTECTED] Please upgrade sablotron to the latest available version and see if it helps. [2006-08-17 11:17:41] gerome dot fournier at infomaniak dot ch You can get the details about this server using the following URL: http://imu60.infomaniak.ch/phpinfo.php We're using sablotron version 1.0 as provided by Debian sarge, and the configure command line is the following: './configure' '--disable-all' '--prefix=/opt/php' '--with-apxs=/opt/apache/bin/apxs' '--disable-ipv6' '--with-pear' '--enable-xml' '--with-expat-dir=/usr' '--with-pcre-regex' '--enable-memory-limit' '--enable-ftp' '--with-mysql=/opt/misc/mysql' '--with-zlib-dir=/usr' '--with-openssl=/usr' '--with-zlib=/usr' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--with-curl=/usr' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-xpm-dir' '--with-ttf' '--with-freetype-dir' '--enable-gd-native-ttf' '--with-gettext' '--with-iconv' '--with-imap' '--with-kerberos' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-mcal=/usr' '--with-mcrypt' '--with-mhash' '--enable-overload' '--enable-posix' '--enable-session' '--enable-tokenizer' '--enable-wddx' '--enable-xml' '--enable-xslt' '--with-xslt-sablot=/usr' '--with-zip' '--with-pdflib=/opt/misc/pdflib' '--with-tiff-dir=/usr' '--with-ming=/opt/misc/ming' I don't have a more detailed GDB backtrace to provide for the moment. [2006-08-17 10:01:09] [EMAIL PROTECTED] What is the version of Sablotron used? Are you able to get a decent GDB backtrace (using PHP configured with --enable-debug)? What was your full configure line? It works just fine here with 1.0.1 Linux i386. [2006-08-17 09:48:45] gabriel dot zerbib at protilab dot com I'm sorry Tony, you were a little bit quick in closing with can't reproduce. You can just try the online demo. You'll manage to achieve the 100 iterations for some time, but if you hit Refresh a few times, you sure will run into the problem: the page will not come to you, your browser will report some proxy error or some Host not found error, which is in fact caused by a violent crash of the PHP script and PHP interpreter, never returning a response to your browser. Please do not close this bug report too fast, as sample data were properly provided, and the target platform and system and version. Thanks. [2006-08-17 09:43:05] [EMAIL PROTECTED] Can't reproduce. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/38134 -- Edit this bug report at http://bugs.php.net/?id=38134edit=1
#38134 [Com]: segfault while calling xslt_process
ID: 38134 Comment by: gabriel dot zerbib at protilab dot com Reported By: gerome dot fournier at infomaniak dot ch Status: No Feedback Bug Type: XSLT related Operating System: Debian Sarge PHP Version: 4.4.2 New Comment: TEST DATA: The files can be found at: http://www.protilab.com/test/sample.xml http://www.protilab.com/test/sample.xsl And the PHP script can be run online at: http://www.protilab.com/test/sample.php SCENARIO: An XSLT processor is instanciated using the XML and XSL files specified in the arguments, in a loop of 100 iterations. Among these 100 iterations, a seg-fault is likely to happen. XML file to process (sample.xml): --- ?xml version=1.0 encoding=iso-8859-1? ?xml-stylesheet type=text/xsl href=sample.xsl? root node1 id=foo subnodeASome Data A/subnodeA subnodeA attr=123Some Mode Data A/subnodeA /node1 node1 id=bar subnodeASome Data A in another node/subnodeA subnodeA attr=345Some Mode Data in second node/subnodeA /node1 /root --- XSL file to apply (sample.xsl): --- ?xml version=1.0 encoding=iso-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:template match=/ html head titleTitle here/title /head body xsl:for-each select=/root/node1 xsl:value-of select=@id/ ul xsl:for-each select=subnodeA lixsl:value-of select=text()/ xsl:if test=@attr ( xsl:value-of select=@attr/ ) /xsl:if /li /xsl:for-each /ul /xsl:for-each /body /html /xsl:template /xsl:stylesheet --- PHP script (sample.php) --- ? $xmlFile = 'sample.xml'; $xsl_url = 'sample.xsl'; for($i = 0; $i 100; ++$i) { $xh = xslt_create(); xslt_set_encoding($xh, 'iso-8859-1'); xslt_process($xh, $xmlFile, $xsl_url, 'result.html'); xslt_free($xh); echo(iteration: $i = OK br/\n); } ? --- Previous Comments: [2006-07-26 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-07-18 14:49:08] gabriel dot zerbib at protilab dot com The same test data (XML XSL) in same context (same PHP application, same version) work and do not fail on Windows XP IIS, whereas I experience the same problem on submitter's platform. [2006-07-18 14:14:50] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with ?php and ends with ?, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. [2006-07-18 13:52:27] gerome dot fournier at infomaniak dot ch Description: Making a simple xml transformation using xslt_process gives from time to time a segfault. The php code looks like this: $xmlFile = file.xml; $xsl_url = file.xsl; $result = xslt_process($xh, $xmlFile, $xsl_url); if ($result) { echo $result; } else { echo Error; } xslt_free($xh); I provide hereafter a backtrace after the segfault occured: Program received signal SIGPIPE, Broken pipe. [Switching to Thread -120974 (LWP 4068)] 0xb7f1f5e8 in writev () from /lib/tls/libc.so.6 (gdb) bt #0 0xb7f1f5e8 in writev () from /lib/tls/libc.so.6 #1 0xb6db9cbf in ssl_io_hook_writev () from /opt/apache/libexec/libssl.so #2 0xbf886f40 in ?? () #3 0x0002 in ?? () #4 0x081228c4 in ?? () #5 0x in ?? () #6 0x0017 in ?? ()
#38134 [Com]: segfault while calling xslt_process
ID: 38134 Comment by: gabriel dot zerbib at protilab dot com Reported By: gerome dot fournier at infomaniak dot ch Status: Feedback Bug Type: XSLT related Operating System: Debian Sarge PHP Version: 4.4.2 New Comment: I'm sorry Tony, you were a little bit quick in closing with can't reproduce. You can just try the online demo. You'll manage to achieve the 100 iterations for some time, but if you hit Refresh a few times, you sure will run into the problem: the page will not come to you, your browser will report some proxy error or some Host not found error, which is in fact caused by a violent crash of the PHP script and PHP interpreter, never returning a response to your browser. Please do not close this bug report too fast, as sample data were properly provided, and the target platform and system and version. Thanks. Previous Comments: [2006-08-17 09:43:05] [EMAIL PROTECTED] Can't reproduce. [2006-08-17 09:42:11] gerome dot fournier at infomaniak dot ch Re-opened as the owner of the web site provided new feedbacks. [2006-08-17 09:22:12] gabriel dot zerbib at protilab dot com TEST DATA: The files can be found at: http://www.protilab.com/test/sample.xml http://www.protilab.com/test/sample.xsl And the PHP script can be run online at: http://www.protilab.com/test/sample.php SCENARIO: An XSLT processor is instanciated using the XML and XSL files specified in the arguments, in a loop of 100 iterations. Among these 100 iterations, a seg-fault is likely to happen. XML file to process (sample.xml): --- ?xml version=1.0 encoding=iso-8859-1? ?xml-stylesheet type=text/xsl href=sample.xsl? root node1 id=foo subnodeASome Data A/subnodeA subnodeA attr=123Some Mode Data A/subnodeA /node1 node1 id=bar subnodeASome Data A in another node/subnodeA subnodeA attr=345Some Mode Data in second node/subnodeA /node1 /root --- XSL file to apply (sample.xsl): --- ?xml version=1.0 encoding=iso-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:template match=/ html head titleTitle here/title /head body xsl:for-each select=/root/node1 xsl:value-of select=@id/ ul xsl:for-each select=subnodeA lixsl:value-of select=text()/ xsl:if test=@attr ( xsl:value-of select=@attr/ ) /xsl:if /li /xsl:for-each /ul /xsl:for-each /body /html /xsl:template /xsl:stylesheet --- PHP script (sample.php) --- ? $xmlFile = 'sample.xml'; $xsl_url = 'sample.xsl'; for($i = 0; $i 100; ++$i) { $xh = xslt_create(); xslt_set_encoding($xh, 'iso-8859-1'); xslt_process($xh, $xmlFile, $xsl_url, 'result.html'); xslt_free($xh); echo(iteration: $i = OK br/\n); } ? --- [2006-07-26 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-07-18 14:49:08] gabriel dot zerbib at protilab dot com The same test data (XML XSL) in same context (same PHP application, same version) work and do not fail on Windows XP IIS, whereas I experience the same problem on submitter's platform. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/38134 -- Edit this bug report at http://bugs.php.net/?id=38134edit=1
#38134 [Com]: segfault while calling xslt_process
ID: 38134 Comment by: gabriel dot zerbib at protilab dot com Reported By: gerome dot fournier at infomaniak dot ch Status: Feedback Bug Type: XSLT related Operating System: Debian Sarge PHP Version: 4.4.2 New Comment: The same test data (XML XSL) in same context (same PHP application, same version) work and do not fail on Windows XP IIS, whereas I experience the same problem on submitter's platform. Previous Comments: [2006-07-18 14:14:50] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with ?php and ends with ?, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. [2006-07-18 13:52:27] gerome dot fournier at infomaniak dot ch Description: Making a simple xml transformation using xslt_process gives from time to time a segfault. The php code looks like this: $xmlFile = file.xml; $xsl_url = file.xsl; $result = xslt_process($xh, $xmlFile, $xsl_url); if ($result) { echo $result; } else { echo Error; } xslt_free($xh); I provide hereafter a backtrace after the segfault occured: Program received signal SIGPIPE, Broken pipe. [Switching to Thread -120974 (LWP 4068)] 0xb7f1f5e8 in writev () from /lib/tls/libc.so.6 (gdb) bt #0 0xb7f1f5e8 in writev () from /lib/tls/libc.so.6 #1 0xb6db9cbf in ssl_io_hook_writev () from /opt/apache/libexec/libssl.so #2 0xbf886f40 in ?? () #3 0x0002 in ?? () #4 0x081228c4 in ?? () #5 0x in ?? () #6 0x0017 in ?? () #7 0x in ?? () #8 0x3908 in ?? () #9 0x081228c4 in ?? () #10 0x in ?? () #11 0x080cbd04 in ?? () #12 0x0807f4a7 in ap_hook_call_func () #13 0xb7979494 in sapi_send_headers () at /root/SOURCES/php4-debug/php-4.4.2/main/SAPI.c:813 #14 0xb7987c6e in php_ub_body_write_no_header ( str=0x84413b4 html xmlns=\http://www.w3.org/1999/xhtml\; lang=\fr\ xml:lang=\fr\\n head\ntitleProtilab - gestion/title\nstyle\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: tahoma;\n\t\t\t\t\tfont-size: 8pt;\n\t\t\t\t\tmargin-top..., str_length=91404) at /root/SOURCES/php4-debug/php-4.4.2/main/output.c:692 #15 0xb7987d2f in php_ub_body_write ( str=0x84413b4 html xmlns=\http://www.w3.org/1999/xhtml\; lang=\fr\ xml:lang=\fr\\n head\ntitleProtilab - gestion/title\nstyle\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: tahoma;\n\t\t\t\t\tfont-size: 8pt;\n\t\t\t\t\tmargin-top..., str_length=91404) at /root/SOURCES/php4-debug/php-4.4.2/main/output.c:725 #16 0xb798702d in php_end_ob_buffer (send_buffer=1 '\001', just_flush=1 '\001') at /root/SOURCES/php4-debug/php-4.4.2/main/output.c:302 #17 0xb7988979 in php_ob_append ( text=0x83c6f24 html xmlns=\http://www.w3.org/1999/xhtml\; lang=\fr\ xml:lang=\fr\\n head\ntitleProtilab - gestion/title\nstyle\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: tahoma;\n\t\t\t\t\tfont-size: 8pt;\n\t\t\t\t\tmargin-top..., text_length=91404) at /root/SOURCES/php4-debug/php-4.4.2/main/output.c:619 #18 0xb7987c3d in php_b_body_write ( str=0x83c6f24 html xmlns=\http://www.w3.org/1999/xhtml\; lang=\fr\ xml:lang=\fr\\n head\ntitleProtilab - gestion/title\nstyle\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: tahoma;\n\t\t\t\t\tfont-size: 8pt;\n\t\t\t\t\tmargin-top..., str_length=91404) at /root/SOURCES/php4-debug/php-4.4.2/main/output.c:678 #19 0xb79868ad in php_body_write ( str=0x83c6f24 html xmlns=\http://www.w3.org/1999/xhtml\; lang=\fr\ xml:lang=\fr\\n head\ntitleProtilab - gestion/title\nstyle\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: tahoma;\n\t\t\t\t\tfont-size: 8pt;\n\t\t\t\t\tmargin-top..., str_length=91404) at /root/SOURCES/php4-debug/php-4.4.2/main/output.c:121 #20 0xb797090b in php_body_write_wrapper ( str=0x83c6f24 html xmlns=\http://www.w3.org/1999/xhtml\; lang=\fr\ xml:lang=\fr\\n head\ntitleProtilab - gestion/title\nstyle\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: tahoma;\n\t\t\t\t\tfont-size: 8pt;\n\t\t\t\t\tmargin-top..., str_length=91404) at /root/SOURCES/php4-debug/php-4.4.2/main/main.c:1029 #21 0xb79a8b7f in zend_print_zval_ex (write_func=0xb79708f3 php_body_write_wrapper, expr=0x85139a4, indent=0) at /root/SOURCES/php4-debug/php-4.4.2/Zend/zend.c:211 #22 0xb79a8b08 in zend_print_zval (expr=0x85139a4, indent=0) at /root/SOURCES/php4-debug/php-4.4.2/Zend/zend.c:192 #23 0xb79a8612 in zend_print_variable (var=0x85139a4) at /root/SOURCES/php4-debug/php-4.4.2/Zend/zend_variables.c:151 #24 0xb79bbd1a in execute