|
From: Sergey V. <vs...@al...> - 2004-05-22 20:33:49
|
On Fri, 21 May 2004 12:52:33 -0400, Chuck Byam wrote: > Chuck Byam wrote: >> error while loading shared libraries: /usr/lib/valgrind/valgrind.so:=20 >> undefined symbol: __libc_accept (or __libc_connect) >=20 > While trying to research this I was pointed to the following link: >=20 > http://sources.redhat.com/ml/libc-hacker/2004-05/msg00001.html >=20 > Which indeed would explain the undefined symbol references. It's=20 > apparent that valgrind is making internal functions calls to libc. Is=20 > there any plan to move away from this practice? I have encountered the same problem with glibc CVS snapshots: http://bugs.kde.org/show_bug.cgi?id=3D82026 Does the patch there help you? |
|
From: David E. <tw...@us...> - 2004-06-03 08:24:36
|
On Sat, 2004-05-22 at 22:33, Sergey Vlasov wrote: > On Fri, 21 May 2004 12:52:33 -0400, Chuck Byam wrote: > > Chuck Byam wrote: > >> error while loading shared libraries: /usr/lib/valgrind/valgrind.so: > >> undefined symbol: __libc_accept (or __libc_connect) > > > > While trying to research this I was pointed to the following link: > > > > http://sources.redhat.com/ml/libc-hacker/2004-05/msg00001.html > > > > Which indeed would explain the undefined symbol references. It's > > apparent that valgrind is making internal functions calls to libc. Is > > there any plan to move away from this practice? > > I have encountered the same problem with glibc CVS snapshots: > > http://bugs.kde.org/show_bug.cgi?id=82026 > > Does the patch there help you? I had the same problem on Fedora Core 2 and I patched valgrind from CVS HEAD with your patch. My system: Linux zion.2good.net 2.6.6-1.374 #1 Wed May 19 12:44:14 EDT 2004 i686 i686 i386 GNU/Linux This is an "unstable" kernel (from the "rawhide" repository). My valgrind (today's CVS): valgrind-2.1.2.CVS Now valgrind always segfaults with a useless backtrace: $ gdb `which valgrind` GNU gdb Red Hat Linux (6.0post-0.20040223.19rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) r --tool=none /bin/ls Starting program: /usr/local/bin/valgrind --tool=none /bin/ls Program received signal SIGSEGV, Segmentation fault. Cannot remove breakpoints because program is no longer writable. It might be running in another process. Further execution is probably impossible. 0x00b69402 in ?? () (gdb) bt #0 0x00b69402 in ?? () #1 0xb00d27b6 in ?? () #2 0xb8022c7d in ?? () #3 0x00000000 in ?? () (gdb) If I play with LD_ASSUME_KERNEL the behavior varies a little: $ export LD_ASSUME_KERNEL= $ /usr/local/bin/valgrind -v --tool=none /bin/ls Segmentation fault (core dumped) $ /usr/local/bin/valgrind -v --tool=memcheck /bin/ls Segmentation fault (core dumped) $ export LD_ASSUME_KERNEL=2.4.1 $ /usr/local/bin/valgrind -v --tool=none /bin/ls ==6519== Nulgrind, a binary JIT-compiler for x86-linux. ==6519== Copyright (C) 2002-2004, and GNU GPL'd, by Nicholas Nethercote. ==6519== Using valgrind-2.1.2.CVS, a program supervision framework for x86-linux. ==6519== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward. ==6519== Valgrind library directory: /usr/local/lib/valgrind ==6519== Command line ==6519== /bin/ls ==6519== Startup, with flags: ==6519== -v ==6519== --tool=none ==6519== Contents of /proc/version: ==6519== Linux version 2.6.6-1.374 (bhc...@tw...) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #1 Wed May 19 12:44:14 EDT 2004 ==6519== Reading syms from /bin/ls (0x8048000) ==6519== object doesn't have a symbol table ==6519== object doesn't have any debug info ==6519== Reading syms from /lib/ld-2.3.3.so (0x81000000) ==6519== object doesn't have any debug info ==6519== Reading syms from /lib/ld-2.3.3.so (0xB0000000) ==6519== object doesn't have any debug info ==6519== Reading syms from /lib/libdl-2.3.3.so (0xB0017000) ==6519== object doesn't have any debug info ==6519== Reading syms from /lib/i686/libc-2.3.3.so (0xB001B000) ==6519== object doesn't have any debug info ==6519== Reading syms from /usr/local/lib/valgrind/vgskin_none.so (0xB0136000) ==6519== Reading syms from /usr/local/lib/valgrind/stage2 (0xB8000000) ==6519== REDIRECT soname:libc.so.6(__GI___errno_location) to soname:libpthread.so.0(__errno_location) ==6519== REDIRECT soname:libc.so.6(__errno_location) to soname:libpthread.so.0(__errno_location) ==6519== REDIRECT soname:libc.so.6(__GI___h_errno_location) to soname:libpthread.so.0(__h_errno_location) ==6519== REDIRECT soname:libc.so.6(__h_errno_location) to soname:libpthread.so.0(__h_errno_location) ==6519== REDIRECT soname:libc.so.6(__GI___res_state) to soname:libpthread.so.0(__res_state) ==6519== REDIRECT soname:libc.so.6(__res_state) to soname:libpthread.so.0(__res_state) ==6519== REDIRECT soname:libc.so.6(stpcpy) to *vgpreload_memcheck.so*(stpcpy) ==6519== REDIRECT soname:libc.so.6(strnlen) to *vgpreload_memcheck.so*(strnlen) ==6519== REDIRECT soname:ld-linux.so.2(stpcpy) to *vgpreload_memcheck.so*(stpcpy) ==6519== REDIRECT soname:ld-linux.so.2(strchr) to *vgpreload_memcheck.so*(strchr) ==6519== ==6519== Reading syms from /usr/local/lib/valgrind/vg_inject.so (0x81018000) Segmentation fault (core dumped) $ /usr/local/bin/valgrind -v --tool=memcheck /bin/ls ==6528== Memcheck, a memory error detector for x86-linux. ==6528== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward. ==6528== Using valgrind-2.1.2.CVS, a program supervision framework for x86-linux. ==6528== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward. ==6528== Valgrind library directory: /usr/local/lib/valgrind ==6528== Command line ==6528== /bin/ls ==6528== Startup, with flags: ==6528== -v ==6528== --tool=memcheck ==6528== Contents of /proc/version: ==6528== Linux version 2.6.6-1.374 (bhc...@tw...) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #1 Wed May 19 12:44:14 EDT 2004 ==6528== Reading syms from /bin/ls (0x8048000) ==6528== object doesn't have a symbol table ==6528== object doesn't have any debug info ==6528== Reading syms from /lib/ld-2.3.3.so (0x3C000000) ==6528== object doesn't have any debug info ==6528== Reading syms from /lib/ld-2.3.3.so (0xB0000000) ==6528== object doesn't have any debug info ==6528== Reading syms from /lib/libdl-2.3.3.so (0xB0017000) ==6528== object doesn't have any debug info ==6528== Reading syms from /lib/i686/libc-2.3.3.so (0xB001B000) ==6528== object doesn't have any debug info ==6528== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck.so (0xB0136000) ==6528== Reading syms from /usr/local/lib/valgrind/stage2 (0xB8000000) ==6528== Reading suppressions file: /usr/local/lib/valgrind/default.supp ==6528== REDIRECT soname:libc.so.6(__GI___errno_location) to soname:libpthread.so.0(__errno_location) ==6528== REDIRECT soname:libc.so.6(__errno_location) to soname:libpthread.so.0(__errno_location) ==6528== REDIRECT soname:libc.so.6(__GI___h_errno_location) to soname:libpthread.so.0(__h_errno_location) ==6528== REDIRECT soname:libc.so.6(__h_errno_location) to soname:libpthread.so.0(__h_errno_location) ==6528== REDIRECT soname:libc.so.6(__GI___res_state) to soname:libpthread.so.0(__res_state) ==6528== REDIRECT soname:libc.so.6(__res_state) to soname:libpthread.so.0(__res_state) ==6528== REDIRECT soname:libc.so.6(stpcpy) to *vgpreload_memcheck.so*(stpcpy) ==6528== REDIRECT soname:libc.so.6(strnlen) to *vgpreload_memcheck.so*(strnlen) ==6528== REDIRECT soname:ld-linux.so.2(stpcpy) to *vgpreload_memcheck.so*(stpcpy) ==6528== REDIRECT soname:ld-linux.so.2(strchr) to *vgpreload_memcheck.so*(strchr) ==6528== ==6528== Reading syms from /usr/local/lib/valgrind/vg_inject.so (0x3C018000) ==6528== Reading syms from /usr/local/lib/valgrind/vgpreload_memcheck.so (0x3C01D000) ==6528== TRANSLATE: 0x3C011400 redirected to 0x3C01FE5C Segmentation fault (core dumped) None of the valgrind binaries are prelinked. $ ldd /usr/local/lib/valgrind/vg_inject.so linux-gate.so.1 => (0x00dce000) libc.so.6 => /lib/tls/libc.so.6 (0x009c7000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x0054a000) $ ldd /usr/local/lib/valgrind/vgpreload_memcheck.so linux-gate.so.1 => (0x00af7000) libc.so.6 => /lib/tls/libc.so.6 (0x0041f000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x0054a00 If I set LD_DEBUG=all in the environment and run valgrind the last lines of output are: For tool=none: 6611: symbol=vgPlain_vg_malloc_redzone_szB; lookup in file=/lib/tls/libc.so.6 6611: symbol=vgPlain_vg_malloc_redzone_szB; lookup in file=/lib/ld-linux.so.2 Segmentation fault (core dumped) For tool=memcheck: 6610: symbol=munmap; lookup in file=/lib/libdl.so.2 6610: symbol=munmap; lookup in file=/lib/tls/libc.so.6 6610: binding file /usr/local/bin/valgrind to /lib/tls/libc.so.6: normal symbol `munmap' [GLIBC_2.0] Segmentation fault (core dumped) Any ideas on how I should proceed in order to find out what's wrong? -- Regards, -\- David Eriksson -/- SynCE - http://synce.sourceforge.net CalcEm - http://calcem.sourceforge.net ScummVM - http://scummvm.sourceforge.net Desquirr - http://desquirr.sourceforge.net SetiWrapper - http://setiwrapper.sourceforge.net |