[xslt] memory issues in libxslt/libxml2?



Hello,

I am experiencing problems with XSLT python bindings. Running the
basic.py sample from the website crashes with the message:

python in free(): error: modified (page-) pointer

The GDB backtrace output:
(gdb) bt
#0  0x2827f293 in kill () from /lib/libc.so.5
#1  0x28215b93 in raise () from /usr/lib/libpthread.so.1
#2  0x282e6a3b in abort () from /lib/libc.so.5
#3  0x2828a4c9 in ldexp () from /lib/libc.so.5
#4  0x2828a50d in ldexp () from /lib/libc.so.5
#5  0x2828b0e4 in ldexp () from /lib/libc.so.5
#6  0x2828b653 in ldexp () from /lib/libc.so.5
#7  0x2828b784 in free () from /lib/libc.so.5
#8  0x2838cf6c in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#9  0x2838cefb in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#10 0x2838cefb in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#11 0x2838cefb in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#12 0x2838cefb in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#13 0x2838a754 in xmlFreeDoc () from /usr/local/lib/libxml2.so.5
#14 0x2855ecc0 in xsltFreeStylesheet () from /usr/local/lib/libxslt.so.2
#15 0x28553a51 in libxslt_xsltFreeStylesheet () from /usr/local/lib/python2.4/site-packages/libxsltmod.so
#16 0x080d6194 in PyCFunction_Call ()
#17 0x0809f1fc in PyEval_GetFuncDesc ()
#18 0x0809d207 in PyEval_EvalFrame ()
#19 0x0809f3b1 in PyEval_GetFuncDesc ()
#20 0x0809f28c in PyEval_GetFuncDesc ()
#21 0x0809d207 in PyEval_EvalFrame ()
#22 0x0809e0b3 in PyEval_EvalCodeEx ()
#23 0x0809ab0a in PyEval_EvalCode ()
#24 0x080b9d4c in PyRun_FileExFlags ()
#25 0x080b9d0b in PyRun_FileExFlags ()
#26 0x080b9cd9 in PyRun_FileExFlags ()
#27 0x080b8ff3 in PyRun_SimpleFileExFlags ()
#28 0x080b8a83 in PyRun_AnyFileExFlags ()
#29 0x080557cb in Py_Main ()
#30 0x08054e9d in main ()

Operating system: FreeBSD 5.3-STABLE
Python and libraries are built from the recent ports:
python-2.4_1        An interpreted object-oriented programming language
libxml2-2.6.18      XML parser library for GNOME
libxslt-1.1.13      The XSLT C library for GNOME
py24-libxml2-2.6.18 Python interface for XML parser library for GNOME
py24-libxslt-1.1.13 Python interface for XSLT C library for GNOME

Running  xsltproc by iteself performs fine. Playing with the XSL/XML input
I have localized the problem to be caused by <xsl:text>...</xsl:text>.

The following minimalistic example produces the crash at my computer:
[test.xsl]
<?xml version="1.0" encoding="koi8-r"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
 <xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
 <xsl:template match="/"><xsl:text>q</xsl:text></xsl:template>
</xsl:stylesheet>

[test.py]
import libxml2
import libxslt
styledoc = libxml2.parseFile("test.xsl")
style    = libxslt.parseStylesheetDoc(styledoc)
style.freeStylesheet()

It doesn't matter which symbol(s) is in the <xsl:text>...</xsl:text>, except
for an empty tag it always crashes.

-- 
Best regards,   | homepage: http://www.mindon.net/illinar
Oleg Grodzevich | e-mail:   illinar mindon net | ICQ: 37500662



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]