Re: [Valgrind-users] debugging gtk-related memory leaks



I tried it with the debug info packages and malloc, and now there are only a few X/gtk errors. Anyone have suggestions on how to approach those? Maybe someone on the gtk-app-devel-list?

Thanks,

David


Julian Seward wrote:

Maybe you should set G_SLICE=always-malloc in the environment in order
to make valgrind more useful:

 http://developer.gnome.org/doc/API/2.0/glib/glib-running.html

I agree; from a guess I'd say that glib is using a private allocator, which confuses the issue.

Unrelatedly ..

It looks like the 'valgrind-3.1.1-Debian' you are using has been
shipped without a set of suppressions suitable for getting rid of
all the complaints of the form

==3722== Conditional jump or move depends on uninitialised value(s)
==3722==    at 0x401139F: (within /lib/ld-2.3.6.so)
==3722==    by 0x4006ACE: (within /lib/ld-2.3.6.so)
==3722==    by 0x48A14AF: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==3722==    by 0x400BA5E: (within /lib/ld-2.3.6.so)

which is a shame.  It may be that if you install debug info packages
for /lib/ld-2.3.6.so and/or libc-2.3.6.so, that noise will go away.

J
==25785== Memcheck, a memory error detector.
==25785== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==25785== Using LibVEX rev 1575, a library for dynamic binary translation.
==25785== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==25785== Using valgrind-3.1.1-Debian, a dynamic binary instrumentation framework.
==25785== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==25785== For more details, rerun with: -v
==25785== 
==25785== Syscall param write(buf) points to uninitialised byte(s)
==25785==    at 0x4836783: __write_nocancel (in /lib/tls/i686/cmov/libpthread-2.3.6.so)
==25785==    by 0x4D16E3E: _X11TransWrite (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D1BB54: (within /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D1BC7C: _XReply (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D01862: XInternAtom (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D160EA: XSetWMProperties (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B90C59: (within /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B93B25: gdk_window_new (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B71F9B: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B510DE: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x497378E: gtk_init_check (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x49737C3: gtk_init (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==  Address 0x5210FD0 is 128 bytes inside a block of size 16,384 alloc'd
==25785==    at 0x480788E: calloc (vg_replace_malloc.c:279)
==25785==    by 0x4D06B83: XOpenDisplay (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B71EC1: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B510DE: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x497378E: gtk_init_check (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x49737C3: gtk_init (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x8059238: main_gui(int, char**) (gui.C:108)
==25785==    by 0x804F6B1: main (time.C:83)
==25785== 
==25785== Syscall param write(buf) points to uninitialised byte(s)
==25785==    at 0x48367AB: (within /lib/tls/i686/cmov/libpthread-2.3.6.so)
==25785==    by 0x4D16E3E: _X11TransWrite (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D1BB54: (within /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D1CEAB: _XEventsQueued (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D08792: XPending (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B7E9CD: _gdk_events_queue (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B7EBCE: (within /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4E0F690: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.1000.2)
==25785==    by 0x4E129D6: (within /usr/lib/libglib-2.0.so.0.1000.2)
==25785==    by 0x4E12F27: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.1000.2)
==25785==    by 0x4974340: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x80595D3: main_gui(int, char**) (gui.C:157)
==25785==  Address 0x52110F4 is 420 bytes inside a block of size 16,384 alloc'd
==25785==    at 0x480788E: calloc (vg_replace_malloc.c:279)
==25785==    by 0x4D06B83: XOpenDisplay (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B71EC1: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B510DE: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x497378E: gtk_init_check (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x49737C3: gtk_init (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x8059238: main_gui(int, char**) (gui.C:108)
==25785==    by 0x804F6B1: main (time.C:83)
join engine...
==25785== 
==25785== Syscall param write(buf) points to uninitialised byte(s)
==25785==    at 0x48367AB: (within /lib/tls/i686/cmov/libpthread-2.3.6.so)
==25785==    by 0x4D16E3E: _X11TransWrite (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D1BB54: (within /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4CF7E50: XFlush (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B72B9A: gdk_display_flush (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B6BEF9: gdk_window_process_all_updates (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4A7A844: (within /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x4DBD11A: g_cclosure_marshal_VOID__VOID (in /usr/lib/libgobject-2.0.so.0.1000.2)
==25785==    by 0x4DB03B7: (within /usr/lib/libgobject-2.0.so.0.1000.2)
==25785==    by 0x4DB0A5A: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.1000.2)
==25785==    by 0x4DC0951: (within /usr/lib/libgobject-2.0.so.0.1000.2)
==25785==    by 0x4DC1B26: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.1000.2)
==25785==  Address 0x5210F6C is 28 bytes inside a block of size 16,384 alloc'd
==25785==    at 0x480788E: calloc (vg_replace_malloc.c:279)
==25785==    by 0x4D06B83: XOpenDisplay (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B71EC1: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B510DE: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x497378E: gtk_init_check (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x49737C3: gtk_init (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x8059238: main_gui(int, char**) (gui.C:108)
==25785==    by 0x804F6B1: main (time.C:83)
Kill dataflow
messaged
kill dataflow
dataflow dead
==25785== 
==25785== Syscall param write(buf) points to uninitialised byte(s)
==25785==    at 0x48367AB: (within /lib/tls/i686/cmov/libpthread-2.3.6.so)
==25785==    by 0x4D16E3E: _X11TransWrite (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D1BB54: (within /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D1BC7C: _XReply (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4D13274: XSync (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B7EFA2: gdk_flush (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4974353: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x80595D3: main_gui(int, char**) (gui.C:157)
==25785==    by 0x804F6B1: main (time.C:83)
==25785==  Address 0x5210F81 is 49 bytes inside a block of size 16,384 alloc'd
==25785==    at 0x480788E: calloc (vg_replace_malloc.c:279)
==25785==    by 0x4D06B83: XOpenDisplay (in /usr/lib/libX11.so.6.2.0)
==25785==    by 0x4B71EC1: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x4B510DE: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.800.17)
==25785==    by 0x497378E: gtk_init_check (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x49737C3: gtk_init (in /usr/lib/libgtk-x11-2.0.so.0.800.17)
==25785==    by 0x8059238: main_gui(int, char**) (gui.C:108)
==25785==    by 0x804F6B1: main (time.C:83)
starting gui...
starting main thread...
data engine thread
queue unready...
starting main
==25785== 
==25785== ERROR SUMMARY: 1445 errors from 4 contexts (suppressed: 90 from 2)
==25785== malloc/free: in use at exit: 1,216,841 bytes in 13,316 blocks.
==25785== malloc/free: 728,836 allocs, 715,520 frees, 74,022,463 bytes allocated.
==25785== For counts of detected errors, rerun with: -v
==25785== searching for pointers to 13,316 not-freed blocks.
==25785== checked 18,325,576 bytes.
==25785== 
==25785== LEAK SUMMARY:
==25785==    definitely lost: 0 bytes in 0 blocks.
==25785==      possibly lost: 1,269 bytes in 38 blocks.
==25785==    still reachable: 1,215,572 bytes in 13,278 blocks.
==25785==         suppressed: 0 bytes in 0 blocks.
==25785== Reachable blocks (those to which a pointer was found) are not shown.
==25785== To see them, rerun with: --show-reachable=yes


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