#39562 [NEW]: Segfault with Invalid XSLT
| From: | hairmare at gmail dot com | Date: | Mon, 20 Nov 2006 21:34:43 +0000 |
| Subject: | #39562 [NEW]: Segfault with Invalid XSLT | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-105219@lists.php.net to get a copy of this message | ||
From: hairmare at gmail dot com
Operating system: Linux
PHP version: 6CVS-2006-11-20 (snap)
PHP Bug Type: XSLT related
Bug description: Segfault with Invalid XSLT
Description:
------------
this code is based on a snippet from the manual
(http://php.net/xsl-xsltprocessor-construct).
Any small error in the xslt sheet easily makes php segfault.
i'm even getting this on older versions.
my configure;
'./configure' '--disable-cgi' '--enable-cli' '--with-mysql'
'--with-openssl' '--with-pdo-mysql' '--enable
-soap' '--with-xsl' '--enable-debug' '--with-zlib'
'--with-dom'
'--with-gdbm' '--with-curl' '--with-dom' '--with-gd'
'--enable-calendar'
'--with-bz2' '--with-mcrypt' '--
with-xmlrpc' '--with-gettext' '--with-ttf' '--enable-pcntl'
'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg'
'--enable-shmop'
'--with-png' '--with-jpeg' '--with-
tiff' '--with-freetype'
Reproduce code:
---------------
<?php
$xsl = new DOMDocument;
$xsl->loadXML(b'<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
extra content here
');
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl);
echo 'hello mr bug';
?>
Expected result:
----------------
--EXPECTREGEX--
Warning: DOMDocument::loadXML\(\): Extra content at the end of the
document in Entity, line: [-1-9]* in .* on line [0-9]*
Warning: XSLTProcessor::importStylesheet\(\): compilation error in .* on
line [0-9]*
Warning: XSLTProcessor::importStylesheet\(\): xsltParseStylesheetProcess :
empty stylesheet in .* on line [0-9]*
hello mr bug
Actual result:
--------------
#0 0x08332197 in zif_xsl_xsltprocessor_import_stylesheet (ht=1,
return_value=0xb6b5d474, return_value_ptr=0x0, this_ptr=0xb6b5c1c8,
return_value_used=0)
at
/usr/local/src/php-6/php6.0-200611201530/ext/xsl/xsltprocessor.c:388
#1 0x083b61c0 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfef9240) at zend_vm_execute.h:209
#2 0x083b6bff in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfef9240) at zend_vm_execute.h:331
#3 0x083b5d88 in execute (op_array=0xb6b5c8d4) at zend_vm_execute.h:92
#4 0x0838e5f2 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /usr/local/src/php-6/php6.0-200611201530/Zend/zend.c:1587
#5 0x08337e68 in php_execute_script (primary_file=0xbfefb690) at
/usr/local/src/php-6/php6.0-200611201530/main/main.c:1933
#6 0x084005f0 in main (argc=2, argv=0xbfefb724) at
/usr/local/src/php-6/php6.0-200611201530/sapi/cli/php_cli.c:1119
--
Edit bug report at http://bugs.php.net/?id=39562&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39562&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39562&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39562&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39562&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39562&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39562&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39562&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39562&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39562&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39562&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39562&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39562&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39562&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39562&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39562&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39562&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39562&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39562&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39562&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39562&r=mysqlcfg