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 157859 - <xsl:apply-imports /> crash
<xsl:apply-imports /> crash
Status: VERIFIED INCOMPLETE
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-11-10 15:50 UTC by techtonik
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (1.28 KB, application/octet-stream)
2004-11-10 21:21 UTC, techtonik
Details

Description techtonik 2004-11-10 15:50:31 UTC
Trying to customize DocBook template using XSLTPROC and apply-imports
xsltproc crashes.

<xsl:template name="component.toc">
  <xsl:param name="toc-context" select="."/>
  <xsl:param name="toc.title.p" select="true()"/>
  <xsl:if test="@id!='inde2xes'">
    <xsl:apply-imports/>
  </xsl:if>
</xsl:template>

Original template from DocBook XSL 1.66.1

<xsl:template name="component.toc">
  <xsl:param name="toc-context" select="."/>
  <xsl:param name="toc.title.p" select="true()"/>

  <xsl:call-template name="make.toc">
    <xsl:with-param name="toc-context" select="$toc-context"/>
    <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
    <xsl:with-param name="nodes" select="section|sect1|refentry
                                         |article|bibliography|glossary
                                         |appendix|index
                                         |bridgehead[not(@renderas)
                                                     and $bridgehead.in.toc != 
0]
                                         |.//bridgehead[@renderas='sect1'
                                                        and $bridgehead.in.toc !
= 0]"/>
  </xsl:call-template>
</xsl:template>


I don't know exact version of xltproc, but -V key shows this garbage. =)
Using libxml 20615CVS2219, libxslt 10112CVS965 and libexslt 810CVS965
xsltproc was compiled against libxml 20615, libxslt 10112 and libexslt 810
libxslt 10112 was compiled against libxml 20615
libexslt 810 was compiled against libxml 20615
Comment 1 Daniel Veillard 2004-11-10 15:59:08 UTC
I *cannot* work with just a fragment of a stylesheet and guess what may
happen. I need complete data to reproduce the problem, then this is likely
to get fixed.

Daniel
Comment 2 techtonik 2004-11-10 21:21:11 UTC
Created attachment 33656 [details]
testcase

To make it work (or better say not work) unpack crashtest.zip and get docbook
xsl 
stylesheets version 1.66.1 from http://sf.net/projects/docbook
Unpack xsl 1.66.1 into docbook/ subdir of the test package and launch
crashit.bat

Wheew. =)
Comment 3 William M. Brack 2004-11-19 14:58:07 UTC
When I run your test under the released s/w I can directly reproduce the 
segfault.  When I run it under my testing environment I get some wierd 
results, starting with a complaint about a loop detected within the 
stylesheet, and only crashing when I increase --maxdepth to 5200.  In any 
event, there is certainly a problem, and it is under investigation.  I'll keep 
you advised of any progress.
Bill
Comment 4 William M. Brack 2004-11-21 02:09:35 UTC
Good progress.  There was a problem in our handling of xsl:call-template with 
respect to the "current template rule" (see XSLT spec 5.6).  I fixed that 
(fixed code is in CVS), and everything now runs to completion.  However, I 
have no idea whether the "garbage" now output by your script is, in fact, 
the "garbage" which you expect.  Could you please try the CVS code and see if 
it resolves the problem?
Comment 5 techtonik 2004-11-21 09:25:40 UTC
Well, I can't do that because I'm using windows and don't have means to compile 
xsltproc from sources.
Comment 6 William M. Brack 2004-11-21 12:41:11 UTC
OK, no problem.  I'm reasonably confident that what I fixed is what was 
affecting your script, so I'll close the bug.  The fix is in the latest CVS 
code, and will be included in the next release.
Comment 7 Bart Martens 2005-11-28 18:03:02 UTC
The modification may be the cause of bug 318088.