[GtkGLExt] 20 byte memory leak



Hi guys. I've found a seemingly gdkglext -related 20 byte memory leak:

(linking with gdkglext)
$ echo "int main() {}" > g.c && gcc g.c -lgdkglext-x11-1.0 -og &&
valgrind --leak-check=full --show-reachable=yes ./g
==10164== Memcheck, a memory error detector
==10164== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==10164== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h
for copyright info
==10164== Command: ./g
==10164==
==10164==
==10164== HEAP SUMMARY:
==10164==     in use at exit: 20 bytes in 1 blocks
==10164==   total heap usage: 30 allocs, 29 frees, 101,985 bytes allocated
==10164==
==10164== 20 bytes in 1 blocks are still reachable in loss record 1 of 1
==10164==    at 0x402328F: calloc (vg_replace_malloc.c:467)
==10164==    by 0x5F5D105: _dlerror_run (dlerror.c:142)
==10164==    by 0x5F5CB40: dlopen@@GLIBC_2.1 (dlopen.c:88)
==10164==    by 0x4277C08: ??? (in /usr/lib/libGL.so.195.36.24)
==10164==
==10164== LEAK SUMMARY:
==10164==    definitely lost: 0 bytes in 0 blocks
==10164==    indirectly lost: 0 bytes in 0 blocks
==10164==      possibly lost: 0 bytes in 0 blocks
==10164==    still reachable: 20 bytes in 1 blocks
==10164==         suppressed: 0 bytes in 0 blocks
==10164==
==10164== For counts of detected and suppressed errors, rerun with: -v
==10164== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 121 from 10)
$


In contrast to:

(linking with -lGL only)
$ echo "int main() {}" > g.c && gcc g.c -lGL -og && valgrind
--leak-check=full --show-reachable=yes ./g
==10184== Memcheck, a memory error detector
==10184== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==10184== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h
for copyright info
==10184== Command: ./g
==10184==
==10184==
==10184== HEAP SUMMARY:
==10184==     in use at exit: 0 bytes in 0 blocks
==10184==   total heap usage: 28 allocs, 28 frees, 101,534 bytes allocated
==10184==
==10184== All heap blocks were freed -- no leaks are possible
==10184==
==10184== For counts of detected and suppressed errors, rerun with: -v
==10184== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 37 from 10)
$

Call me anal, but i'd like to reduce memory leaks to zero in my
application. Is there a way of removing this 20 byte leak? I realize
it's a one-time alloc, so whatever my application does, it's still
just 20 bytes. Still, maybe it's something that just went un-noticed.
My guess is -- the gdkglext dso does some allocation at startup and
forgets to remove it at shutdown. So the fix would be either in the
gdkglext dso, or in my program somehow. If it's in my program, how do
i do it? i called no init functions in this example so i figure there
should be no deinit either. But i can call it explicitly if it's the
*right* thing to do.


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