From:             x-penguin at tut dot by
Operating system: Linux
PHP version:      5CVS-2004-08-08 (dev)
PHP Bug Type:     XSLT related
Bug description:  Segmentation fault when php function(called from XSLT templat) throw 
exception

Description:
------------
Child httpd process segfault, when php function(called from XSLT template)
throw exception, and when exception was throwed from steream wrapper, used
in XSLT template.

PHP Version 5.1.0-dev, configure with:
'./configure' '--prefix=/usr/' '--with-apxs2' '--with-gettext'
'--with-iconv' '--with-mysql' '--enable-mbstring=ru' '--enable-mbregex'
'--enable-mbstr-enc-trans' '--disable-short-tags' '--with-xsl'
'--with-libxml' '--without-sqlite' '--enable-soap'

libxslt Version         1.1.8
libxml Version  2.6.11
libexslt Version        1.1.8

apache 2.0.48

Reproduce code:
---------------
<?php
try {
    function throwFunction() {
        throw new Exception('exception messaage');
    }
    
    $xsl = new DomDocument();
    $xsl->loadXML(
    '<?xml version="1.0" encoding="iso-8859-1" ?>
    <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:php="http://php.net/xsl";>
    <xsl:template match="/">
    <xsl:value-of select="php:function(\'throwFunction\')" />
    </xsl:template>
    </xsl:stylesheet>'
    );
    
    $xml = new DomDocument;
    $xml->loadXML(
    '<?xml version="1.0" encoding="iso-8859-1" ?>
    <null></null>'
    );
    
    $proc = new XSLTProcessor();
    $proc->registerPhpFunctions();
    $proc->importStylesheet($xsl);
    
    $dom = $proc->transformToDoc($xml);
} catch(Exception $exception) {
    echo $exception;
}
?>

Expected result:
----------------
exception 'Exception' with message 'exception messaage' in
/mnt/data/www/html/web/test.php:4
Stack trace:
#0 /mnt/data/www/html/web/test.php(27): XSLTProcessor->throwFunction()
#1 /mnt/data/www/html/web/test.php(27):
XSLTProcessor->transformToDoc(Object(DOMDocument))
#2 {main}

Actual result:
--------------
from apache error log:
[Sun Aug 08 18:55:33 2004] [notice] child pid 1337 exit signal
Segmentation fault (11)

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

Reply via email to