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

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 /export/home/chris/dev/oem/lib/libxml2.a

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

Thanks for all your help

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