Re: [xml] Memory Leaks in parse3.c example



On Fri, Aug 11, 2006 at 07:38:22AM -0400, Chris Johnson wrote:
Bjorn Reese wrote:
Chris Johnson wrote:

xmlNewGlobalState() is not available to break in

It has probably been inlined by the compiler.

xmlOnceInit() is never called therefore pthread_key_create is never 
called from xmlOnceInit().

I believe that we have found the problem. According to the following
URL you should link with -lpthread.

http://groups.google.dk/group/comp.programming.threads/msg/ac097ead118c41a6 


Does 'xml2-config --libs' include -lpthread or not?
$ xml2-config --libs
-L/tmp/lib -R/tmp/lib -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl

As it turns out if I link parse3.c with -lpthread the problem goes 
away.. so my new compile and link line looks something like

gcc -g -I/export/home/chris/dev/oem/include/libxml2 -L/usr/local/lib 
parse3.c  -lpthread -lsocket -lnsl -lm -lz -liconv 
/export/home/chris/dev/oem/lib/libxml2.a

Should I have to use -lpthread while linking parse3.c?

  <sigh/>

  http://xmlsoft.org/FAQ.html#Developer

 use xml2-config --cflags and xml2-config --libs as suggested.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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