public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12509] New: dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks memory
@ 2011-02-23 14:05 finkandreas at web dot de
  2011-02-26  1:54 ` [Bug libc/12509] " drepper.fsp at gmail dot com
  2014-06-27 13:50 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: finkandreas at web dot de @ 2011-02-23 14:05 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12509

           Summary: dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks
                    memory
           Product: glibc
           Version: 2.13
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: finkandreas@web.de


Created attachment 5254
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5254
Unittest (needs path to a library as argument)

calling dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks memory. It's not
much, but it contains at least the whole path to the lib (i.e. the longer the
path, the more memory is leaked).
The library must be existent on harddisk, but not loaded yet!

Attached is a unittest, which calls dlopen 100 times, to show, that the leak
accumulates (i.e. with every call more memory is leaked). The attached program
needs one commandline argument, the path to the library.

This is the output of valgrind after running the program:
==32730== Memcheck, a memory error detector
==32730== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==32730== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==32730== Command: ./test_memleak
/home/andreas/ITWM/alg/build/tools/ValueSmart/libvaluesmart.so
==32730== 
==32730== 
==32730== HEAP SUMMARY:
==32730==     in use at exit: 6,300 bytes in 100 blocks
==32730==   total heap usage: 100 allocs, 0 frees, 6,300 bytes allocated
==32730== 
==32730== 6,300 bytes in 100 blocks are definitely lost in loss record 1 of 1
==32730==    at 0x4C277CE: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==32730==    by 0x4004E71: local_strdup (dl-load.c:162)
==32730==    by 0x400762F: _dl_map_object (dl-load.c:2178)
==32730==    by 0x4011EE8: dl_open_worker (dl-open.c:226)
==32730==    by 0x400D8A5: _dl_catch_error (dl-error.c:178)
==32730==    by 0x4011929: _dl_open (dl-open.c:555)
==32730==    by 0x4E2EF75: dlopen_doit (dlopen.c:67)
==32730==    by 0x400D8A5: _dl_catch_error (dl-error.c:178)
==32730==    by 0x4E2F2FB: _dlerror_run (dlerror.c:164)
==32730==    by 0x4E2EEF0: dlopen@@GLIBC_2.2.5 (dlopen.c:88)
==32730==    by 0x400681: main (in /home/andreas/test_memleak)
==32730== 
==32730== LEAK SUMMARY:
==32730==    definitely lost: 6,300 bytes in 100 blocks
==32730==    indirectly lost: 0 bytes in 0 blocks
==32730==      possibly lost: 0 bytes in 0 blocks
==32730==    still reachable: 0 bytes in 0 blocks
==32730==         suppressed: 0 bytes in 0 blocks
==32730== 
==32730== For counts of detected and suppressed errors, rerun with: -v
==32730== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/12509] dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks memory
  2011-02-23 14:05 [Bug libc/12509] New: dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks memory finkandreas at web dot de
@ 2011-02-26  1:54 ` drepper.fsp at gmail dot com
  2014-06-27 13:50 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-02-26  1:54 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12509

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-02-26 01:54:31 UTC ---
I've checked in a patch which is an extension of the patch Andreas posted.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/12509] dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks memory
  2011-02-23 14:05 [Bug libc/12509] New: dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks memory finkandreas at web dot de
  2011-02-26  1:54 ` [Bug libc/12509] " drepper.fsp at gmail dot com
@ 2014-06-27 13:50 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 13:50 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12509

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-27 13:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23 14:05 [Bug libc/12509] New: dlopen(path_to_lib, RTLD_LOCAL|RTLD_NOLOAD) leaks memory finkandreas at web dot de
2011-02-26  1:54 ` [Bug libc/12509] " drepper.fsp at gmail dot com
2014-06-27 13:50 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).