Re: [xml] [PATCH] Use a hybrid allocation scheme in xmlNodeSetContent.



On Mon, May 14, 2012 at 02:43:26PM +0800, Daniel Veillard wrote:
[...]
P.S.: if you have too much time and want to help me, there is a leak in
  the new Lzma/xz support code which looks nasty and need to be fixed
  before the next release:
paphio:~/XML -> xmllint --version
xmllint: using libxml version 20708-GITv2.7.8-108-g7d0d2a5
 compiled with: Threads Tree Output Push Reader Patterns Writer
SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer
XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas
Schematron Modules Debug Zlib Lzma 
paphio:~/XML -> valgrind --leak-check=full xmllint --noout dba100000.xml 
==13484== 7,152 bytes in 1 blocks are definitely lost in loss record 1
of 1
==13484==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==13484==    by 0x3473409926: inflateInit2_ (in /lib64/libz.so.1.2.5)
==13484==    by 0x541EFE: xz_head (xzlib.c:377)
==13484==    by 0x542C21: xz_make (xzlib.c:584)
==13484==    by 0x542F2C: __libxml2_xzread (xzlib.c:688)
==13484==    by 0x452A1C: xmlXzfileRead (xmlIO.c:1410)
==13484==    by 0x45500D: xmlParserInputBufferGrow (xmlIO.c:3282)
==13484==    by 0x414BE6: xmlParserInputGrow (parserInternals.c:353)
==13484==    by 0x41B738: xmlGROW (parser.c:2003)
==13484==    by 0x433DE6: xmlParseDocument (parser.c:10245)
==13484==    by 0x43D895: xmlDoRead (parser.c:14656)
==13484==    by 0x43D9C0: xmlReadFile (parser.c:14716)
==13484==    by 0x406A43: parseAndPrintFile (xmllint.c:2381)
==13484==    by 0x40BB4D: main (xmllint.c:3726)
==13484== 
paphio:~/XML -> 
   Somehow it seems xmlXzfileRead doesn't free some memory allocated
   internally in the xz library :-\

  No need to search, I nailed it ! (#ifdef HAVE_LIBZ_H instead of
#ifdef HAVE_ZLIB_H in __libxml2_xzclose),

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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