Re: [xml] libxml2 and thread-safety

On Mon, Oct 08, 2001 at 12:34:16PM +0200, Federico Di Gregorio wrote:

developing a little multithreaded app using libxml2 and libxslt i was
bitten by some random segfaults. i traced them back to libxml2, here's
the gdb stack trace:

#0  0x40090961 in startElement () from /usr/lib/
#1  0x400c30a1 in htmlParseCharRef () from /usr/lib/
#2  0x400c48df in htmlFreeParserCtxt () from /usr/lib/

  Hum, I doubt the stack trace is correct:

htmlFreeParserCtxt(htmlParserCtxtPtr ctxt)

  I don't see how it could call htmlParseCharRef(), there is something
wrong ...

#3  0x400c52e2 in htmlParseChunk () from /usr/lib/
#4  0x4001cd34 in _libwatson_http_search_html (http_context=0x8081b80)
    at watson_http.c:89
can someone tell me if libxml2 is really thread safe (and the guilty is
my code) or special precautions should be taken when using it in
multithraded environment?

  Check the archives, this was discussed at length last week and is being
worked on. multiple threads parsing different documents should work once
initialized properly, there might be undiscovered problems w.r.t. the HTML
parser though.


Daniel Veillard      | Red Hat Network
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]