Re: [xml] occasional segfault



On Mon, Apr 21, 2003 at 10:17:07AM -0400, Xiang Yan wrote:
Hello,

Following code gets segfault occasionally with same input in a multithreaed env(gnu/linux rh as/glibc 
2.96/g++...):
[...]
 m_doc = xmlParseMemory(tmp, strlen(tmp));
...
////////////////////////////////////////////////////////
// stack trace here
///////////////////////////////////////////////////////
#0  chunk_alloc (ar_ptr=0x402b82c0, nb=56) at malloc.c:3001
#1  0x40203828 in __libc_malloc (bytes=52) at malloc.c:2811
#2  0x40074bbe in xmlNewTextLen () from /usr/lib/libxml2.so.2
[...]
What's the possible reason for this?

Did you compile libxml2 with thread support ?
Did you link with -lpthread ? 

  I assume the answer is no, and hence it's not surprizing, the
memory allocator of the default glibc may not be reentrant.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
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]