Bug 495761

Summary: Valgrind can't find symbols like strlen
Product: [Developer tools] valgrind Reporter: KillerWasp <rmbeer2>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED NOT A BUG    
Severity: critical CC: mark, tom
Priority: NOR    
Version First Reported In: 3.24 GIT   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 495786    

Description KillerWasp 2024-11-03 20:02:35 UTC
This's the output of valgrind:

***
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.so.2
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld-linux.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.
***

The system used is Archlinux 32 bits.

Have the same result with Valgrind of the system and compiled from the source code. I'm use the source code of 3.24 with this line:

```
LD_LIBRARY_PATH=/opt/MV1/usr/lib/valgrind/lib/ /opt/MV1/usr/bin/valgrind
```

This error are persisted by years and appear from the 3.23 of valgrind.
Comment 1 KillerWasp 2024-11-03 20:05:04 UTC
Persisted from 3.19* of valgrind
Comment 2 Tom Hughes 2024-11-03 21:34:59 UTC
This is an issue with your system, not with valgrind, as explained in the very detailed error message.

You either need to install the debug symbols for glibc or you need to persuade your distribution to be less aggressive about stripping symbols from the dynamic linker - they are needed for valgrind and there is nothing we can do to avoid needing them.
Comment 3 KillerWasp 2024-11-04 11:40:51 UTC
IT'S A BUG!!!! NOT RESOLVED!!!

my libraries already have debug info, even i compile it and use the new libraries with LD_LIBRARY_PATH=, and also export debug info and use ----extra-debuginfo-path=

NEVER WORK!!
Comment 4 KillerWasp 2024-11-04 11:50:22 UTC
complete line:

LD_LIBRARY_PATH=/opt/MV1/usr/lib/valgrind/lib:/opt/MV1/usr/lib /opt/MV1/usr/bin/valgrind --extra-debuginfo-path=/opt/MV1/usr/lib/f/libc.dbg ./myapp
Comment 5 Mark Wielaard 2024-11-04 12:47:15 UTC
Please discuss with your distro. It is stripping ld.so which is incompatible with running valgrind on your applications.
See also https://sourceware.org/cgit/valgrind/tree/README_PACKAGERS
Comment 6 Mark Wielaard 2024-11-04 12:48:12 UTC
*** Bug 495786 has been marked as a duplicate of this bug. ***
Comment 7 KillerWasp 2024-11-04 17:24:04 UTC
Helloooo??? I'm not ask by the distro! I'm ask by the valgrind!

Why instead of mess with the distro that has nothing to do with it, don't you tell me how to make valgrind support debugging information for strlen and everything else?

AND STOP CLOSE THE THREAD!! All here are trolls???
Comment 8 Mark Wielaard 2024-11-04 17:29:12 UTC
(In reply to KillerWasp from comment #7)
> Helloooo??? I'm not ask by the distro! I'm ask by the valgrind!
> 
> Why instead of mess with the distro that has nothing to do with it, don't
> you tell me how to make valgrind support debugging information for strlen
> and everything else?

The problem is with your distro. When ld.so is stripped valgrind cannot work.
Please read the error message given and the README_PACKAGERS file that explains this limitation.