After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 58878 - explicit "child" axis not recognised in XPath expressions
explicit "child" axis not recognised in XPath expressions
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-08-12 06:39 UTC by cpitcher
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description cpitcher 2001-08-12 06:39:00 UTC
Explicit use of the child axis in the XSLT stylesheet below causes
a SIGSEGV with xsltproc built from libxslt-1.0.1-1.src.rpm.

The XSLT stylesheet (problem.xsl), a sample XML document (problem.xml), 
and a backtrace appear below.  With those files, the following command
illustrates the problem:

  $ xsltproc problem.xsl problem.xml 
  Segmentation fault (core dumped)

I have looked through the function xsltCompileStepPattern in
libxslt/pattern.c and suspect that something has gone wrong by
the time the function xsltGetQNameURI is called on line 1269.

===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:preserve-space elements="*"/>
    <xsl:output method="xml"/>
    <xsl:template match="child::foo">
      <bar/>
    </xsl:template>
  </xsl:stylesheet>
===================================================================

===================================================================
  <?xml version="1.0"?>
  <foo/>
===================================================================


===================================================================
  • #0 _IO_vfprintf
    at ../sysdeps/i386/i486/bits/string.h line 530
  • #1 buffered_vfprintf
    at vfprintf.c line 2087
  • #2 _IO_vfprintf
    at vfprintf.c line 1272
  • #3 xsltGenericErrorDefaultFunc
    at xsltutils.c line 199
  • #4 xsltGetQNameURI
    at xsltutils.c line 415
  • #5 xsltCompileStepPattern
    at pattern.c line 1269
  • #6 xsltCompileRelativePathPattern
    at pattern.c line 1335
  • #7 xsltCompileLocationPathPattern
    at pattern.c line 1428
  • #8 xsltCompilePattern
    at pattern.c line 1502
  • #9 xsltAddTemplate
    at pattern.c line 1606
  • #10 xsltParseStylesheetTemplate
    at xslt.c line 1603
  • #11 xsltParseStylesheetTop
    at xslt.c line 1712
  • #12 xsltParseStylesheetProcess
    at xslt.c line 1774
  • #13 xsltParseStylesheetDoc
    at xslt.c line 1851
  • #14 main
    at xsltproc.c line 453
  • #15 __libc_start_main
    at ../sysdeps/generic/libc-start.c line 129

Comment 1 Daniel Veillard 2001-08-14 13:44:33 UTC
Okay, I have tried to fix it in CVS, seems to be working now:

orchis:~/XSLT/tests/general -> cat bug-55.xsl 
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:preserve-space elements="*"/>
<xsl:output method="xml"/>
<xsl:template match="child::foo">
<bar/>
</xsl:template>
</xsl:stylesheet>
orchis:~/XSLT/tests/general -> cat ../docs/bug-55.xml 
<?xml version="1.0"?>
<foo/>

orchis:~/XSLT/tests/general -> xsltproc bug-55.xsl ../docs/bug-55.xml 
<?xml version="1.0"?>
<bar/>
orchis:~/XSLT/tests/general ->


http://cvs.gnome.org/bonsai/cvsquery.cgi?module=libxslt&branch=HEAD&branchtype=match&dir=libxslt&file=&filetype=match&who=veillard&whotype=match&sortby=Date&hours=&date=explicit&mindate=08%2F14%2F01+09%3A34&maxdate=08%2F14%2F01+09%3A36&cvsroot=%2Fcvs%2Fgnome
  thanks for the report !

Daniel
Comment 2 Daniel Veillard 2001-08-15 16:10:31 UTC
Should be closed by the 2.4.2/1.0.2 releases,

  thanks for the bug report !

Daniel