Re: [xml] valgrind and xmlNewTextReaderFilename
- From: Rob Richards <rrichards cdatazone org>
- To: Norman Lo <nlo carrastro com>
- Cc: xml gnome org
- Subject: Re: [xml] valgrind and xmlNewTextReaderFilename
- Date: Thu, 04 Aug 2011 07:58:30 -0400
On 8/3/11 5:58 PM, Norman Lo wrote:
Hi,
I am trying to parse an XML file using xmlTextReader interface.
Consider the following short program:
#include <libxml/xmlreader.h>
int main(){
xmlTextReaderPtr reader;
reader = xmlNewTextReaderFilename("./Config Sample.xml");
xmlFreeTextReader(reader);
}
When I run it against valgrind, I got a bunch memory blocks still
reachable errors, some of these are listed below.
Am I not using the right exit function to free the memory. Or is it
expected. I have tried the same program with v2.6.26 and v2.7.8.
Thank you very much in advance.
Norman
==24058==
==24058== 40 bytes in 1 blocks are still reachable in loss record 15
of 18
==24058== at 0x4A06F0F: malloc (vg_replace_malloc.c:236)
==24058== by 0x3119E2ED87: xmlNewCharEncodingHandler (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E2EF3E: xmlInitCharEncodingHandlers (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E2F24B: xmlGetCharEncodingHandler (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E57EEA: xmlAllocParserInputBuffer (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E5838B: __xmlParserInputBufferCreateFilename (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119ED7114: xmlNewTextReaderFilename (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x400609: main (test.c:6)
==24058==
==24058== 40 bytes in 1 blocks are still reachable in loss record 16
of 18
==24058== at 0x4A06F0F: malloc (vg_replace_malloc.c:236)
==24058== by 0x3119E2ED87: xmlNewCharEncodingHandler (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E2EF53: xmlInitCharEncodingHandlers (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E2F24B: xmlGetCharEncodingHandler (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E57EEA: xmlAllocParserInputBuffer (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E5838B: __xmlParserInputBufferCreateFilename (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119ED7114: xmlNewTextReaderFilename (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x400609: main (test.c:6)
==24058==
==24058== 104 bytes in 1 blocks are still reachable in loss record 17
of 18
==24058== at 0x4A06F0F: malloc (vg_replace_malloc.c:236)
==24058== by 0x3119E9A40C: xmlNewRMutex (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119EE7974: ??? (in /usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119EE7B91: xmlDictCreate (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E329DB: xmlInitParserCtxt (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E32A4D: xmlNewParserCtxt (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E4A035: xmlCreatePushParserCtxt (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119ED6CE1: xmlNewTextReader (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119ED7127: xmlNewTextReaderFilename (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x400609: main (test.c:6)
==24058==
==24058== 400 bytes in 1 blocks are still reachable in loss record 18
of 18
==24058== at 0x4A06F0F: malloc (vg_replace_malloc.c:236)
==24058== by 0x3119E2EE4A: xmlInitCharEncodingHandlers (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E2F24B: xmlGetCharEncodingHandler (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E57EEA: xmlAllocParserInputBuffer (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119E5838B: __xmlParserInputBufferCreateFilename (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x3119ED7114: xmlNewTextReaderFilename (in
/usr/lib64/libxml2.so.2.6.26)
==24058== by 0x400609: main (test.c:6)
==24058==
==24058== LEAK SUMMARY:
==24058== definitely lost: 0 bytes in 0 blocks
==24058== indirectly lost: 0 bytes in 0 blocks
==24058== possibly lost: 0 bytes in 0 blocks
==24058== still reachable: 886 bytes in 18 blocks
==24058== suppressed: 0 bytes in 0 blocks
==24058==
==24058== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
--24058--
--24058-- used_suppression: 4 dl-hack3
==24058==
==24058== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
http://xmlsoft.org/xmlmem.html
Read the section "Cleaning up after using the library"
Rob
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]