OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Re: DOCBOOK-APPS: xsltproc segfaults with docbook-xsl 1.51.0 - 1.52.2


On Sat, Jul 27, 2002 at 04:16:53PM +0200, Oliver Eikemeier wrote:
> In message <3CFDDE3E.2040504@mandrakesoft.com> (http://sources.redhat.com/ml/docbook-apps/2002-q2/msg00716.html) you wrote that xsltproc gives you:
> 
> Error Undefined namespace prefix
> xmlXPathCompiledEval: evaluation failed
> 
> when compiling a document with an image in a mediaobject. The same happens to me (it crashes on Cygwin, the same error but no crash on FreeBSD). It seems that the problems came with the introduction of svg in the xsl templates.
> 
> I use the enclosed patch as a workaround, maybe Norman can tell us what really happens?

  Okay, I have the answer and a patch for this, finally :-)
In a nutshell it was a bug in libxslt <choose> implementation, the
<when> test expression was evaluated with the in-scope namespace list
of the <choose> node and not the one of the <when> node ... grin ...
Tiny patch enclosed, fix will be in next version, for good measure I also
ran valgind memory checker on the new code and no error are found, the 
next version of xsltproc should hopefully fix the troubles people had
with recent versions of the stylesheets,

Daniel

paphio:~/XSLT/tests/docbook -> valgrind --leak-check=yes --gdb-attach=yes xsltproc --nonet -o sample.html docbook-xsl-1.53.0/html/docbook.xsl tst.xml 
==22770== valgrind-20020317, a memory error detector for x86 GNU/Linux.
==22770== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==22770== For more details, rerun with: -v
==22770== 
==22770== 
==22770== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==22770== malloc/free: in use at exit: 600 bytes in 13 blocks.
==22770== malloc/free: 1369470 allocs, 1369457 frees, 96122703 bytes allocated.
==22770== For counts of detected errors, rerun with: -v
==22770== searching for pointers to 13 not-freed blocks.
==22770== checked 4931912 bytes.
==22770== 
==22770== definitely lost: 0 bytes in 0 blocks.
==22770== possibly lost:   0 bytes in 0 blocks.
==22770== still reachable: 600 bytes in 13 blocks.
==22770== 
==22770== LEAK SUMMARY:
==22770==    possibly lost:   0 bytes in 0 blocks.
==22770==    definitely lost: 0 bytes in 0 blocks.
==22770==    still reachable: 600 bytes in 13 blocks.
==22770== Reachable blocks (those to which a pointer was found) are not shown.
==22770== To see them, rerun with: --show-reachable=yes
==22770== 
paphio:~/XSLT/tests/docbook -> 


-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Index: libxslt/transform.c
===================================================================
RCS file: /cvs/gnome/libxslt/libxslt/transform.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -p -r1.184 -r1.185
*** libxslt/transform.c	13 Aug 2002 09:22:50 -0000	1.184
--- libxslt/transform.c	19 Aug 2002 13:05:29 -0000	1.185
*************** xsltChoose(xsltTransformContextPtr ctxt,
*** 3001,3008 ****
  	oldNsNr = ctxt->xpathCtxt->nsNr;
  	oldNamespaces = ctxt->xpathCtxt->namespaces;
    	ctxt->xpathCtxt->node = node;
! 	ctxt->xpathCtxt->namespaces = comp->nsList;
! 	ctxt->xpathCtxt->nsNr = comp->nsNr;
    	res = xmlXPathCompiledEval(wcomp->comp, ctxt->xpathCtxt);
  	ctxt->xpathCtxt->proximityPosition = oldProximityPosition;
  	ctxt->xpathCtxt->contextSize = oldContextSize;
--- 3001,3008 ----
  	oldNsNr = ctxt->xpathCtxt->nsNr;
  	oldNamespaces = ctxt->xpathCtxt->namespaces;
    	ctxt->xpathCtxt->node = node;
! 	ctxt->xpathCtxt->namespaces = wcomp->nsList;
! 	ctxt->xpathCtxt->nsNr = wcomp->nsNr;
    	res = xmlXPathCompiledEval(wcomp->comp, ctxt->xpathCtxt);
  	ctxt->xpathCtxt->proximityPosition = oldProximityPosition;
  	ctxt->xpathCtxt->contextSize = oldContextSize;


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC