Hi, We are designing an application using your libxml2 (2.6.23).
We experienced some problems with that version and with the latest one. It
seams that in multi thread environment some initialization code does not work correctly
(it of course can be a bad use from us). The fact is that when the globalkey
(pthread environment) value is 0 (occurs for the first thread) the thread
specific memory is not set up correctly and then we have a lot of problem
(indeed the DefaultXmlBufferSize has random values…). With every non-zero
value everything works good. I made a change to fix it in my particulare case but I’m
quite sure that this is not the good way to fix it. Here is the change I did in
thread.c:784 (in red) static void xmlOnceInit(void) { #ifdef HAVE_PTHREAD_H (void) pthread_key_create(&globalkey,
xmlFreeGlobalState); if(globalkey==0) (void)
pthread_key_create(&globalkey, xmlFreeGlobalState); mainthread = pthread_self(); #endif #if defined(HAVE_WIN32_THREADS) if (!run_once.done) { if (InterlockedIncrement(&run_once.control) ==
1) { #if !defined(HAVE_COMPILER_TLS) globalkey = TlsAlloc(); #endif …. Could you please inform me if this problem is due to a bad
use of your library or if you already experienced the same problem ? Thank you for your help, Sincerely, Sylvain Lecorné. |