[xml] Win32 crash in xmlGetGlobalState



Hi all,

 

I’m having a bit of a problem using libxml2 (version 2.6.17) with multiple threads under Windows (VC++ 6, SP6), and I was wondering if anyone could shed any light on what the issue might be.

 

I’m trying to use xmlDocDumpMemoryEnc() from a child thread in my windows app, using the libxml2 DLL. Basically, it crashes inside this function when I call it – I’ve compiled myself a debug version of libxml2 from the source, and discovered that the function that causes the crash is xmlGetGlobalState() in __xmlDefaultBufferSize(), which is used when allocating the memory to dump to (in xmlBufferCreate()). I’ve looked back through the archives, and tried the various things I could find that could be related:

 

1)       I’m calling xmlInitParser() at the very beginning of my app, as instructed in the “Thread Safety” page on xmlsoft.org

 

2)       Compiling libxml2 with different library versions (i.e. Multithreaded DLL, Multithreaded debug DLL) doesn’t make any difference. Both libxml2 and all my code are compiled with /MDd, and I still have the problem.

 

3)       Compiling libxml2 with different thread types doesn’t help either (native threads are the only ones that work).

 

Does anyone know if there are any basic steps that I’ve missed that would cause libxml2 to crash when getting the global state from inside a child thread?

 

cheers,

 

James Smith – james smith seos com



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