Hi all,
I am having a problem with the latest libxml2-2.6.26. Here is the simple .cc file that incurs the bus error, where the file "test.xsl" contains an xsl stylesheet.
#include <libxslt/transform.h>
void main () {
xmlDocPtr xmldoc = xmlParseFile("test.xsl");
xsltParseStylesheetDoc(xmldoc);
}
It compiles (in FreeBSD 4.11) successfully with both libxml2-2.6.22 and libxml2-2.6.26 (libxslt is always 1.1.14). It runs with libxml2-2.6.22. However, with libxml2-2.6.26 it crashes. The problem seems to be in the new function xmlXPathCacheNewString() in libxml2-2.6.26.
Stack trace:
(gdb) bt
#0 0x2108a295 in xmlXPathCacheNewString () from /usr/local/lib/libxml2.so.5
#1 0x21093f06 in xmlXPathCompLiteral () from /usr/local/lib/libxml2.so.5
#2 0x21094388 in xmlXPathCompPrimaryExpr () from /usr/local/lib/libxml2.so.5
#3 0x210943eb in xmlXPathCompFilterExpr () from /usr/local/lib/libxml2.so.5
#4 0x210948e9 in xmlXPathCompPathExpr () from /usr/local/lib/libxml2.so.5
#5 0x210949f0 in xmlXPathCompUnionExpr () from /usr/local/lib/libxml2.so.5
#6 0x21094b5d in xmlXPathCompUnaryExpr () from /usr/local/lib/libxml2.so.5
#7 0x21094bdc in xmlXPathCompMultiplicativeExpr () from /usr/local/lib/libxml2.so.5
#8 0x21094d38 in xmlXPathCompAdditiveExpr () from /usr/local/lib/libxml2.so.5
#9 0x21094e44 in xmlXPathCompRelationalExpr () from /usr/local/lib/libxml2.so.5
#10 0x21094fb0 in xmlXPathCompEqualityExpr () from /usr/local/lib/libxml2.so.5
#11 0x210950c8 in xmlXPathCompAndExpr () from /usr/local/lib/libxml2.so.5
#12 0x210951e8 in xmlXPathCompileExpr () from /usr/local/lib/libxml2.so.5
#13 0x210941aa in xmlXPathCompFunctionCall () from /usr/local/lib/libxml2.so.5
#14 0x21094399 in xmlXPathCompPrimaryExpr () from /usr/local/lib/libxml2.so.5
#15 0x210943eb in xmlXPathCompFilterExpr () from /usr/local/lib/libxml2.so.5
#16 0x210948e9 in xmlXPathCompPathExpr () from /usr/local/lib/libxml2.so.5
#17 0x210949f0 in xmlXPathCompUnionExpr () from /usr/local/lib/libxml2.so.5
#18 0x21094b5d in xmlXPathCompUnaryExpr () from /usr/local/lib/libxml2.so.5
#19 0x21094bdc in xmlXPathCompMultiplicativeExpr () from /usr/local/lib/libxml2.so.5
#20 0x21094d38 in xmlXPathCompAdditiveExpr () from /usr/local/lib/libxml2.so.5
#21 0x21094e44 in xmlXPathCompRelationalExpr () from /usr/local/lib/libxml2.so.5
#22 0x21094fb0 in xmlXPathCompEqualityExpr () from /usr/local/lib/libxml2.so.5
#23 0x210950c8 in xmlXPathCompAndExpr () from /usr/local/lib/libxml2.so.5
#24 0x210951e8 in xmlXPathCompileExpr () from /usr/local/lib/libxml2.so.5
#25 0x210941aa in xmlXPathCompFunctionCall () from /usr/local/lib/libxml2.so.5
#26 0x21094399 in xmlXPathCompPrimaryExpr () from /usr/local/lib/libxml2.so.5
#27 0x210943eb in xmlXPathCompFilterExpr () from /usr/local/lib/libxml2.so.5
#28 0x210948e9 in xmlXPathCompPathExpr () from /usr/local/lib/libxml2.so.5
#29 0x210949f0 in xmlXPathCompUnionExpr () from /usr/local/lib/libxml2.so.5
#30 0x21094b5d in xmlXPathCompUnaryExpr () from /usr/local/lib/libxml2.so.5
#31 0x21094bdc in xmlXPathCompMultiplicativeExpr () from /usr/local/lib/libxml2.so.5
#32 0x21094d38 in xmlXPathCompAdditiveExpr () from /usr/local/lib/libxml2.so.5
#33 0x21094e44 in xmlXPathCompRelationalExpr () from /usr/local/lib/libxml2.so.5
#34 0x21094fb0 in xmlXPathCompEqualityExpr () from /usr/local/lib/libxml2.so.5
#35 0x210950c8 in xmlXPathCompAndExpr () from /usr/local/lib/libxml2.so.5
#36 0x210951e8 in xmlXPathCompileExpr () from /usr/local/lib/libxml2.so.5
#37 0x2109a7b0 in xmlXPathCtxtCompile () from /usr/local/lib/libxml2.so.5
#38 0x21145d05 in xsltXPathCompile () from /usr/local/lib/libxslt.so.2
#39 0x2115720e in xsltForEachComp () from /usr/local/lib/libxslt.so.2
#40 0x2115785b in xsltStylePreCompute () from /usr/local/lib/libxslt.so.2
#41 0x211413cb in xsltPrecomputeStylesheet () from /usr/local/lib/libxslt.so.2
#42 0x211414f8 in xsltPrecomputeStylesheet () from /usr/local/lib/libxslt.so.2
#43 0x21142963 in xsltParseStylesheetProcess () from /usr/local/lib/libxslt.so.2
#44 0x21142b20 in xsltParseStylesheetImportedDoc () from /usr/local/lib/libxslt.so.2
#45 0x21142b8d in xsltParseStylesheetDoc () from /usr/local/lib/libxslt.so.2
#46 0x10005e7 in main ()
#47 0x1000516 in _start ()
(gdb)