Public bug reported: Simple testcase in Ubuntu 7.04:
1. create main.cc: #include <dlfcn.h> int main(int argc, char *argv[]) { dlopen("libm.so",RTLD_LAZY|RTLD_GLOBAL); } 2. compile main.cc: "gcc -ldl main.cc" 3. run valgrind on resulting a.out: "valgrind --tool=memcheck ./a.out" This results for me in the following error reported by valgrind: ==14247== Invalid read of size 4 ==14247== at 0x4014743: (within /lib/ld-2.5.so) ==14247== by 0x4005B69: (within /lib/ld-2.5.so) ==14247== by 0x4007995: (within /lib/ld-2.5.so) ==14247== by 0x4010D94: (within /lib/ld-2.5.so) ==14247== by 0x400CFA5: (within /lib/ld-2.5.so) ==14247== by 0x40108ED: (within /lib/ld-2.5.so) ==14247== by 0x403EC2C: (within /lib/tls/i686/cmov/libdl-2.5.so) ==14247== by 0x400CFA5: (within /lib/ld-2.5.so) ==14247== by 0x403F2AB: (within /lib/tls/i686/cmov/libdl-2.5.so) ==14247== by 0x403EB63: dlopen (in /lib/tls/i686/cmov/libdl-2.5.so) ==14247== by 0x80483F8: main (in /home/frank/test/dlopen/a.out) ==14247== Address 0x4185038 is 16 bytes inside a block of size 17 alloc'd ==14247== at 0x4021620: malloc (vg_replace_malloc.c:149) ==14247== by 0x4007F33: (within /lib/ld-2.5.so) ==14247== by 0x4010D94: (within /lib/ld-2.5.so) ==14247== by 0x400CFA5: (within /lib/ld-2.5.so) ==14247== by 0x40108ED: (within /lib/ld-2.5.so) ==14247== by 0x403EC2C: (within /lib/tls/i686/cmov/libdl-2.5.so) ==14247== by 0x400CFA5: (within /lib/ld-2.5.so) ==14247== by 0x403F2AB: (within /lib/tls/i686/cmov/libdl-2.5.so) ==14247== by 0x403EB63: dlopen (in /lib/tls/i686/cmov/libdl-2.5.so) ==14247== by 0x80483F8: main (in /home/frank/test/dlopen/a.out) I have seen the same in Ubuntu 6.06 with a more complex program, but not in this simple test case. Debian 4.0 doesn't show this problem, neither do many other distributions I have tested (e.g. Scientific Linux 4). To check whether this is a valgrind problem, I compiled version 3.2.3, and there the same problem is reported. If this is still a valgrind problem, please reassign this bug report. ** Affects: glibc (Ubuntu) Importance: Undecided Status: Unconfirmed -- valgrind finds "Invalid read of size 4" in dlopen https://bugs.launchpad.net/bugs/114032 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs