[xml] Crash on xmlMalloc

Hi all,

I'm developing an application using the library libxml2.
It seams that all was ok but yesterday my application crashed for an unknown reason.
I tried to debug and after some work I found that the line where my application crash is the xmlMalloc in the xmlParserCtxtPtr !

I'm using the libxml2 version 2.7.6 
I'm using the autotools 

=> In the file configure.ac :
# libxml2
PKG_CHECK_MODULES(LIBXMLDEPS, libxml-2.0 >= 2.6.8)

=> In the file makefile.am :

This is the back-trace :

*** glibc detected *** /home/mine/buildSVNLocal/web/cgi/config_etat.cgi: malloc(): memory corruption: 0x08052840 ***
======= Backtrace: =========
/home/mine/local/lib/libmxml.so.1(raw_parse_buffer+0x93)[0x15dd0a] //I call here xmlParseMemory

This is the function :

xmlParserCtxtPtr xmlNewParserCtxt(void)
    xmlParserCtxtPtr ctxt;

    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
    if (ctxt == NULL) {                                                                   //<- Never see this line !!!
xmlErrMemory(NULL, "cannot allocate parser context\n");
    memset(ctxt, 0, sizeof(xmlParserCtxt));
    if (xmlInitParserCtxt(ctxt) < 0) {

With a google search I saw some errors with xmlMalloc but not in the same context that mine.
Do you have any ideas ? I need your help.


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