Re: [xslt] BUG: self reference in param definition



That's a nice one. I debugged a bit and found that it starts looping in
xsltEvalGlobalVariable function, but am not sure if that is the place
for a fix. Here is a shortened call stack of a xsltproc session:

     #-1 ... :-)
     #0  xmlXPathRunEval
     #1  in xmlXPathCompiledEval
     #2  in xsltValueOf
     #3  in xsltApplyOneTemplate
2 -> #4  in xsltEvalGlobalVariable
     #5  in xsltGlobalVariableLookup
     #6  in xsltVariableLookup
     #7  in xsltXPathVariableLookup
     #8  in xmlXPathVariableLookup
     #9  in xmlXPathCompOpEval
     #10 in xmlXPathCompOpEval
     #11 in xmlXPathRunEval
     #12 in xmlXPathCompiledEval
     #13 in xsltValueOf
     #14 in xsltApplyOneTemplate
1 -> #15 in xsltEvalGlobalVariable
     #16 in stubHashScannerFull
     #17 in xmlHashScanFull
     #18 in xmlHashScan
     #19 in xsltEvalGlobalVariables
     #20 in xsltApplyStylesheetInternal
     #21 in xsltApplyStylesheetUser
     #22 in xsltProcess
     #23 in main
     #24 in __libc_start_main

The scenario between the points 1 and 2 repeats forever, until the stack
is full. At the point 2, all relevant functions are called again,
recursively, with the same parameters, means with the same pointers
obtained from the hash table. 

At a first glance it looks like a call to xsltEvalGlobalVariable
shouldn't happen twice, in a recursion, with exactly the same parameters
during a normal processing.  If I am right, then this function should
prevent its being called recursively with the same parameters. Am I
right? I'd volunteer to fix this, but need some enlightenment :-)

Ciao,
Igor

On Sat, Mar 01, 2003 at 04:40:36PM -0500, Jerome Pesenti wrote:
> Hi,
> 
> When self referencing a parameter (or a variable) in its declaration, xsltproc
> (libxslt as well) segfault instead of returning an error.
> 
> Jerome
> 
> 
> [pesenti@dev xsl]$ more /tmp/bug.xsl
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
>   <xsl:param name="ok"><xsl:value-of select="$ok"/></xsl:param>
> </xsl:stylesheet>
> 
> [pesenti@dev xsl]$ xsltproc /tmp/bug.xsl /tmp/bug.xsl
> Segmentation fault (core dumped)
> 
> [pesenti@dev xsl]$ xsltproc --version
> Using libxml 20430, libxslt 10024 and libexslt 715
> xsltproc was compiled against libxml 20430, libxslt 10024 and libexslt 715
> libxslt 10024 was compiled against libxml 20430
> libexslt 715 was compiled against libxml 20430
> 
> OS: Linux RedHat 7.2




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]