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 316861 - xsltproc segfaults on docbook stylesheets
xsltproc segfaults on docbook stylesheets
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.15
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-09-21 17:08 UTC by alan ezust
Modified: 2005-09-29 09:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
minimal DocBook test file that triggers segfault (565 bytes, text/plain)
2005-09-22 05:10 UTC, Michael Smith
Details

Description alan ezust 2005-09-21 17:08:35 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
Segmentation fault

The offending line is this:
     <xsl:variable name="fnum">
        <!-- FIXME: list in @from is probably not complete -->
        <xsl:number level="any"
                    from="chapter|appendix|preface|article|refentry|bibliography"
                   
count="footnote[not(@label)][not(ancestor::tgroup)]|ulink[$ulink.footnote\
s != 0][node()][@url != .][not(ancestor::footnote)]"
                    format="1"/>
      </xsl:variable>

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

docbook-xsl-1.69.0
Comment 1 alan ezust 2005-09-21 17:27:06 UTC
Downgrading to version 1.14 makes the problem go away.
Comment 2 Michael Smith 2005-09-22 05:10:13 UTC
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.
Comment 3 Daniel Veillard 2005-09-22 06:45:34 UTC
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.

Daniel
Comment 4 William M. Brack 2005-09-22 13:54:21 UTC
I believe I have found and fixed the problem.  Corrected code
(libxslt/pattern.c) is in CVS.

Bill
Comment 5 Michael Smith 2005-09-29 01:27:30 UTC
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.
Comment 6 Daniel Veillard 2005-09-29 09:41:14 UTC
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 :-)

Daniel