From:             fjortiz at comunet dot es
Operating system: Win32
PHP version:      5.0.0RC1
PHP Bug Type:     XSLT related
Bug description:  <xsl:include href="file.xsl"> makes Apache crash if file.xsl has 
errors

Description:
------------
I guess some extra checks should be added to the (great!) new DOM/XSLT
processor. Or maybe it's a libxml crash...



Only happens when the error is in the included file.



Sample XSL below:



file.xsl: see the "&apos;&nbsp;&apos;" at the param "strDelimiter". No
crash if select="&apos; &apos;"



<?xml version='1.0' encoding='utf-8' ?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">



        <xsl:output method="xml" indent="yes"/>



        <xsl:template name="Split">

                <xsl:param name="strInput" select="&apos;&apos;"/>

                <xsl:param name="strDelimiter" select="&apos;&nbsp;&apos;"/>

<!-- stripped, enough to see the crash -->

        </xsl:template>



</xsl:stylesheet>



And then drill6.xsl includes file.xsl:



<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">



        <xsl:output method="xml" indent="yes"/>

        <xsl:include href="file.xsl"/>



        <xsl:template match="/">

                <datos>

                        <xsl:call-template name="Split">

                                <xsl:with-param name="strInput" select="."/>

                                <xsl:with-param name="strDelimiter" select="' '"/>

                        </xsl:call-template>

                </datos>

        </xsl:template>

                

</xsl:stylesheet>





Reproduce code:
---------------
<?

header("Content-type: text/xml; charset=ISO-8859-1;") ; 



$xml =& new DomDocument() ; 

$xml->load("datos.xml");



$xsl =& new DomDocument();

$xsl->load("drill6.xsl");

$proc = new xsltprocessor;

$proc->importStylesheet($xsl);

$string = $proc->transformToXml($xml);



print "$string";



?>



Actual result:
--------------
Unhandled exception at 0x009bb86d (php5ts_debug.dll) in Apache.exe:
0xC0000005: Access violation reading location 0xdddddddd.



xsltprocessor.c line 326

sheetp = xsltParseStylesheetDoc(newdoc);



Call Stack:

        php5ts_debug.dll!_xmlDictFree()  + 0xd  C

        php5ts_debug.dll!_xmlDictFree()  + 0x29 C

        php5ts_debug.dll!_xsltFreeStylesheet()  + 0x1a2 C

        php5ts_debug.dll!_xsltParseStylesheetImportedDoc()  + 0x8f      C

        php5ts_debug.dll!_xsltParseStylesheetDoc()  + 0xd       C

>       php5ts_debug.dll!zif_xsl_xsltprocessor_import_stylesheet(int ht=1,
_zval_struct * return_value=0x02786518, _zval_struct *
this_ptr=0x02796030, int return_value_used=0, void * * *
tsrm_ls=0x02777440)  Line 326 + 0x9     C

        php5ts_debug.dll!zend_do_fcall_common_helper(_zend_execute_data *
execute_data=0x018ff558, _zend_op * opline=0x02799e98, _zend_op_array *
op_array=0x02797bb0, void * * * tsrm_ls=0x02777440)  Line 2665 + 0x32   C

        php5ts_debug.dll!zend_do_fcall_by_name_handler(_zend_execute_data *
execute_data=0x018ff558, _zend_op * opline=0x02799e98, _zend_op_array *
op_array=0x02797bb0, void * * * tsrm_ls=0x02777440)  Line 2776 + 0x15   C

        php5ts_debug.dll!execute(_zend_op_array * op_array=0x02797bb0, void * *
* tsrm_ls=0x02777440)  Line 1339 + 0x17 C

        php5ts_debug.dll!zend_execute_scripts(int type=8, void * * *
tsrm_ls=0x02777440, _zval_struct * * retval=0x00000000, int file_count=3,
...)  Line 1046 + 0x21  C

        php5ts_debug.dll!php_execute_script(_zend_file_handle *
primary_file=0x018ffbb0, void * * * tsrm_ls=0x02777440)  Line 1628 +
0x1b    C

        php5apache.dll!apache_php_module_main(request_rec * r=0x01054068, int
display_source_mode=0, void * * * tsrm_ls=0x02777440)  Line 54 + 0x10   C

        php5apache.dll!send_php(request_rec * r=0x01054068, int
display_source_mode=0, char * filename=0x01054bd0)  Line 621 + 0x11     C

        php5apache.dll!send_parsed_php(request_rec * r=0x01054068)  Line 636 +
0xd     C

        ApacheCore.dll!6ff64ae7()       

        ApacheCore.dll!6ff73f94()       

        ApacheCore.dll!6ff73d06()       

        ApacheCore.dll!6ff6b8ff()       

        msvcrt.dll!780085bc()   

        KERNEL32.DLL!7c4e987c()         



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

Reply via email to