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. 

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 

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


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


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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