[lxml-dev] Unable to solve a crash on Windows with LXML

Robert Liebeskind robl at perfectworld.net
Fri Jan 23 11:14:27 CET 2009


Hi Stefan et al.,

First, thank you for the quick response.  The issue has shifted again  
slightly on us.
Instead of it appearing to be a double free, now it is reporting an  
invalid pointer.
Perhaps still a double-free or maybe that was a red-herring.

I have attached a stack trace for you to see.  Also, here are the  
contents of the/a msvc++ error I see when it happens.

The window title is "Microsoft Visual C++ Debug Library".  The text in  
the window is:

"Program C:\Python25\python_d.exe
File: dbgheap.c
Line: 1143
Expression: _CrtIsValidHeapPointer(pUserData)

This is a shifty bug.  It has been very hard for us to nail down.   
Your help is greatly appreciated.  Please let me know what else I can  
provide.

Regards,

Rob.

On Jan 22, 2009, at 3:32 PM, Stefan Behnel wrote:

> Robert Liebeskind wrote:
>> Hello.  We are building a product that uses Python 2.5 and LXML  
>> (2.1.4
>> at present) on Windows in a highly multi-threaded environment. We  
>> have
>> been trying to resolve an issue that causes Python to throw a Windows
>> unhandled exception in Windows for a few months now.
>
> The only real issue with 2.1.4 that I know of is a memory leak  
> related to
> exception handling. Please make sure it's not just running out of  
> memory.
>
> I just noticed that we still do not have Windows builds for 2.1.5 on  
> PyPI.
> I'll see what I can do on that front.
>
>
>> The issue appears to
>> involve lxml freeing the same pointer twice.  We have already  
>> compiled
>> a debug build of lxml and this is what DevStudio reports when we run
>> with this build.
>
> I really need to see a stack trace. That would at least tell me  
> where the
> problem occurs and what is being freed.
>
> Linux has Valgrind which would allow to see where the pointer was  
> freed
> the first time. I don't know of any such tool under Windows. Maybe  
> others
> can give hints on how to debug these things there?
>
> Stefan
>
>



More information about the lxml-dev mailing list