2

Have this problem that can't fix any way. I tried to install libc6-dbg and libc6-dbg:i386 and it didn't help.(I have 64 bit Ubuntu 19.10).

valgrind:  Fatal error at startup: a function redirection
    valgrind:  which is mandatory for this platform-tool combination
    valgrind:  cannot be set up.  Details of the redirection are:
    valgrind:  
    valgrind:  A must-be-redirected function
    valgrind:  whose name matches the pattern:      strlen
    valgrind:  in an object with soname matching:   ld-linux-x86-64.so.2
    valgrind:  was not found whilst processing
    valgrind:  symbols from the object with soname: ld-linux-x86-64.so.2
    valgrind:  
    valgrind:  Possible fixes: (1, short term): install glibc's debuginfo
    valgrind:  package on this machine.  (2, longer term): ask the packagers
    valgrind:  for your Linux distribution to please in future ship a non-
    valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)
    valgrind:  that exports the above-named function using the standard
    valgrind:  calling conventions for this platform.  The package you need
    valgrind:  to install for fix (1) is called
    valgrind:  
    valgrind:    On Debian, Ubuntu:                 libc6-dbg
    valgrind:    On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo
    valgrind:  
    valgrind:  Note that if you are debugging a 32 bit process on a
    valgrind:  64 bit system, you will need a corresponding 32 bit debuginfo
    valgrind:  package (e.g. libc6-dbg:i386).
    valgrind:  
    valgrind:  Cannot continue -- exiting now.  Sorry.

So, show you installed packages. As you see everything is correctly installed, but doesn' work. I don't know what to do more to make it work.

package for amd64

Package: libc6-dbg
Status: install ok installed
Priority: optional
Section: debug
Installed-Size: 44570
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: glibc
Version: 2.30-0ubuntu2
Provides: libc-dbg
Depends: libc6 (= 2.30-0ubuntu2)
Description: GNU C Library: detached debugging symbols
 This package contains the detached debugging symbols for the GNU C
 library.
Homepage: https://www.gnu.org/software/libc/libc.html
Original-Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>

package for i386

Package: libc6-dbg
Status: install ok installed
Priority: optional
Section: debug
Installed-Size: 35315
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: i386
Multi-Arch: same
Source: glibc
Version: 2.30-0ubuntu2
Provides: libc-dbg
Depends: libc6 (= 2.30-0ubuntu2)
Description: GNU C Library: detached debugging symbols
 This package contains the detached debugging symbols for the GNU C
 library.
Homepage: https://www.gnu.org/software/libc/libc.html
Original-Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Sparklll
  • 113
  • 2
  • 7
  • 1
    Along with @sam's comment, please let us know if you successfully installed `libc6-dbg` or not, and any output that might've been produced by the installation of this package. – S.S. Anne Feb 15 '20 at 22:46
  • The packages are called `libc6-dbg` and `libc6-dbg:i386`. I think you spelled them with `p` instead of `b`. – S.S. Anne Feb 15 '20 at 22:56
  • @S.S.Anne, i added needed information and edited the names – Sparklll Feb 15 '20 at 23:01
  • Thank your for the edits. That is weird. Did you install `valgrind` yourself or did you use the package? – S.S. Anne Feb 15 '20 at 23:01
  • @S.S.Anne firstly i installed by myself with package(tat.bz2 archive) from official site. Did it by steps and i don’t think I was wrong. Then i saw this message and installed libc6 for i386 and this still doesn't work. – Sparklll Feb 15 '20 at 23:05
  • 1
    Instead you should install Valgrind through your package manager: `sudo apt-get install valgrind`. – S.S. Anne Feb 15 '20 at 23:07
  • @S.S.Anne, and could you say please how to do this now ? How to fully delete this and reinstall right ? – Sparklll Feb 15 '20 at 23:14
  • 2
    You run `sudo make uninstall` from the directory that you built Valgrind in and then you run `sudo apt-get install valgrind`. – S.S. Anne Feb 16 '20 at 00:52
  • @S.S.Anne wow, thank you so much!!! This works now. So, I know that I'm already tired of my questions. But can you say why this way of installation right and why i had problems with (tar.bz2) installation ? – Sparklll Feb 16 '20 at 10:08
  • 1
    The distribution adds special paths to Valgrinds debug search path. – S.S. Anne Feb 16 '20 at 19:17
  • On Linux there are mandatory redirects for `strlen` and `index` in `ld.so`. What do you see when you run Valgrind with the --trace-symtab=yes option? – Paul Floyd Feb 16 '20 at 20:14
  • This problem has now been fixed in the git repository, as of commit db07db4c8706 – phd Mar 02 '20 at 22:44
  • Does this answer your question? [install valgrind, Fatal error at startup](https://stackoverflow.com/questions/15721919/install-valgrind-fatal-error-at-startup) – Henke Nov 16 '20 at 15:55

3 Answers3

0

I ran into the same problem with Ubuntu 20.04. As user phd has pointed out in their comment, this is a Valgrind bug that has been fixed in commit db07db4c8706d17124a621a254bee1b6f08d2e1d

You can build valgrind easily by running something like

git clone git://sourceware.org/git/valgrind.git
cd valgrind
./autogen.sh
./configure
make -j
sudo make install

(please don't run commands as sudo if you're not sure what they do)

Pavel
  • 7,436
  • 2
  • 29
  • 42
0

valgrind is looking for files in the wrong path.

Ubuntu has a mess in /usr/lib/debug. If you unify /usr/lib/debug/lib and /usr/lib/debug/usr/lib it should work.

At least, that fixed it for me.

LtWorf
  • 7,286
  • 6
  • 31
  • 45
0
apt install -y libc6-dbg

It worked for me. (Note: without :i386.)
Possible duplicate of install valgrind, Fatal error at startup.

Henke
  • 4,445
  • 3
  • 31
  • 44