You are not logged in.

#1 2022-05-15 10:20:48

Fuchczyk
Member
Registered: 2022-05-15
Posts: 1

Valgrind problem after glibc update

Hi,
since last glibc update I can't use my valgrind, it just displays that message shown below:

==21276== Memcheck, a memory error detector
==21276== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==21276== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==21276== Command: ls
==21276== 

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.

I looked at the commits in glibc's PKGINFO repo and in "enable debug pkg" commit i saw description "Valgrind is able to get the glibc symbols from debuginfod since 3.17.0". I have installed that debuginfod package, reinstalled valgrind and I tried build valgrind from source, but it all results in error shown above.

Offline

#2 2022-05-15 13:08:27

MrJake
Member
Registered: 2019-06-26
Posts: 5

Re: Valgrind problem after glibc update

Same here, using:
valgrind-3.19.0-2
debuginfod-0.187-1

Offline

#3 2022-05-15 15:27:35

Horus
Member
Registered: 2021-10-02
Posts: 5

Re: Valgrind problem after glibc update

Hello. I was facing the same problems. I solved it by manually setting the environment variable:

export DEBUGINFOD_URLS="https://debuginfod.archlinux.org"

According to the wiki, debuginfod should automatically set up that env var on login. Maybe try restarting your computer and see if it works?

If it doesn't, you can always but the export above in your .profile file.

Last edited by Horus (2022-05-15 15:28:29)

Offline

#4 2022-05-16 14:27:44

Only
Member
Registered: 2022-05-16
Posts: 2

Re: Valgrind problem after glibc update

Same here sad

Offline

#5 2022-05-16 14:32:24

Only
Member
Registered: 2022-05-16
Posts: 2

Re: Valgrind problem after glibc update

Horus wrote:

Hello. I was facing the same problems. I solved it by manually setting the environment variable:

export DEBUGINFOD_URLS="https://debuginfod.archlinux.org"

According to the wiki, debuginfod should automatically set up that env var on login. Maybe try restarting your computer and see if it works?

If it doesn't, you can always but the export above in your .profile file.

After reboot and mirror update it worked, thank you

Offline

#6 2022-05-24 08:44:06

sandstorm
Member
From: Zurich [CH] & Mannheim [DE]
Registered: 2005-08-13
Posts: 171

Re: Valgrind problem after glibc update

I ran into the same issue. It is really hard to find information on the web about this. Would you mind to add it to https://wiki.archlinux.org/title/Debugging#Valgrind or is it okay for you if I add it?

Offline

#7 2022-05-26 02:34:44

shenlebantongying
Member
Registered: 2021-05-26
Posts: 5
Website

Re: Valgrind problem after glibc update

The

/etc/profile.d/debuginfod.sh

read the variable in 

/etc/debuginfod/archlinux.urls

and export it. Thus, it is supposed to work out of box.

I think the reason that I encounter this problem is that I changed the default shell to fish (via chsh).

Do you guys also do something similar?

Last edited by shenlebantongying (2022-05-26 02:36:11)

Offline

#8 2022-05-26 09:10:47

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,189

Re: Valgrind problem after glibc update

Changing your login shell to fish rather than just setting something up that starts fish for an interactive session from your login shell comes with a lot of gotchas and stipulations: https://wiki.archlinux.org/title/Fish#S … ault_shell

Offline

#9 2022-05-26 12:13:23

shenlebantongying
Member
Registered: 2021-05-26
Posts: 5
Website

Re: Valgrind problem after glibc update

Yeah, but I don't think programs should expect too much from the default shell, so I deliberately use fish to know what special behavior of sh or bash are expected by some programs.

This is the first bug I met for half a year of default fishing.

Offline

#10 2022-05-28 05:02:01

yan12125
Member
Registered: 2017-11-01
Posts: 36

Re: Valgrind problem after glibc update

sandstorm wrote:

I ran into the same issue. It is really hard to find information on the web about this. Would you mind to add it to https://wiki.archlinux.org/title/Debugging#Valgrind or is it okay for you if I add it?

Everyone is welcome for wiki editing! If you're not sure about what to add, sone notes on the discussion page https://wiki.archlinux.org/title/Talk:Debugging is a good start.

Offline

#11 2022-06-08 04:16:57

Strokes
Member
Registered: 2022-06-08
Posts: 1

Re: Valgrind problem after glibc update

I'm having the same issue, couldn't get it to work

