GNOME Bugzilla – Bug 316861
xsltproc segfaults on docbook stylesheets
Last modified: 2005-09-29 09:41:15 UTC
try running xsltproc on docbook 1.69 stylesheets.
It segfaults on line 94 in footnote.xsl
xsltproc --stringparam ulink.footnotes 1 ../docs/printstyle.xsl index.docbook
xsl:attribute-set : use-attribute-sets recursion detected
Making portrait pages on USletter paper (8.5inx11in)
XPath error : Undefined variable
$ulink.footnotes != 0
error: file ../docbook-xsl/fo/footnote.xsl line 94 element number
Failed to compile predicate
The offending line is this:
<!-- FIXME: list in @from is probably not complete -->
s != 0][node()][@url != .][not(ancestor::footnote)]"
Any clues as to what is wrong here?
> xsltproc --version
Using libxml 20622, libxslt 10115 and libexslt 812
xsltproc was compiled against libxml 20621, libxslt 10115 and libexslt 812
libxslt 10115 was compiled against libxml 20621
libexslt 812 was compiled against libxml 20621
Downgrading to version 1.14 makes the problem go away.
Created attachment 52487 [details]
minimal DocBook test file that triggers segfault
This test document demonstrates the problem. libxslt seems to
choke on an XPath statement in the part of the DocBook stylesheets that
handles processing of footnotes.
So I have a 10 lines document and a multi thousand lines stylesheet split over
dozen of various modules, named "docbook-xsl-1.69.0" to sort out the problem.
Don't hold your breath, and use 1.1.14 in the meantime then.
I believe I have found and fixed the problem. Corrected code
(libxslt/pattern.c) is in CVS.
Thanks for finding and fixing the cause of this. And
sorry for not having also attached the relevant
template from the DocBook stylesheets where libxslt
appeared to be running into problems. Next time I will
make sure to do it.
Well each time one get to debug a docbook stylesheet transformation problem
there is always a problem of volume of information. Having a small document
definitely helps as we traverse less XSLT code, but just getting started
on the debug can take a lot of time. Pointer to a downloadable version
of the stylesheets used helps shorten the bootstrap, doing some initial
look in the -v output can help a lot too reducing the "time to debug". Some
of the steps are trivial on your side and time wasting on our, and vice-versa.
It's relatively hard to optimize the overall efforts :-)