[xml] LibXml2 Crash in MultiThreaded Windows

All List Members,



Our project has to use a portable Xml Library in both Unix ( many POSIX variants ) & Windows

I designed a C++ Wrapper Reader , Writer classes on LibXml2 based C API..


Everything worked fine ( in single Threaded Windows & Multithreaded UNIX ) & my Wrapper Library ( .Lib Only VS 2005 project in Windows – No Dlls & .a in UNIX ) behaved same in Linux/Solaris & Windows machines , without any code changes.

The client exe was also the same in both UNIX & Windows


My Windows settings were as follows……….


Client ( exe ) -> Wrapper ( .lib ) Statically Link -> Orig LibXml2 (implicit linking to Import Lib – libxml2.lib & libxml2.dll present at Runtime)


Since our project has to read & write Xml files within various threads , it worked perfectly well in UNIX multithreading environment.

But crashed in Windows Multi-threaded environment  ( xmlParse(FileName or Memory API ) )

I used /MT ( Static Link to C Runtime ) throughout in the Wrapper as well as my client ( statically linking to my Wrapper Lib ).


I finally got hold of all the .C source files of LibXml2 & compiled them in VS 2005  as well as old VC6 & changed accordingly all my Wrapper & Client to VS 2005 or VC 6 projects

But the problem remained.


We have to finally build the Wrapper in Xerces C++ API ( as Xerces VC 6 , VC7 , VC8 Solution along with the source is freely available ) , which ran fine in both Unix & Windows multithreaded environment.


My LibXml2 Wrapper was definitely faster as it was in C & I would like to run it in Windows MultiThreaded environment if somebody can help.

I know original LibXml2.dll , iconv.dll & zlib1.dll were all built in the old VC6 Environment.


It would be nice , if a LibXml2 VS 2005 Solution project is provided along with the source code as Xerces guys have done .



( In VS2005 Environment Crash Occurs in msvcr80.dll  in void * __cdecl _malloc_base (size_t size) Line 154 ……..

//  allocate memory block

res = _heap_alloc(size);  )






This email may contain confidential or privileged information for the intended recipient(s) and the views expressed in the same are not necessarily the views of Zensar Technologies Ltd. If you are not the intended recipient or have received this e-mail by error, its use is strictly prohibited, please delete the e-mail and notify the sender. Zensar Technologies Ltd. does not accept any liability for virus infected mails.

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