Offline

#12 2022-06-10 20:22:10

andrej.podzimek
Member
From: Zürich, Switzerland
Registered: 2005-04-10
Posts: 115

Re: Valgrind problem after glibc update

This doesn’t work and debuginfod has absolutely nothing to do with it. The daemon can be used to fetch (in oversimplified terms) line number information for valgrind to report (e.g.) where exactly a used-after-free block was (de)allocated. But it has precisely nothing in common with this strlen() problem, because this is unrelated to debugging information.

Offline

#13 2022-06-11 16:29:43

raldone01
Member
Registered: 2021-11-12
Posts: 5

Re: Valgrind problem after glibc update

I had the same issue in arch WSL2. I use fish as my default shell. I added `set -x DEBUGINFOD_URLS "https://debuginfod.archlinux.org"` to my `.config/fish/config.fish` and now valgrind is working again.

Offline

#14 2022-07-29 13:40:41

aleksander0m
Member
Registered: 2015-10-19
Posts: 3

Re: Valgrind problem after glibc update

If you're running valgrind on a program under sudo, you may need to explicitly give the DEBUGINFOD_URLS envvar in the command itself, e.g.:

$ sudo DEBUGINFOD_URLS="https://debuginfod.archlinux.org" G_SLICE=always-malloc valgrind --leak-check=full /usr/sbin/ModemManager --debug

Offline

#15 2022-08-13 05:30:04

jackos
Member
Registered: 2021-09-16
Posts: 4

Re: Valgrind problem after glibc update

Thanks @raldone01 that fixed it for me in fish shell

Offline

#16 2022-08-14 16:19:54

vonNeumannStability
Member
Registered: 2020-12-22
Posts: 15

Re: Valgrind problem after glibc update

Exporting this environment variable didn't work for me either. For additional info, after running

 pacman -Qi debuginfod 

I get:

Name            : debuginfod
Version         : 0.187-2
Description     : Handle ELF object files and DWARF debugging information (debuginfod)
Architecture    : x86_64
URL             : https://sourceware.org/elfutils/
Licenses        : LGPL3  GPL3
Groups          : None
Provides        : None
Depends On      : gcc-libs  glibc  libarchive.so=13-64  libelf=0.187  libmicrohttpd.so=12-64  sqlite
Optional Deps   : elfutils=0.187: for translations [installed]
Required By     : valgrind
Optional For    : binutils
Conflicts With  : None
Replaces        : None
Installed Size  : 337.84 KiB
Packager        : Frederik Schwan <freswa@archlinux.org>
Build Date      : Tue 02 Aug 2022 01:11:18 AM CEST
Install Date    : Sun 14 Aug 2022 06:22:33 PM CEST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

so my debuginfod is Ok, but having:

 DEBUGINFOD_URLS=https://debuginfod.archlinux.org 

does not solve the issue. I have a standard bash shell BTW. Thank you in advance.

Last edited by vonNeumannStability (2022-08-14 16:21:39)

Offline

#17 2022-08-15 15:03:11

bluehood
Member
Registered: 2022-08-15
Posts: 6

Re: Valgrind problem after glibc update

Encountered this problem today, a `pacman -Syu` + reboot solved it for me (also for fish shell).

Offline

#18 2022-09-24 10:33:42

nontre
Member
Registered: 2022-09-24
Posts: 1

Re: Valgrind problem after glibc update

Hi,

Hello! I also had this problem.

All I've had to do is compile glibc from source but with debug symbols.

info:

5.15.65-1-MANJARO
valgrind-3.20.0.GIT

Steps to follow:

git clone https://github.com/archlinux/svntogit-packages.git
git checkout packages/glibc
cd svntogit-packages/trunk

Edit PKGBUILD and make this change to avoid strip debug symbols
- options=(debug staticlibs !lto)
+ options=(debug staticlibs !lto !strip)

grep -v "#" /etc/locale.gen >> locale.gen.txt

This will take a while...

makepkg --skipchecksums

When compilation finished:

sudo pacman -U glibc-2.36-4-x86_64.pkg.tar.zst

And...

