List Info

Thread: Debugging memory in libxml2




Debugging memory in libxml2
user name
2006-12-21 21:04:39

Daniel and Chris -

Thanks for the guidance, I've done the investigation, and here is what I've found so far...

1. The first calls to the libxml2 library occur in a thread (not in main).
2.  When a second thread makes a call to xmlBufferCreate() it calls xmlGetGlobalState(), which traps on EnterCriticalSection(&cleanup_helpers_cs); (line 569 in 2.6.26).
3. Compiler is MSVC  13.10.3077 (32 bit)
4. Libxml2 version is 2.6.26
5. Libxml2 was built with configure.js debug=yes

I've checked and made sure that every component is built with /MD so there aren't any CRT problems.  Is there something I have to do in main before I can access libxml2 in multiple threads?  Are there problems with xmlBuffer's being accessed from multiple threads?  Any other hints?

Thanks and Merry Christmas,

Jim

NOTE:  ILS Technology takes no responsibility for religious greetings by its employees, please don't sue us!
Debugging memory in libxml2
user name
2006-12-21 21:17:54
On Thu, Dec 21, 2006 at 04:04:39PM -0500, jwertilstechnology.com wrote:
> Daniel and Chris -
> 
> Thanks for the guidance, I've done the investigation,
and here is what 
> I've found so far...
> 
> 1. The first calls to the libxml2 library occur in a
thread (not in main).
> 2.  When a second thread makes a call to
xmlBufferCreate() it calls 
> xmlGetGlobalState(), which traps on 
> EnterCriticalSection(&cleanup_helpers_cs); (line
569 in 2.6.26).
> 3. Compiler is MSVC  13.10.3077 (32 bit)
> 4. Libxml2 version is 2.6.26
> 5. Libxml2 was built with configure.js debug=yes
> 
> I've checked and made sure that every component is
built with /MD so there 
> aren't any CRT problems.  Is there something I have to
do in main before I 
> can access libxml2 in multiple threads?  Are there
problems with 
> xmlBuffer's being accessed from multiple threads?  Any
other hints?

  Hum, try to call xmlInitParser() in the main thread before
any other
operation occurs with libxml2, for example at startup:
     http://xmlsoft.org/th
reads.html

Daniel

-- 
Red Hat Virtualization group http://redhat.com/v
irtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )