[xml/sgml-pkgs] Bug#750593: xsltproc: bus error on some architectures

Jelmer Vernooij jelmer at samba.org
Mon Oct 6 20:18:13 UTC 2014


On Mon, Oct 06, 2014 at 11:05:57AM +0200, Nick Wellnhofer wrote:
> On Oct 6, 2014, at 06:21 , Jelmer Vernooij <jelmer at samba.org> wrote:
> 
> > Nick, which bug in the GNOME bug tracker are you referring to?
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=736077
> 
> > Even if this is a bug in docbook-xsl, it would still be good if
> > xsltproc printed an error rather than crashing - though perhaps that
> > wouldn't need to be priority serious.
> 
> It’s not that easy. Actually, it’s not really a bug in libxslt or docbook-xsl but a memory issue (stack overflow). libxslt doesn’t optimize tail calls, so recursive templates should be used with great care because after a couple of hundred recursions, stack space runs out.
It can still find out the maximum allowed size of the stack and use that to e.g. set a reasonable default for --maxdepth.

> If you set the --maxdepth option of xsltproc to a value that’s low enough, you’ll get an error message instead of a crash, but finding a suitable value depends on stack size and the actual stylesheet.
While we can certainly do that, it's one more option we have to pass and keep up to date that is independent of our control. Anybody else hitting this issue will also not know about this option until they discover the cause.

Jelmer



More information about the debian-xml-sgml-pkgs mailing list