GNOME Bugzilla – Bug 157859
<xsl:apply-imports /> crash
Last modified: 2009-08-15 18:40:50 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
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
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. =)
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
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?
Well, I can't do that because I'm using windows and don't have means to compile xsltproc from sources.
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.
The modification may be the cause of bug 318088.