Re: [xml] LibXml2 Crash in MultiThreaded Windows



Hi Lav,

You can build projects using the bakefile system; otherwise just use the windows buildsystem (configure within the win32 dir and nmake). The project files were dropped because they were a pain to maintain.

Lav Mehrotra wrote:
Daniel ,

I have read that page when crash started to occur in Windows
Multithreading environment.

I had used xmlInitParser() & xmlCleanupParser() in my main thread
before creating any threads having LibXml2 APIs.

I had even used the _xmlRMutex , xmlRMutex provided in "threads.h" when my synchronization windows primitives ( Critical Sec & Mutexes ) were not working .
But xmlRMutex , xmlRMutex , xmlMutexLock/Unlock() ,
xmlRMutexLock/Unlock() APIs were of no help
Did you get a stack trace to find out what were the alloc crash was even coming from? Just saying that your app crashed in the win runtime at that line isn't all too helpful.

As far as ........ "configure the library accordingly using the --with-threads options"

I am not sure how to achieve the same in windows. This step seems as part of the make file in Unix , when the library was
installed in the 1st place.
Can't we achieve this option in the code itself ???
This is done at compile time using the same option. Windows though allows you to specify what type of threading to use as well (ctls, native, posix - and no this cant be done at runtime.
Also it would be grt if u or Igor can spare some of ur valuable time &
go thru this blog......

http://blog.kowalczyk.info/archives/2006/08/07/the-missing-msvcr80dll-st
ory/


There is nothing strange about that. It also is a good reason why its stressed not to mix where you allocate/de-allocate memory (same with file descriptors) when working with dlls. If allocated in dll, make sure you de-allocate from within the dll. If you follow those guidelines, you can successfully use the library with a client compiled with a different run-time.

Rob




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