memory leaks
Posted: Wed Mar 29, 2006 12:05 pm
Hi,
I've got some questions about memory leaks and avilable tools. I have read other related threads here.
add 1]
when I run valgrind (even on sample project), I always get some memory leaks report. It's just normal or it's another speciality of my system configuration?
valgrind command:
valgrind --leak-check=full --logfile=log01 -v program
report:
What's wrong??
Here is the sample's code, it's from the book Cross-Platform GUI Programming with wxWidgets:
When I add eg. file dialog, the memory loss increase to:
add 2]
Is it sufficing, when I use for memory-leak-checks debug build of WX with these options:
--enable-debug --enable-mem_tracing ??
For "normal" memory leaks it works fine. Or do I have to use other tools, like valgrind etc.? I'm just confused by valgrind reports I wrote above...
Thx for help
soban
Debian Sarge /stable+testing/
wxGTK 2.6.2
gcc version 3.3.6 (Debian 1:3.3.6-10)
I've got some questions about memory leaks and avilable tools. I have read other related threads here.
add 1]
when I run valgrind (even on sample project), I always get some memory leaks report. It's just normal or it's another speciality of my system configuration?
valgrind command:
valgrind --leak-check=full --logfile=log01 -v program
report:
Code: Select all
==4805== Memcheck, a memory error detector for x86-linux.
==4805== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==4805== Using valgrind-2.4.0, a program supervision framework for x86-linux.
==4805== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==4805==
==4805== My PID = 4805, parent PID = 4578. Prog and args are:
==4805== test_deb
==4805==
==4805== Valgrind library directory: /usr/lib/valgrind
==4805== Command line
==4805== test_deb
==4805== Startup, with flags:
==4805== --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
==4805== --leak-check=full
==4805== --logfile=valgrind_aged_01
==4805== -v
==4805== --
==4805== Contents of /proc/version:
==4805== Linux version 2.6.15.4 ([email protected]) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #4 PREEMPT Sat Mar 18 14:03:41 CET 2006
==4805== Reading syms from /home/soban/Projects/test/test_deb (0x8048000)
==4805== Reading syms from /lib/ld-2.3.6.so (0x1B8E4000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/ld-2.3.6.so...
==4805== ... CRC mismatch (computed B0E4C1C9 wanted 7804F885)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/valgrind/stage2 (0xB0000000)
==4805== Reading syms from /lib/ld-2.3.6.so (0xB1000000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/ld-2.3.6.so...
==4805== ... CRC mismatch (computed B0E4C1C9 wanted 7804F885)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/valgrind/vgskin_memcheck.so (0xB7B69000)
==4805== Reading syms from /lib/tls/libc-2.3.6.so (0xB7DCD000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libc-2.3.6.so...
==4805== ... CRC mismatch (computed D2002F5E wanted A334D03F)
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libdl-2.3.6.so (0xB7F05000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libdl-2.3.6.so...
==4805== ... CRC mismatch (computed E9226EAE wanted 2409D671)
==4805== object doesn't have any debug info
==4805== Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
==4805== Reading suppressions file: /usr/lib/valgrind/default.supp
==4805==
==4805== Reading syms from /usr/lib/valgrind/vg_inject.so (0x1B900000)
==4805== Reading syms from /usr/lib/valgrind/vgpreload_memcheck.so (0x1B903000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_gtk2d_xrc-2.6.so.0.2.0 (0x1B90D000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_gtk2d_qa-2.6.so.0.2.0 (0x1B971000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_gtk2d_html-2.6.so.0.2.0 (0x1B98C000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_gtk2d_adv-2.6.so.0.2.0 (0x1BA1D000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_gtk2d_core-2.6.so.0.2.0 (0x1BACE000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_based_xml-2.6.so.0.2.0 (0x1BE9B000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_based_net-2.6.so.0.2.0 (0x1BEA7000)
==4805== Reading syms from /home/soban/wxwidgets/wxGTK-2.6.2/build-debug/lib/libwx_based-2.6.so.0.2.0 (0x1BEDA000)
==4805== Reading syms from /usr/lib/libstdc++.so.5.0.7 (0x1C07F000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libm-2.3.6.so (0x1C13A000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libm-2.3.6.so...
==4805== ... CRC mismatch (computed 244B49E7 wanted E9D4BFC9)
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/libgcc_s.so.1 (0x1C163000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libpthread-2.3.6.so (0x1C16F000)
==4805== Reading debug info from /lib/tls/libpthread-2.3.6.so...
==4805== ... CRC mismatch (computed 0C59DE4D wanted ADF70F1D)
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libc-2.3.6.so (0x1C182000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libc-2.3.6.so...
==4805== ... CRC mismatch (computed D2002F5E wanted A334D03F)
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libdl-2.3.6.so (0x1C2BB000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libdl-2.3.6.so...
==4805== ... CRC mismatch (computed E9226EAE wanted 2409D671)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libz.so.1.2.2 (0x1C2C0000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libgtk-x11-2.0.so.0.800.13 (0x1C2D3000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libgtk-x11-2.0.so.0.800.13...
==4805== ... CRC mismatch (computed D5344FBC wanted 97CDFD3A)
==4805== Reading debug info from /usr/lib/debug/usr/lib/libgtk-x11-2.0.so.0.800.13...
==4805== Reading syms from /usr/lib/libgdk-x11-2.0.so.0.800.13 (0x1C5C9000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libgdk-x11-2.0.so.0.800.13...
==4805== ... CRC mismatch (computed 96771FA5 wanted CD6E1ED9)
==4805== Reading debug info from /usr/lib/debug/usr/lib/libgdk-x11-2.0.so.0.800.13...
==4805== Reading syms from /usr/X11R6/lib/libXrandr.so.2.0 (0x1C64B000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/X11R6/lib/libXi.so.6.0 (0x1C650000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/X11R6/lib/libXinerama.so.1.0 (0x1C659000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/X11R6/lib/libXinerama.so.1.0...
==4805== ... CRC mismatch (computed 45D900D5 wanted FF19F3AA)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/X11R6/lib/libXext.so.6.4 (0x1C65D000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libatk-1.0.so.0.1010.3 (0x1C66C000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libatk-1.0.so.0.1010.3...
==4805== ... CRC mismatch (computed 36EE1AE6 wanted C13B3A5F)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libgdk_pixbuf-2.0.so.0.800.13 (0x1C688000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libgdk_pixbuf-2.0.so.0.800.13...
==4805== ... CRC mismatch (computed A15D73E0 wanted 70A7FEDF)
==4805== Reading debug info from /usr/lib/debug/usr/lib/libgdk_pixbuf-2.0.so.0.800.13...
==4805== Reading syms from /usr/lib/libfontconfig.so.1.0.4 (0x1C69F000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libfontconfig.so.1.0.4...
==4805== ... CRC mismatch (computed CFB69E66 wanted AE870FAC)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libXcursor.so.1.0.2 (0x1C6CF000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libpango-1.0.so.0.1003.1 (0x1C6D9000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libXrender.so.1.3.0 (0x1C712000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libXrender.so.1.3.0...
==4805== ... CRC mismatch (computed DF8AAA49 wanted AB4D3587)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/X11R6/lib/libX11.so.6.2 (0x1C71C000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libgobject-2.0.so.0.800.6 (0x1C7E6000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libgobject-2.0.so.0.800.6...
==4805== ... CRC mismatch (computed 6B3AE59C wanted 745FDD84)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libgmodule-2.0.so.0.800.6 (0x1C821000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libgmodule-2.0.so.0.800.6...
==4805== ... CRC mismatch (computed 1FD37A70 wanted 5B640FCA)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libgthread-2.0.so.0.800.6 (0x1C826000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libgthread-2.0.so.0.800.6...
==4805== ... CRC mismatch (computed 58A2C7BB wanted 6217237B)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libglib-2.0.so.0.800.6 (0x1C82B000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/libglib-2.0.so.0.800.6...
==4805== ... CRC mismatch (computed 6110F8E5 wanted 514B1363)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libpng12.so.0.1.2.8 (0x1C8B1000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libjpeg.so.62.0.0 (0x1C8D7000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libexpat.so.1.0.0 (0x1C8F8000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libpangocairo-1.0.so.0.1003.1 (0x1C919000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libcairo.so.2.2.3 (0x1C921000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libfreetype.so.6.3.8 (0x1C96D000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/libpangoft2-1.0.so.0.1003.1 (0x1C9DB000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED363: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E67A7: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED000: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E67A7: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ECEF1: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E680B: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ECEFD: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E680B: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED000: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E680B: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805== TRANSLATE: 0x1C1F0260 redirected to 0x1B9077B0
==4805== TRANSLATE: 0x1C1EAD60 redirected to 0x1B906510
==4805== TRANSLATE: 0x1C1E8F90 redirected to 0x1B906A82
==4805== TRANSLATE: 0x1C1EAA10 redirected to 0x1B906EE2
==4805== TRANSLATE: 0x1C1EB2E0 redirected to 0x1B906FA1
==4805== Reading syms from /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 (0x1C06B000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805==
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED363: (within /lib/ld-2.3.6.so)
==4805== by 0x1C288E99: (within /lib/tls/libc-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C28954A: _dl_open (in /lib/tls/libc-2.3.6.so)
==4805== by 0x1C2BBD22: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C2BC476: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C2BBDA0: dlopen (in /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C79ABDA: (within /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C79AD3A: _XlcDynamicLoad (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BC08: _XOpenLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BDD2: _XlcCurrentLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805==
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED000: (within /lib/ld-2.3.6.so)
==4805== by 0x1C288E99: (within /lib/tls/libc-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C28954A: _dl_open (in /lib/tls/libc-2.3.6.so)
==4805== by 0x1C2BBD22: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C2BC476: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C2BBDA0: dlopen (in /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C79ABDA: (within /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C79AD3A: _XlcDynamicLoad (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BC08: _XOpenLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BDD2: _XlcCurrentLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805== TRANSLATE: 0x1C1F1420 redirected to 0x1B907C80
==4805== Reading syms from /lib/tls/libnss_compat-2.3.6.so (0x1CC65000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libnss_compat-2.3.6.so...
==4805== ... CRC mismatch (computed 069B346B wanted 6E820B60)
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libnsl-2.3.6.so (0x1CC6F000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libnsl-2.3.6.so...
==4805== ... CRC mismatch (computed 15D9AF2E wanted F830D2F9)
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libnss_nis-2.3.6.so (0x1CC86000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libnss_nis-2.3.6.so...
==4805== ... CRC mismatch (computed 52223410 wanted 470C8162)
==4805== object doesn't have any debug info
==4805== Reading syms from /lib/tls/libnss_files-2.3.6.so (0x1CC91000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /lib/tls/libnss_files-2.3.6.so...
==4805== ... CRC mismatch (computed C247470B wanted 98A06F9B)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/gconv/ISO8859-1.so (0x1C07B000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/gconv/ISO8859-1.so...
==4805== ... CRC mismatch (computed 3878FD60 wanted 89E7743B)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/gconv/ISO8859-2.so (0x1CC51000)
==4805== object doesn't have a symbol table
==4805== Reading debug info from /usr/lib/gconv/ISO8859-2.so...
==4805== ... CRC mismatch (computed 6C883297 wanted 009DE6B9)
==4805== object doesn't have any debug info
==4805== Reading syms from /usr/lib/pango/1.4.0/modules/pango-basic-fc.so (0x1CC56000)
==4805== object doesn't have a symbol table
==4805== object doesn't have any debug info
==4805== discard syms at 0x1C07B000-0x1C07E000 in /usr/lib/gconv/ISO8859-1.so due to munmap()
==4805== discard syms at 0x1CC51000-0x1CC55000 in /usr/lib/gconv/ISO8859-2.so due to munmap()
==4805== discard syms at 0x1CC65000-0x1CC6E000 in /lib/tls/libnss_compat-2.3.6.so due to munmap()
==4805== discard syms at 0x1CC86000-0x1CC90000 in /lib/tls/libnss_nis-2.3.6.so due to munmap()
==4805== discard syms at 0x1CC6F000-0x1CC85000 in /lib/tls/libnsl-2.3.6.so due to munmap()
==4805== discard syms at 0x1CC91000-0x1CC9D000 in /lib/tls/libnss_files-2.3.6.so due to munmap()
==4805==
==4805== ERROR SUMMARY: 103 errors from 7 contexts (suppressed: 16 from 3)
==4805==
==4805== 1 errors in context 1 of 7:
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED000: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E680B: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== 1 errors in context 2 of 7:
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ECEFD: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E680B: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== 1 errors in context 3 of 7:
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ECEF1: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E680B: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== 8 errors in context 4 of 7:
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED000: (within /lib/ld-2.3.6.so)
==4805== by 0x1C288E99: (within /lib/tls/libc-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C28954A: _dl_open (in /lib/tls/libc-2.3.6.so)
==4805== by 0x1C2BBD22: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C2BC476: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C2BBDA0: dlopen (in /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C79ABDA: (within /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C79AD3A: _XlcDynamicLoad (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BC08: _XOpenLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BDD2: _XlcCurrentLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805==
==4805== 8 errors in context 5 of 7:
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED363: (within /lib/ld-2.3.6.so)
==4805== by 0x1C288E99: (within /lib/tls/libc-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C28954A: _dl_open (in /lib/tls/libc-2.3.6.so)
==4805== by 0x1C2BBD22: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1B8EFAAE: (within /lib/ld-2.3.6.so)
==4805== by 0x1C2BC476: (within /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C2BBDA0: dlopen (in /lib/tls/libdl-2.3.6.so)
==4805== by 0x1C79ABDA: (within /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C79AD3A: _XlcDynamicLoad (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BC08: _XOpenLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805== by 0x1C76BDD2: _XlcCurrentLC (in /usr/X11R6/lib/libX11.so.6.2)
==4805==
==4805== 42 errors in context 6 of 7:
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED000: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E67A7: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
==4805==
==4805== 42 errors in context 7 of 7:
==4805== Conditional jump or move depends on uninitialised value(s)
==4805== at 0x1B8ED363: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E67A7: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8F3A40: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E79CA: (within /lib/ld-2.3.6.so)
==4805== by 0x1B8E47C6: (within /lib/ld-2.3.6.so)
--4805--
--4805-- supp: 3 Xorg 6.8.1 writev uninit padding
--4805-- supp: 11 Xorg 6.8.1 uninit _write* padding
--4805-- supp: 2 Unterminated strstr string in is_smp_system() (NPTL)
==4805==
==4805== IN SUMMARY: 103 errors from 7 contexts (suppressed: 16 from 3)
==4805==
==4805== malloc/free: in use at exit: 432703 bytes in 6567 blocks.
==4805== malloc/free: 98271 allocs, 91704 frees, 6309866 bytes allocated.
==4805==
==4805== searching for pointers to 6567 not-freed blocks.
==4805== checked 1183236 bytes.
==4805==
==4805==
==4805== 31 bytes in 1 blocks are definitely lost in loss record 37 of 159
==4805== at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==4805== by 0x1C01B928: wxSetEnv(wxString const&, char const*) (utilsunx.cpp:996)
==4805== by 0x1BC13397: wxApp::Initialize(int&, char**) (app.cpp:632)
==4805== by 0x1BFA6386: wxEntryStart(int&, char**) (init.cpp:280)
==4805== by 0x1BFA6630: wxEntry(int&, char**) (init.cpp:404)
==4805== by 0x804E8DD: main (min.cpp:35)
==4805==
==4805==
==4805== 156 (36 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 63 of 159
==4805== at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==4805== by 0x1C2655E9: (within /lib/tls/libc-2.3.6.so)
==4805== by 0x1C265C29: __nss_database_lookup (in /lib/tls/libc-2.3.6.so)
==4805== by 0x1CC670F9: ???
==4805== by 0x1CC67DAC: ???
==4805== by 0x1C213212: getpwuid_r (in /lib/tls/libc-2.3.6.so)
==4805== by 0x1C8780FA: (within /usr/lib/libglib-2.0.so.0.800.6)
==4805== by 0x1C879A35: g_get_home_dir (in /usr/lib/libglib-2.0.so.0.800.6)
==4805== by 0x1C43A655: ??? (gtkrc.c:441)
==4805== by 0x1C43F00B: _gtk_rc_init (gtkrc.c:670)
==4805== by 0x1C3FE34F: ??? (gtkmain.c:512)
==4805== by 0x1C85E8CC: g_option_context_parse (in /usr/lib/libglib-2.0.so.0.800.6)
==4805==
==4805==
==4805== 800 bytes in 20 blocks are possibly lost in loss record 121 of 159
==4805== at 0x1B906F75: calloc (vg_replace_malloc.c:175)
==4805== by 0x1C857BA2: g_malloc0 (in /usr/lib/libglib-2.0.so.0.800.6)
==4805== by 0x1C80722B: (within /usr/lib/libgobject-2.0.so.0.800.6)
==4805== by 0x1C808F74: (within /usr/lib/libgobject-2.0.so.0.800.6)
==4805== by 0x1C80917F: g_type_init_with_debug_flags (in /usr/lib/libgobject-2.0.so.0.800.6)
==4805== by 0x1C8092F1: g_type_init (in /usr/lib/libgobject-2.0.so.0.800.6)
==4805== by 0x1C5DDA87: gdk_pre_parse_libgtk_only (gdk.c:173)
==4805== by 0x1C3FE1F0: ??? (gtkmain.c:443)
==4805== by 0x1C85E7B0: g_option_context_parse (in /usr/lib/libglib-2.0.so.0.800.6)
==4805== by 0x1C3FE671: gtk_parse_args (gtkmain.c:693)
==4805== by 0x1C3FE6F3: gtk_init_check (gtkmain.c:729)
==4805== by 0x1BC1342A: wxApp::Initialize(int&, char**) (app.cpp:687)
==4805==
==4805== LEAK SUMMARY:
==4805== definitely lost: 67 bytes in 2 blocks.
==4805== indirectly lost: 120 bytes in 10 blocks.
==4805== possibly lost: 800 bytes in 20 blocks.
==4805== still reachable: 431716 bytes in 6535 blocks.
==4805== suppressed: 0 bytes in 0 blocks.
==4805== Reachable blocks (those to which a pointer was found) are not shown.
==4805== To see them, rerun with: --show-reachable=yes
--4805-- TT/TC: 0 tc sectors discarded.
--4805-- 134370 tt_fast misses.
--4805-- translate: new 73754 (1175842 -> 16009444; ratio 136:10)
--4805-- discard 357 (4549 -> 68272; ratio 150:10).
--4805-- chainings: 51485 chainings, 0 unchainings.
--4805-- dispatch: 82955017 jumps (bb entries); of them 13445970 (16%) unchained.
--4805-- 1660/307812 major/minor sched events.
--4805-- reg-alloc: 12170 t-req-spill, 2802297+85611 orig+spill uis,
--4805-- 374106 total-reg-rank
--4805-- sanity: 1661 cheap, 67 expensive checks.
--4805-- ccalls: 317465 C calls, 57% saves+restores avoided (1072060 bytes)
--4805-- 438661 args, avg 0.89 setup instrs each (91870 bytes)
--4805-- 0% clear the stack (951882 bytes)
--4805-- 106132 retvals, 32% of reg-reg movs avoided (66730 bytes)
Here is the sample's code, it's from the book Cross-Platform GUI Programming with wxWidgets:
Code: Select all
// Name: minimal.cpp
// Purpose: Minimal wxWidgets sample
// Author: Julian Smart
#include "wx/wx.h"
// Declare the application class
class MyApp : public wxApp
{
public:
// Called on application startup
virtual bool OnInit();
};
// Declare our main frame class
class MyFrame : public wxFrame
{
public:
// Constructor
MyFrame(const wxString& title);
// Event handlers
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
private:
// This class handles events
DECLARE_EVENT_TABLE()
};
// Implements MyApp& GetApp()
DECLARE_APP(MyApp)
// Give wxWidgets the means to create a MyApp object
IMPLEMENT_APP(MyApp)
// Initialize the application
bool MyApp::OnInit()
{
// Create the main application window
MyFrame *frame = new MyFrame(wxT("Minimal wxWidgets App"));
// Show it
frame->Show(true);
// Start the event loop
return true;
}
// Event table for MyFrame
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU(wxID_EXIT, MyFrame::OnQuit)
END_EVENT_TABLE()
void MyFrame::OnAbout(wxCommandEvent& event)
{
wxString msg;
msg.Printf(wxT("Hello and welcome to %s"),
wxVERSION_STRING);
wxMessageBox(msg, wxT("About Minimal"),
wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnQuit(wxCommandEvent& event)
{
// Destroy the frame
Close();
}
//#include "mondrian.xpm"
MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title)
{
// Set the frame icon
//SetIcon(wxIcon(mondrian_xpm));
// Create a menu bar
wxMenu *fileMenu = new wxMenu;
// The "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"),
wxT("Show about dialog"));
fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"),
wxT("Quit this program"));
// Now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// Create a status bar just for fun
CreateStatusBar(2);
SetStatusText(wxT("Welcome to wxWidgets!"));
}
Code: Select all
LEAK SUMMARY:
==5225== definitely lost: 112 bytes in 5 blocks.
==5225== indirectly lost: 200 bytes in 14 blocks.
==5225== possibly lost: 1791 bytes in 54 blocks.
==5225== still reachable: 1205628 bytes in 26252 blocks.
==5225== suppressed: 0 bytes in 0 blocks.
Is it sufficing, when I use for memory-leak-checks debug build of WX with these options:
--enable-debug --enable-mem_tracing ??
For "normal" memory leaks it works fine. Or do I have to use other tools, like valgrind etc.? I'm just confused by valgrind reports I wrote above...
Thx for help
soban
Debian Sarge /stable+testing/
wxGTK 2.6.2
gcc version 3.3.6 (Debian 1:3.3.6-10)