valgrind ls
==2180763== Memcheck, a memory error detector
==2180763== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==2180763== Using Valgrind-3.20.0.GIT and LibVEX; rerun with -h for copyright info
==2180763== Command: ls
==2180763== 
glibc  glibc-2.36-4-x86_64.pkg.tar.zst	glibc.install  keys  lib32-glibc-2.36-4-x86_64.pkg.tar.zst  lib32-glibc.conf  locale-gen  locale.gen.txt  pkg  PKGBUILD  reenable_DT_HASH.patch  sdt-config.h  sdt.h  src
==2180763== 
==2180763== HEAP SUMMARY:
==2180763==     in use at exit: 25,493 bytes in 21 blocks
==2180763==   total heap usage: 55 allocs, 34 frees, 63,360 bytes allocated
==2180763== 
==2180763== LEAK SUMMARY:
==2180763==    definitely lost: 0 bytes in 0 blocks
==2180763==    indirectly lost: 0 bytes in 0 blocks
==2180763==      possibly lost: 0 bytes in 0 blocks
==2180763==    still reachable: 25,493 bytes in 21 blocks
==2180763==         suppressed: 0 bytes in 0 blocks
==2180763== Rerun with --leak-check=full to see details of leaked memory
==2180763== 
==2180763== For lists of detected and suppressed errors, rerun with: -s
==2180763== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

big_smile

Offline

#19 2022-09-26 08:49:39

natostanco
Member
Registered: 2008-01-07
Posts: 126

Re: Valgrind problem after glibc update

the debuginfo service only tracks the latest version (I assume).
So you have to update the system `pacman -Syu` and it should work.
If you are using an arch downstream like manjaro where packages lag behind...that's a problem.

Offline

#20 2023-02-09 09:06:55

CraigAB69
Member
From: Brisbane
Registered: 2019-09-05
Posts: 19

Re: Valgrind problem after glibc update

Hi,

I wasn't sure about adding to an old thread.

Thanks to nontre for the fix and others for the input. It really helped.
What I listed below is just what was advised above, with some slight changes.

What I did:

1/ sudo pacman -Syu <---Important or you will build a glibc different from what is on your system.
2/ Added export DEBUGINFOD_URLS="https://debuginfod.archlinux.org" to my .bash_profile
3/git clone https://github.com/archlinux/svntogit-packages.git
4/ cd svntogit-packages/glibc/trunk
5/ Modified line in the file PKGBUILD
6/ grep -v "#" /etc/locale.gen >> locale.gen.txt
7/ makepkg --skipchecksums
8/ sudo pacman -U glibc<should be the same as whats on your system>

Offline

#21 2024-01-23 14:21:20

gonglja
Member
Registered: 2022-02-09
Posts: 1

Re: Valgrind problem after glibc update

I also have this problem in archlinux
Environment, windows + clion + vmware virtual machine (archlinux)
In archlinux I use zsh, in zsh I have added

➜  ~ cat .zshrc| grep DEBUG
export DEBUGINFOD_URLS=https://debuginfod.archlinux.org 

After configuring ssh in clion to connect to archlinux on vmware, and then using Run `appname` with Valgrind Memcheck in clion, I still get the above error.

/usr/bin/valgrind --tool=memcheck --xml=yes --xml-file=/tmp/clion-valgrindd26ec1fb-7847-4e81-89af-336b693179f911768534303923331793/valgrind_output_%p --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no /tmp/tmp.exZ9ve7u5C/cmake-build-debug-coverage/chapter_tree/avl_tree

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.


Process finished with exit code 1

Offline

#22 2024-01-23 16:13:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,189

Re: Valgrind problem after glibc update

Your user interface started clion will not have your zsh environment for interactive shells. Export the variable via more globally sourced means:  https://wiki.archlinux.org/title/Enviro … _variables

Offline

#23 2024-02-02 14:05:45

Pheglovog
Member
Registered: 2024-02-02
Posts: 1

Re: Valgrind problem after glibc update

Hi, guys, I also encounter this problem.
My arch is on the WSL.
Here is my solution to this problem:

pacman -S debuginfod
pacman -S glibc

Offline

#24 2024-04-29 19:58:22

recolic_tmp2024
Member
Registered: 2024-04-29
Posts: 1

Re: Valgrind problem after glibc update

Thanks @Pheglovog
Hitting the same problem. Setting debuginfod URL doesn't help, but upgrading to latest glibc works!

Offline

#25 2024-05-02 17:23:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,189

Re: Valgrind problem after glibc update

Don't do partial upgrades, they are unsupported.

Closing this old thread to prevent necroing, open a new thread if it's not clear what you have to do after reading this thread.

Offline

Board footer

Powered by FluxBB