Not sure if this is a problem in Valgrind, or libxml2 (or even something else), but this program (will attach in a moment) is reported as having a memory leak. Valgrind says it's still reachable, but passing --show-reachable=yes does not show anything else. The program seems to free all allocated memory, so I'm guessing the problem is in libxml2 (but don't have any way to confirm that). Reproducible: Always Steps to Reproduce: 1. emerge valgrind and emerge libxml2 if not already emerged 2. Compile the program (making sure to specify -I/usr/include/libxml2 -lxml2 and perhaps -g -ggdb3) 3. Run the program with valgrind on the test xml file (valgrind ./testval test.xml for example) Actual Results: Valgrind will display that there is a leak in the program. Expected Results: Valgrind shouldn't find a leak. Valgrind version: 2.4.0 Libxml2 version: 2.6.22 Emerge info: Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.12-gentoo-r10 i686) ================================================================= System uname: 2.6.12-gentoo-r10 i686 AMD Athlon(tm) Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5-r2, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=i686 -mcpu=athlon-mp -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=i686 -mcpu=athlon-mp -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 alsa apm arts avi berkdb bitmap-fonts boundschecking bzip2 crypt cscope cups eds emboss encode expat foomaticdb fortran gdbm gif gpm gstreamer gtk2 idn imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python quicktime readline sdl spell ssl tcpd truetype truetype-fonts type1-fonts udev vorbis xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Created attachment 72591 [details] code that demonstrates the problem I compiled this with: gcc -Wall -g -ggdb3 -o valtest valtest.c -I/usr/include/libxml2 -lxml2 Then ran it with: valgrind ./valtest test.xml
Created attachment 72592 [details] file I passed to the program ...
Calling xmlCleanupParser after xmlFreeDoc makes valgrind stop complaining here.
Sounds like a bug in the test program? If not, re-open.
(In reply to comment #4) > Sounds like a bug in the test program? If not, re-open. I suppose it could be marked closed then. Tested and all is good with that function. Not sure why I didn't notice this before though (I could have sworn it never did this in the past). Is this new or did it do it before and I was blind ? Thanks though. Works for me.