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 153175 - crash in xmlFreeDoc after parsing xml chunk with xmlParseInNodeContext()
crash in xmlFreeDoc after parsing xml chunk with xmlParseInNodeContext()
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-09-20 17:16 UTC by Aleksey Sanin
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program that shows crash (1.08 KB, text/plain)
2004-09-20 17:17 UTC, Aleksey Sanin
Details
test file needed to run test program (115 bytes, text/plain)
2004-09-20 17:18 UTC, Aleksey Sanin
Details

Description Aleksey Sanin 2004-09-20 17:16:53 UTC
After parsing a chunk of XML with xmlParseInNodeContext() and then inserting it
into the document, xmlFreeDoc() crashes in tree.c:3326 (example program is
following).

Note that the crash goes away if you do any of the following
1) use XML_PARSE_NODICT flag in xmlParseInNodeContext() function
2) remove the "xsi:type" declaration from the parsed by xmlParseInNodeContext()
function buffer
3) change the node content in the parsed by xmlParseInNodeContext() function
buffer (to avoid crash, the content should *not* be a single character or a
single digital or a serials of blank)

Comment from Daniel: "This sounds like a dictionnary mixup bug..."

More info about this problem could be found in the following thread
http://www.aleksey.com/pipermail/xmlsec/2004/002167.html
Comment 1 Aleksey Sanin 2004-09-20 17:17:32 UTC
Created attachment 31735 [details]
test program that shows crash
Comment 2 Aleksey Sanin 2004-09-20 17:18:06 UTC
Created attachment 31736 [details]
test file needed to run test program

This file should be in the same folder as the test program executable
Comment 3 William M. Brack 2004-10-03 01:23:40 UTC
I added coding to force the XML_PARSE_NODICT option if the doc from the context 
node does not have it's own dictionary.  This certainly fixes your test 
program - could you please check whether it solves your original problem, and 
re-open the bug if there is any further trouble?  Changed code is in CVS 
(parser.c).
Bill
Comment 4 Aleksey Sanin 2004-10-03 18:56:17 UTC
Works for me now. Thanks! I will ask the original reporter to try it and will
close the bug after that.
Comment 5 Daniel Veillard 2004-10-28 07:24:54 UTC
This should be fixed in release 2.6.15,

  thanks,

Daniel