This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6763] New: dlopen/dlclose causes memory leak in l_symbolic_searchlist.r_list
- From: "makoto dot kt at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 24 Jul 2008 08:25:10 -0000
- Subject: [Bug libc/6763] New: dlopen/dlclose causes memory leak in l_symbolic_searchlist.r_list
- Reply-to: sourceware-bugzilla at sourceware dot org
When I simply call dlopen and dlclose, I found leak. The following is valgrind log.
(This log is latest Fefora 9 on x86_64).
==30980== 8 bytes in 1 blocks are definitely lost in loss record 1 of 1
==30980== at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==30980== by 0x3DD5007CA1: _dl_map_object_from_fd (dl-load.c:1473)
==30980== by 0x3DD50083EA: _dl_map_object (dl-load.c:2248)
==30980== by 0x3DD500BB8C: openaux (dl-deps.c:65)
==30980== by 0x3DD500DB15: _dl_catch_error (dl-error.c:178)
==30980== by 0x3DD500C2F6: _dl_map_object_deps (dl-deps.c:248)
==30980== by 0x3DD5012387: dl_open_worker (dl-open.c:330)
==30980== by 0x3DD500DB15: _dl_catch_error (dl-error.c:178)
==30980== by 0x3DD5011CA5: _dl_open (dl-open.c:596)
==30980== by 0x3DD5C00F8A: dlopen_doit (dlopen.c:66)
==30980== by 0x3DD500DB15: _dl_catch_error (dl-error.c:178)
==30980== by 0x3DD5C012FB: _dlerror_run (dlerror.c:164)
- Test code
#include <stdio.h>
#include <dlfcn.h>
int main(){
void *p = 0;
do {
p = dlopen("/usr/lib64/libsnmp.so.15",RTLD_LAZY);
if (!p){
printf("cannot open so\n");
return -1;
}
dlclose(p);
} while(0);
return 0;
}
--
Summary: dlopen/dlclose causes memory leak in
l_symbolic_searchlist.r_list
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: makoto dot kt at gmail dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=6763
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.