[lxml-dev] lxml \ libxslt \ libxml2 leads to apache 2 crash on freebsd/amd64

Dmitri Fedoruk dfedoruk at gmail.com
Thu Dec 27 17:21:27 CET 2007


Hello once again,

I've upgdaded my code to be lxml2.0-compatible.

> Entity 'hellip' not defined
Parsing of the incoming data fails when I have html entities in it.

Literally I have this code:

xmlParser = etree.XMLParser( no_network = False, resolve_entities = False )
storedDoc = etree.parse( StringIO.StringIO(reply['data']), xmlParser )

I tried to turn  resolve_entities = True, did not help either. The
point is that all entities are defined in the files included in the
DTD file, and I do not want to validate the data in the runtime - I
have strict time limitations. It worked fine win 1.3.x without special
parser, just with
storedDoc = etree.parse( StringIO.StringIO(reply['data']) )

So, is there any chance to deal with entities in my incoming data
without validating?

> function takes at most 1 positional arguments (2 given)
That was the very string that leads to problems, I had to add the
'encoding' keyword.
return etree.tostring(result_tree, encoding = 'utf-8')

Nevertheless the upgrade did not help.

(gdb) bt
#0  0x00000008011464bc in kill () from /lib/libc.so.6
#1  0x0000000800f5261e in raise () from /lib/libpthread.so.2
#2  0x000000080114534d in abort () from /lib/libc.so.6
#3  0x00000008010de265 in _UTF8_init () from /lib/libc.so.6
#4  0x00000008010de29c in _UTF8_init () from /lib/libc.so.6
#5  0x00000008010df23d in _UTF8_init () from /lib/libc.so.6
#6  0x00000008069d7a19 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#7  0x00000008069d78bd in xmlFreeProp () from /usr/local/lib/libxml2.so.5
#8  0x00000008069d78fc in xmlFreePropList () from /usr/local/lib/libxml2.so.5
#9  0x00000008069d7adb in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#10 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#11 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#12 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#13 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#14 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#15 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#16 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#17 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#18 0x00000008069d79a5 in xmlFreeNodeList () from /usr/local/lib/libxml2.so.5
#19 0x00000008069d80f5 in xmlFreeDoc () from /usr/local/lib/libxml2.so.5
#20 0x000000080656d589 in __pyx_tp_dealloc_4lxml_5etree__Document ()
   from /usr/local/lib/python2.5/site-packages/lxml-2.0alpha6-py2.5-freebsd-6.2-20070912-SNAP-amd64.egg/lxml/etree.so
#21 0x000000080658f48b in __pyx_tp_dealloc_4lxml_5etree__Element ()
   from /usr/local/lib/python2.5/site-packages/lxml-2.0alpha6-py2.5-freebsd-6.2-20070912-SNAP-amd64.egg/lxml/etree.so
#22 0x000000080656eacf in __pyx_tp_dealloc_4lxml_5etree__ElementTree ()
   from /usr/local/lib/python2.5/site-packages/lxml-2.0alpha6-py2.5-freebsd-6.2-20070912-SNAP-amd64.egg/lxml/etree.so
#23 0x0000000804bb7b4b in _PyFloat_Unpack8 () from
/usr/local/lib/libpython2.5.so

As I have already said, this happens with only several given
stylesheets. May this be the data\stylesheet problem?

Cheers,
Dmitri


More information about the lxml-dev mailing list