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 110023 - xsltproc crash using latest release
xsltproc crash using latest release
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
1.0.25
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2003-04-05 00:32 UTC by Mark Vakoc
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
verbose output from running xsltproc (5.75 KB, text/plain)
2003-04-05 00:35 UTC, Mark Vakoc
  Details
the offending stylesheet (1.49 KB, text/xml)
2003-04-05 00:36 UTC, Mark Vakoc
  Details
output from debug build (with debug memory functions) (46.85 KB, text/plain)
2003-04-05 00:38 UTC, Mark Vakoc
  Details
stylesheet for re-opening of bug (482 bytes, text/xml)
2003-04-08 17:28 UTC, Mark Vakoc
  Details
Proposed fix for str:tokenize (3.43 KB, patch)
2003-04-08 20:28 UTC, Mark Vakoc
none Details | Review
slightly fixed patch (3.49 KB, patch)
2003-04-08 21:54 UTC, Mark Vakoc
none Details | Review
The offending DocBook XML document (18.69 KB, text/xml)
2003-05-05 12:33 UTC, Mikhail Zabaluev
  Details

Description Mark Vakoc 2003-04-05 00:32:33 UTC
This simplified stylesheet works fine in my current release 
(1.0.23/2.5.3) but crashes in the latest.

C:\gsstools\binaries>xsltproc --version
Using libxml 20506, libxslt 10029 and libexslt 719
xsltproc was compiled against libxml 20506, libxslt 10029 and libexslt 719
libxslt 10029 was compiled against libxml 20506
libexslt 719 was compiled against libxml 20506

see attachments
Comment 1 Mark Vakoc 2003-04-05 00:35:19 UTC
Created attachment 15486 [details]
verbose output from running xsltproc
Comment 2 Mark Vakoc 2003-04-05 00:36:15 UTC
Created attachment 15487 [details]
the offending stylesheet
Comment 3 Mark Vakoc 2003-04-05 00:38:03 UTC
Created attachment 15488 [details]
output from debug build (with debug memory functions)
Comment 4 Mark Vakoc 2003-04-05 00:38:51 UTC
Hopefully the three attachments provide enough detail.
Comment 5 Daniel Veillard 2003-04-07 12:55:59 UTC
Yes thanks a lot for the report. The new handling of Result Value
Trees now allow for ctxt->document to become NULL, and you hit a case
where this wasn't checked. I tried to clean up this an other places
and committed it to CVS. I also added your test case to the regression
tests:

http://cvs.gnome.org/bonsai/cvsquery.cgi?branch=&dir=libxslt&who=veillard&date=explicit&mindate=2003-04-07%2008:40&maxdate=2003-04-07%2008:42&cvsroot=/cvs/gnome

  thanks a lot !

Daniel
Comment 6 Mark Vakoc 2003-04-07 16:22:01 UTC
will test as soon as changes are replicated to anoncvs
Comment 7 Mark Vakoc 2003-04-08 17:27:33 UTC
The original problem is fixed but another was exposed in teh 
process.  See attached stylesheet
Comment 8 Mark Vakoc 2003-04-08 17:28:24 UTC
Created attachment 15565 [details]
stylesheet for re-opening of bug
Comment 9 Mark Vakoc 2003-04-08 17:29:21 UTC
The problem appears to relate to using a result tree fragment cast 
to node-set in an extension function.

Comment 10 Mark Vakoc 2003-04-08 20:28:39 UTC
Created attachment 15573 [details] [review]
Proposed fix for str:tokenize
Comment 11 Mark Vakoc 2003-04-08 20:30:01 UTC
The real problem was that context->document may be NULL.  This was 
used in str:tokenize to get the root document to add a result tree 
fragment to.  The new method (using a document as it's own 
container) no longer needs access to context->document->doc
Comment 12 Mark Vakoc 2003-04-08 21:54:25 UTC
Created attachment 15577 [details] [review]
slightly fixed patch
Comment 13 Mark Vakoc 2003-04-08 21:54:52 UTC
updated the patch to change the returned object type from 
XSLT_RESULT_TREE to XPATH_NODESET
Comment 14 Daniel Veillard 2003-04-23 20:46:10 UTC
Okay, applied the patch, I also fixed on memory leak 
exposed by the test and ESXLT set function. There are others
hiding there, I may need to revamp the handling of tree fragment
to really clean this up. At least the current bug is fixed in CVS...

  thanks !

Daniel
Comment 15 Mikhail Zabaluev 2003-05-05 12:31:57 UTC
I believe I've stumbled upon another problem here.
xsltproc of versions 1.0.29 and 1.0.30 crashes with segmentation fault
while processing a DocBook document (to be attached). The stylesheet
used is the DocBook XSL stylesheet html/docbook.xsl from the DocBook
XSL stylesheets package, version 1.60.1.


Traceback:

  • #0 xsltApplyTemplates
    at transform.c line 3023
  • #1 xsltApplyOneTemplate
    at transform.c line 1462
  • #2 xsltProcessOneNode
    at transform.c line 1300
  • #3 xsltApplyTemplates
    at transform.c line 3152
  • #4 xsltApplyOneTemplate
    at transform.c line 1462
  • #5 xsltChoose
    at transform.c line 3270
  • #6 xsltApplyOneTemplate
    at transform.c line 1462
  • #7 xsltCallTemplate
    at transform.c line 2902
  • #8 xsltApplyOneTemplate
    at transform.c line 1462
  • #9 xsltChoose
    at transform.c line 3292
  • #10 xsltApplyOneTemplate
    at transform.c line 1462


The faulty code:

3023                                val = (const xmlChar *)
3024                                     
xmlHashLookup2(ctxt->style->stripSpaces,
3025                                                    
cur->parent->name,
3026                                                    
cur->parent->ns->href);

cur->parent->ns contains 0xffffffff, causing the segmentation fault.
Comment 16 Mikhail Zabaluev 2003-05-05 12:33:40 UTC
Created attachment 16268 [details]
The offending DocBook XML document
Comment 17 Mikhail Zabaluev 2003-05-10 10:41:44 UTC
I've resubmit my problem as bug 112703 for better accountability ;)
Comment 18 Daniel Veillard 2003-07-07 13:58:27 UTC
this should be closed by release of libxslt-1.0.31
                                                                     
          
  thanks,
                                                                     
          
Daniel