GNOME Bugzilla – Bug 584220
xpointer(/) makes xmllint crash
Last modified: 2009-08-25 18:50:09 UTC
$ gdb xmllint [...] (gdb) run --xinclude test.xml > /dev/null Starting program: /usr/bin/xmllint --xinclude test.xml > /dev/null Program received signal SIGSEGV, Segmentation fault. [...] (gdb) bt full
+ Trace 215764
Created attachment 135566 [details] test case
Okay, I could not really reproduce the problem but I saw a couple of bad things when running that code, first the dictionary from the original document wasn't reused and second a document node was copied inside the target generating havoc. Both could have led to the crash you're seeing, I think this should be fixed now: paphio:~/XML -> cat ../test.xml <?xml version='1.0'?> <include xmlns="http://www.w3.org/2003/XInclude" href="http://www.w3.org/TR/2003/REC-xptr-framework-20030325/xptr-framework.xml" xpointer="xpointer(/)"/> paphio:~/XML -> valgrind xmllint --xinclude --noout ../test.xml paphio:~/XML -> Applied and commited to git, thanks ! Daniel
Unfortunately, your fix didn't help: $ valgrind -q xmllint --noout --xinclude ./test.xml ==5714== Invalid free() / delete / delete[] ==5714== at 0x4006E3A: free (vg_replace_malloc.c:323) ==5714== by 0x4053715: xmlFreeNodeList (tree.c:3397) ==5714== by 0x40533EB: xmlFreeDoc (tree.c:1216) ==5714== by 0x804D254: parseAndPrintFile (xmllint.c:2765) ==5714== by 0x805004D: main (xmllint.c:3504) ==5714== Address 0xfffffffe is not stack'd, malloc'd or (recently) free'd