[xml] Memory Bug detection for gdome



Hello,

I am currently trying to run gdome tests under cygwin but get segfaults. Since I can't find with the debuger where the memory corruption occurs, I tried to use the memory allocation hooks provided by the library. I have written my own very simple memory allocator: One big chunk of memory is allocated at first, and then pieces of this big chunk are provided on demand. The memory is never freed (and I never run out of memory in this particular case). I setup this memory allocator with:

xmlMemSetup(myFree, myMalloc, myRealloc,xmlMemStrdup);

And put this at the very begining of the test.

I get the results below. I was expecting the "Malloc at 0x... of ..." which are produced by my own memory allocation routines. But I was not expecting this

"Memory tag error occurs: 0x...
bye
xmlMemFree(...) error"

Which indicates that not all memory allocation routines have been hooked. I suspect this is internal to the libxml. could this indicate a memory bug in the library ?
I have libxml2 version 2.7.7

Alexandre.

aceg7283 P-7ZZ11EEO:>~/gdome2-0.8.1/test
$ ./test-document.exe
Debug memory callbacks in place
Malloc at 0xc58aa8 of 96
Malloc at 0xc58b74 of 4
Malloc at 0xc58b50 of 60
Malloc at 0xc58bd3 of 5
.Malloc at 0xc58bb1 of 60
Malloc at 0xc58c35 of 4
.Malloc at 0xc58c35 of 24
Malloc at 0xc58c68 of 13
Malloc at 0xc58c8e of 4
Malloc at 0xc58c6a of 60
Malloc at 0xc58cee of 4
.Malloc at 0xc58cca of 60
Memory tag error occurs :0xc58cfe
ÂÂÂÂÂÂÂÂ bye
xmlMemFree(C58D16) error
xmlMallocBreakpoint reached on block 0
.Malloc at 0xc58d16 of 60
Malloc at 0xc58d87 of 23
Malloc at 0xc58dae of 23
Aborted (core dumped)

--
Alexandre


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