Re: [xml] Segmentation fault in xmlFreeDoc

Hi Kasimier,

I tried putting xmlInitParser() at the start of my program and called xmlCleanUpParser in the process cleanup function It gave me a huge improvement in memory leaks. valgrind use to show me lot of memory leak in xmlNewMutex etc.. now I do not have them at all.

You are right the xmlCleanUpParser which I use to call in my parsing function might be the cause of the crash in xmlFreeDoc. I will let you know once i run the test. Thanks a lot

I had tried the xmllint  --version command before,  I did not find any information related to threads. When issued the xmllint --version command i got following output

[root chidanand libxml2-2.6.10]#  /usr/local/bin/xmllint --version
/usr/local/bin/xmllint: using libxml version 20610
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude Iconv Unicode Regexps Automata Schemas

I see your libxml2 version as 2.6.24 was this support not available 2.6.10?

this time i had compiled libxml2 as follows:

./configure --prefix=/usr/local --without-python --with-threads
make install
make tests


On 5/22/06, Buchcik, Kasimier <k buchcik 4commerce de> wrote:

> -----Original Message-----
> From: Chidanand Gangur [mailto:chidanand gangur gmail com]

> Hi Kasimier,
> While going through the APIs i encountered
> xmlInitGlobals: Additional initialisation for multi-threading
> xmlCleanUpGlobals:Additional cleanup for multi-threading
> should we use these APIS along with xmlInitParser/xmlCleanupParser ?

IIRC, xmlInitParser() and xmlCleanupParser() call those threading
specific functions. Just look at the code of xmlInitParser() & co.,
and you'll see what they actually do; the easiest way to clarify
such things.

> How do i verify that libxml2 is compiled with threads at runtime?
> I had compiled it with
> ./configure --prefix=/usr/local --without-python
> since --with-threads in ./configure --help was marked as
>  --with-threads          add multithread support(on)

I think "xmllint --version" could be the easiest way to query this:

kbu librax:/data/home/kbuchcik/gnomecvs/libxslt$ xmllint --version
xmllint: using libxml version 20624-CVS2779
   compiled with: **Threads** Tree Output Push Reader Patterns Writer
SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude
Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules
Debug MemDebug

But please avoid writing privately only to me. The mailing list
is intended for such questions, and you'll reach a broaded audience
than just me. I'm not even an expert for Libxml2's multithreading



Chidanand Gangur

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