This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/219] invalid __libc_dlclose() in nsswitch.c


------- Additional Comments From kimdon at esrf dot fr  2004-06-14 13:05 -------
This is a demonstration of the bug.


$ cat nssbug.c
#include <netdb.h>
int
main(int argc, char *argv[]) {
        struct protoent *protoent;
        protoent = getprotobyname("udp");
        return 0;
}
$ gcc nssbug.c -o nssbug
$ valgrind --num-callers=6 ./nssbug
==24898== Memcheck, a memory error detector for x86-linux.
==24898== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==24898== Using valgrind-2.1.0, a program supervision framework for x86-linux.
==24898== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==24898== Estimated CPU clock rate is 1390 MHz
==24898== For more details, rerun with: -v
==24898== 
==24898== Invalid read of size 1
==24898==    at 0x40315F6F: _dl_close (dl-close.c:51)
==24898==    by 0x40316B0A: do_dlclose (dl-libc.c:93)
==24898==    by 0x40009ACA: _dl_catch_error (in /lib/ld-2.2.5.so)
==24898==    by 0x40316A4F: dlerror_run (dl-libc.c:42)
==24898==    by 0x40316BB0: __libc_dlclose (dl-libc.c:121)
==24898==    by 0x402FBF0C: free_mem (nsswitch.c:749)
==24898==  Address 0x18F is not stack'd, malloc'd or free'd
==24898== 
==24898== Process terminating with default action of signal 11 (SIGSEGV):
dumping core
==24898==  Address not mapped to object at address 0x18F
==24898==    at 0x40315F6F: _dl_close (dl-close.c:51)
==24898==    by 0x40316B0A: do_dlclose (dl-libc.c:93)
==24898==    by 0x40009ACA: _dl_catch_error (in /lib/ld-2.2.5.so)
==24898==    by 0x40316A4F: dlerror_run (dl-libc.c:42)
==24898==    by 0x40316BB0: __libc_dlclose (dl-libc.c:121)
==24898==    by 0x402FBF0C: free_mem (nsswitch.c:749)
==24898== 
==24898== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==24898== malloc/free: in use at exit: 1732 bytes in 9 blocks.
==24898== malloc/free: 43 allocs, 34 frees, 3431 bytes allocated.
==24898== For a detailed leak analysis,  rerun with: --leak-check=yes
==24898== For counts of detected errors, rerun with: -v
Segmentation fault (core dumped)
$

-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=219

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]