Re: GLib/GModule Memory Leak? [now also GThread]

2006-04-25 Thread Nathaniel McCallum
I reran after implementing my app using GThreads and still got the
attached results after using: env G_DEBUG=gc-friendly
G_SLICE=always-malloc valgrind --leak-check=full --show-reachable=yes.
Notice also that there may be a small leak with g_thread_create().  Of
course this could also be how I'm using it.  However, my usage is fairly
simple: I just create one thread to do a download, I process some stuff
in the foreground and then do a join() when I need the content from the
download.  Anyway, thanks for the help so far.

Nathaniel

On Sun, 16 Apr 2006, Kalle Vahlman wrote:
On 4/15/06, Nathaniel McCallum npmccallum gentoo org wrote:
 I hope this is the right list to ask this on.  I ran valgrind on an
 application I'm developing with glib using gmodule.  Results attached.

I'm under the impression that valgrind and the new slice allocator
code do not really mix. There is a way to turn it to mallocs for
memory debugging, see

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

and G_SLICE for details.

 Am I just worried about something that's not a big deal or is this a bug
 I should file?

Most likely no, but if you rerun with the always-malloc you should know better.
==24649== Memcheck, a memory error detector.
==24649== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==24649== Using LibVEX rev 1471, a library for dynamic binary translation.
==24649== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==24649== Using valgrind-3.1.0, a dynamic binary instrumentation framework.
==24649== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==24649== For more details, rerun with: -v
==24649== 
==24649== 
==24649== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 101 from 1)
==24649== malloc/free: in use at exit: 26,289 bytes in 321 blocks.
==24649== malloc/free: 62,943 allocs, 62,622 frees, 2,704,716 bytes allocated.
==24649== For counts of detected errors, rerun with: -v
==24649== searching for pointers to 321 not-freed blocks.
==24649== checked 10,952,536 bytes.
==24649== 
==24649== 8 bytes in 2 blocks are still reachable in loss record 1 of 17
==24649==at 0x40051F9: malloc (vg_replace_malloc.c:149)
==24649==by 0xBE6CD2: _dl_map_object_from_fd (in /lib/ld-2.4.so)
==24649==by 0xBE8118: _dl_map_object (in /lib/ld-2.4.so)
==24649==by 0xBEBCA5: openaux (in /lib/ld-2.4.so)
==24649==by 0xBED6C8: _dl_catch_error (in /lib/ld-2.4.so)
==24649==by 0xBEC245: _dl_map_object_deps (in /lib/ld-2.4.so)
==24649==by 0xBF1172: dl_open_worker (in /lib/ld-2.4.so)
==24649==by 0xBED6C8: _dl_catch_error (in /lib/ld-2.4.so)
==24649==by 0xBF0C19: _dl_open (in /lib/ld-2.4.so)
==24649==by 0xD59E03: dlopen_doit (in /lib/libdl-2.4.so)
==24649==by 0xBED6C8: _dl_catch_error (in /lib/ld-2.4.so)
==24649==by 0xD5A3FF: _dlerror_run (in /lib/libdl-2.4.so)
==24649== 
==24649== 
==24649== 20 bytes in 1 blocks are still reachable in loss record 2 of 17
==24649==at 0x40045EB: calloc (vg_replace_malloc.c:279)
==24649==by 0xD5A45D: _dlerror_run (in /lib/libdl-2.4.so)
==24649==by 0xD59D48: dlopen@@GLIBC_2.1 (in /lib/libdl-2.4.so)
==24649==by 0xDD5558: g_module_open (in /usr/lib/libgmodule-2.0.so.0.1000.2)
==24649==by 0x8049BFE: main (noweb.c:49)
==24649== 
==24649== 
==24649== 32 bytes in 1 blocks are still reachable in loss record 3 of 17
==24649==at 0x40052ED: realloc (vg_replace_malloc.c:306)
==24649==by 0x99D5FA: g_realloc (in /usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x97E220: (within /usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x97E5A3: g_array_set_size (in /usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x9B43CC: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x9BA4ED: g_get_charset (in /usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x981307: g_get_filename_charsets (in 
/usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x981530: (within /usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x9B44C4: g_thread_init_glib (in 
/usr/lib/libglib-2.0.so.0.1000.2)
==24649==by 0x3F618D: g_thread_init (in /usr/lib/libgthread-2.0.so.0.1000.2)
==24649==by 0x8049B5F: main (noweb.c:37)
==24649== 
==24649== 
==24649== 79 bytes in 1 blocks are still reachable in loss record 4 of 17
==24649==at 0x40052ED: realloc (vg_replace_malloc.c:306)
==24649==by 0xC58ADE: vasprintf (in /lib/libc-2.4.so)
==24649==by 0xC4035D: asprintf (in /lib/libc-2.4.so)
==24649==by 0xD5A24C: dlerror (in /lib/libdl-2.4.so)
==24649==by 0xDD4FFE: (within /usr/lib/libgmodule-2.0.so.0.1000.2)
==24649==by 0xDD51ED: g_module_symbol (in 
/usr/lib/libgmodule-2.0.so.0.1000.2)
==24649==by 0xDD5665: g_module_open (in /usr/lib/libgmodule-2.0.so.0.1000.2)
==24649==by 0x8049BFE: main (noweb.c:49)
==24649== 
==24649== 
==24649== 96 bytes in 3 blocks are still reachable in loss record 5 of 17
==24649==at 0x40051F9: malloc (vg_replace_malloc.c:149)
==24649==by 0xBF156A: dl_open_worker 

Re: GLib/GModule Memory Leak?

2006-04-16 Thread Kalle Vahlman
On 4/15/06, Nathaniel McCallum [EMAIL PROTECTED] wrote:
 I hope this is the right list to ask this on.  I ran valgrind on an
 application I'm developing with glib using gmodule.  Results attached.

I'm under the impression that valgrind and the new slice allocator
code do not really mix. There is a way to turn it to mallocs for
memory debugging, see

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

and G_SLICE for details.

 Am I just worried about something that's not a big deal or is this a bug
 I should file?

Most likely no, but if you rerun with the always-malloc you should know better.

--
Kalle Vahlman, [EMAIL PROTECTED]
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


GLib/GModule Memory Leak?

2006-04-15 Thread Nathaniel McCallum
I hope this is the right list to ask this on.  I ran valgrind on an
application I'm developing with glib using gmodule.  Results attached.
Am I just worried about something that's not a big deal or is this a bug
I should file?

Thanks,
Nathaniel
==26126== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 45 from 1)
==26126== malloc/free: in use at exit: 1,896,158 bytes in 5,100 blocks.
==26126== malloc/free: 875,754 allocs, 870,654 frees, 23,190,938 bytes 
allocated.
==26126== For counts of detected errors, rerun with: -v
==26126== searching for pointers to 5,100 not-freed blocks.
==26126== checked 1,820,892 bytes.
==26126==
==26126== 20 bytes in 1 blocks are still reachable in loss record 1 of 6
==26126==at 0x40045EB: calloc (vg_replace_malloc.c:279)
==26126==by 0xD5A45D: _dlerror_run (in /lib/libdl-2.4.so)
==26126==by 0xD59D48: dlopen@@GLIBC_2.1 (in /lib/libdl-2.4.so)
==26126==by 0xDD5568: g_module_open (in /usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80499A1: nw_plugin_load (plugin.c:107)
==26126==by 0x8049A65: nw_plugin_load (plugin.c:135)
==26126==by 0x80495D0: main (noweb.c:29)
==26126==
==26126==
==26126== 30 bytes in 2 blocks are still reachable in loss record 2 of 6
==26126==at 0x40051F9: malloc (vg_replace_malloc.c:149)
==26126==by 0x99D665: g_malloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B0538: g_strdup (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9BA341: g_get_charset (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x99F2CC: g_printerr (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x40117B3: ???
==26126==by 0x80494F3: log_request_factory (logger.c:13)
==26126==by 0x804973E: main (noweb.c:65)
==26126==
==26126==
==26126== 144 bytes in 3 blocks are still reachable in loss record 3 of 6
==26126==at 0x40051F9: malloc (vg_replace_malloc.c:149)
==26126==by 0x4005271: realloc (vg_replace_malloc.c:306)
==26126==by 0x99D52A: g_realloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E220: (within /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E5A3: g_array_set_size (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B429C: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126==
==26126== 2,776 bytes in 5 blocks are possibly lost in loss record 4 of 6
==26126==at 0x40044B3: memalign (vg_replace_malloc.c:332)
==26126==by 0x4004509: posix_memalign (vg_replace_malloc.c:384)
==26126==by 0x9AC3A8: (within /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9AD65B: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E688: g_array_sized_new (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E796: g_array_new (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B42C2: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126==
==26126== 3,612 bytes in 6 blocks are still reachable in loss record 5 of 6
==26126==at 0x40045EB: calloc (vg_replace_malloc.c:279)
==26126==by 0x99D5CD: g_malloc0 (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B339B: g_thread_self (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B413E: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126==
==26126== 1,889,576 bytes in 5,083 blocks are still reachable in loss record 6 
of 6
==26126==at 0x40044B3: memalign (vg_replace_malloc.c:332)
==26126==by 0x4004509: posix_memalign (vg_replace_malloc.c:384)
==26126==by 0x9AC3A8: (within /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9AD637: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E688: g_array_sized_new (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E796: g_array_new (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B42C2: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126== LEAK SUMMARY:
==26126==definitely lost: 0 bytes in 0 blocks.
==26126==  possibly lost: 2,776 bytes in 5 blocks.
==26126==still reachable: 1,893,382 bytes in 5,095 blocks.
==26126== suppressed: 0 bytes in 0 blocks.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org