[lxml-dev] *** glibc detected *** free(): invalid pointer: 0x086449e7 ***

Stefan Behnel stefan_ml at behnel.de
Mon Mar 5 16:56:35 CET 2007


Hi,

Doug Winter wrote:
> I'm getting this error at times using lxml:
> 
> *** glibc detected *** free(): invalid pointer: 0x086449e7 ***
> 
> Unfortunately the smallest test fixture I have that does this involves 
> running all of TurboGears - when I do this without TurboGears I don't 
> get the error.  However, I've got a backtrace from gdb that points it's 
> finger at libxml2.  I'm trying here first in case this is really an lxml 
> problem.
> 
> (gdb) bt
> #0  0xb7fcd410 in ?? ()
> #1  0xb4a9ac4c in ?? ()
> #2  0x00000006 in ?? ()
> #3  0x00007da7 in ?? ()
> #4  0xb7e7c811 in raise () from /lib/tls/i686/cmov/libc.so.6
> #5  0xb7e7dfb9 in abort () from /lib/tls/i686/cmov/libc.so.6
> #6  0xb7eb1d3a in __fsetlocking () from /lib/tls/i686/cmov/libc.so.6
> #7  0xb7eb95cf in mallopt () from /lib/tls/i686/cmov/libc.so.6
> #8  0xb7eb9672 in free () from /lib/tls/i686/cmov/libc.so.6
> #9  0xb729055d in xmlFreeNodeList () from /usr/lib/libxml2.so.2
> #10 0xb72906a2 in xmlFreeProp () from /usr/lib/libxml2.so.2
> #11 0xb729091b in xmlFreePropList () from /usr/lib/libxml2.so.2
> #12 0xb72904fa in xmlFreeNodeList () from /usr/lib/libxml2.so.2
> #13 0xb72902fe in xmlFreeDoc () from /usr/lib/libxml2.so.2
> #14 0xb73f3cc6 in initTagMatch ()
>     from 
> /var/local/sites/mma.dev7.isotoma.com/lib/python2.4/site-packages/lxml/etree.so
> #15 0xb73f3aec in initTagMatch ()
>     from 
> /var/local/sites/mma.dev7.isotoma.com/lib/python2.4/site-packages/lxml/etree.so
> #16 0xb73b9826 in iteratorStoreNext ()
>     from 
> /var/local/sites/mma.dev7.isotoma.com/lib/python2.4/site-packages/lxml/etree.so
> #17 0xb73b968c in iteratorStoreNext ()
>     from 
> /var/local/sites/mma.dev7.isotoma.com/lib/python2.4/site-packages/lxml/etree.so
> #18 0xb73beb06 in iteratorStoreNext ()
>     from 
> /var/local/sites/mma.dev7.isotoma.com/lib/python2.4/site-packages/lxml/etree.so

Hmmm, two things that leave me puzzled:

* "iteratorStoreNext" points to the external C-API of etree, however, it is
unlikely that it is used here. lxml.objectify is currently the only module
that uses it.

* if "_iteratorStoreNext" is meant instead (mind the underscore), it refers to
element iteration. And I can't see where iteration is used in your example.

Any ideas from your side where iteration comes into play in your code?

Stefan


More information about the lxml-dev mailing list