Unable to use Valgrind

Hi, I have installed valgrind:
$sudo pacman -S valgrind

And upon installation I tried to use it, but the error message pops up:

==8675== Memcheck, a memory error detector
==8675== Copyright (C) 2002-2022, and GNU GPL’d, by Julian Seward et al.
==8675== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==8675== Command: ./program.o
==8675==
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’ve seen “Cannot use valgrind” from June this year, it’s the same issue. (For some reason I’m not allowed to post links, so here it is) From that post I have tried to follow the instructions that worked for OP. (I am aware this is more of a workaround than a longterm solution, but I need it to work for now)

So I have tried to, as suggested in the post, downgrade glibc

I did:

  1. I installed downgrade by typing in the terminal

$pamac install downgrade

  1. run downgrade with DOWNGRADE_FROM_ALA=1 and select glibc-2.35-3

sudo DOWNGRADE_FROM_ALA=1 downgrade glibc

And upon selecting 2.35-3 version of glibc the following message appears:

loading packages…
warning: downgrading package glibc (2.36-2 => 2.35-3)
resolving dependencies…
looking for conflicting packages…
error: failed to prepare transaction (could not satisfy dependencies)
:: installing glibc (2.35-3) breaks dependency ‘glibc=2.36’ required by lib32-glibc

Does anybody know what is it that I can try to successfully resolve this issue?
Thanks in advance.

Edit:Markdown

1 Like

Maybe this: Valgrind problem after glibc update / Newbie Corner / Arch Linux Forums

Debuginfod - ArchWiki

cat /etc/profile.d/debuginfod.sh  
cat /etc/debuginfod/archlinux.urls

Normally you just have to relog or do it manually:

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

I have seen this one. I am having the same problem as " vonNeumannStability" guy. I use bash and not fish as others who have found solution in this thread.

Also I, as suggested in the thread, have tried to update mirror list and update, upgrade the system with:

$sudo pacman-mirrors --continent && sudo pacman -Syyu

I have also run:

$sudo pacman-mirrors

afterwards so I can check if my mirrors list is okay. And everything seems fine. There is a green “OK” on every line of my list.

I have also tried to:

$export DEBUGINFOD_URLS=“debuginfod_archlinux_org”

(I can’t include links, but the thing between the quotes starts with https://, and instead of ‘_’ there should be dots)
As suggested and have rebooted the system after doing all of that and nothing changed.

Thanks for your comment anyway.

Note: export command will not suvive a reboot nor an exit of a terminal session. I mentioned this:

Because these files should be there so that they run on login. There is not need to set it manually.

I have just finished reading about Debuginfod on Archwiki you linked.

Here are the outputs of those two commands:

# $HOME/.profile* or similar files may first set $DEBUGINFOD_URLS.
# If $DEBUGINFOD_URLS is not set there, we set it from system *.url files.
# $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS.
# See also [man debuginfod-client-config] for other environment variables
# such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS.

if [ -z "$DEBUGINFOD_URLS" ]; then
    prefix="/usr"
    DEBUGINFOD_URLS=$(cat "/etc/debuginfod"/*.urls 2>/dev/null | tr '\n' ' ')
    [ -n "$DEBUGINFOD_URLS" ] && export DEBUGINFOD_URLS || unset DEBUGINFOD_URLS
    unset prefix
fi

And the output of the second command:

https://debuginfod.archlinux.org  

“.” instead of “_” I just cannot post links, so I had put change something.

I exported and haven’t rebootet now and after:

$ valgrind ls  

The same error message, as is in the post, is displayed.

Note: export command will not suvive a reboot nor an exit of a terminal session. I mentioned this:

Ah, okay I didn’t know this. I have tried to export it again without rebooting but same result.

I think I don’t understand the second part of the comment. What about those two files?

Edit: Thanks for your effort!

When pasting terminal output, add three backticks ` OR 3 tilde ~ above and below the text:

text

I did it this time for you. Please do it like this in the future.

Thank you :bowing_man:

Also note that even if you are TL0, you can post links in markdown code blocks like that. :wink:


However I cannot reproduce your issue. For me it works as intended.

[user@manjaro ~]$ valgrind htop
==17429== Memcheck, a memory error detector
==17429== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==17429== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==17429== Command: htop
==17429==
==17429==
==17429== HEAP SUMMARY:
==17429==     in use at exit: 525,974 bytes in 543 blocks
==17429==   total heap usage: 14,790 allocs, 14,247 frees, 42,879,207 bytes allocated
==17429==
==17429== LEAK SUMMARY:
==17429==    definitely lost: 0 bytes in 0 blocks
==17429==    indirectly lost: 0 bytes in 0 blocks
==17429==      possibly lost: 1,762 bytes in 42 blocks
==17429==    still reachable: 524,212 bytes in 501 blocks
==17429==         suppressed: 0 bytes in 0 blocks
==17429== Rerun with --leak-check=full to see details of leaked memory
==17429==
==17429== For lists of detected and suppressed errors, rerun with: -s
==17429== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Ah, okay. I did not know that. I thought “Blockquote” suits it better.

Thanks for correcting me! Now I know.

Also note that even if you are TL0, you can post links in markdown code blocks like that.

Oh I definitely did not know that. Thank you so much!

I will try to read further about the issue and try different methods of solving it. It’s good that I have listed my outputs so maybe somebody else finds a solution.

If I manage to solve it myself I will definitely share it over here.

Thank you for your comments! You are very kind.

What does

valgrind -v ls

output?

I am having this same issue. Ensuring DEBUGINFOD_URLS is set does not solve the issue. For me valgrind -v ls gives:

==7283== Memcheck, a memory error detector
==7283== Copyright (C) 2002-2022, and GNU GPL’d, by Julian Seward et al.
==7283== Using Valgrind-3.19.0-8d3c8034b8-20220411 and LibVEX; rerun with -h for copyright info
==7283== Command: ls
==7283==
–7283-- Valgrind options:
–7283-- -v
–7283-- Contents of /proc/version:
–7283-- Linux version 5.15.60-1-MANJARO (builduser@fv-az462-678) (gcc (GCC) 12.1.1 20220730, GNU ld (GNU Binutils) 2.39) #1 SMP PREEMPT Thu Aug 11 13:14:05 UTC 2022
–7283–
–7283-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand-rdseed
–7283-- Page sizes: currently 4096, max supported 4096
–7283-- Valgrind library directory: /usr/lib/valgrind
–7283-- Reading syms from /usr/bin/ls
==7283== Downloading debug info for /usr/bin/ls…
==7283== Server query failed: No such file or directory
–7283-- object doesn’t have a symbol table
–7283-- Reading syms from /usr/lib/ld-linux-x86-64.so.2
==7283== Downloading debug info for /usr/lib/ld-linux-x86-64.so.2…
==7283== Server query failed: No such file or directory
–7283-- object doesn’t have a symbol table

… same error message

I’m going to try downgrading glibc as the OP attempted and see where that gets me, as I’m pretty sure this problem arose for me with the update of glibc to 2.36-2

When I went to downgrade, I noticed that there is 2.6-3 available. Upgrading to that has fixed valgrind for me.

The issue is that the Arch Linux debuginfod servers only store data for the latest version of a package. So when the Manjaro and Arch Linux glibc packages are out of sync, you can no longer download the debug information for glibc available in the Manjaro repositories, and valgrind needs that to work.

That is because 2.36-3 is the version that is available in the Arch Linux repositories, and the debug data for that can be downloaded from the Arch Linux debuginfod server.

2 Likes

$valgrind -v ls
gives:

==1553== Memcheck, a memory error detector
==1553== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==1553== Using Valgrind-3.19.0-8d3c8034b8-20220411 and LibVEX; rerun with -h for copyright info
==1553== Command: ls
==1553== 
--1553-- Valgrind options:
--1553--    -v
--1553-- Contents of /proc/version:
--1553--   Linux version 5.10.136-1-MANJARO (builduser@fv-az39-334) (gcc (GCC) 12.1.1 20220730, GNU ld (GNU Binutils) 2.39) #1 SMP PREEMPT Thu Aug 11 13:14:01 UTC 2022
--1553-- 
--1553-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-sse3-ssse3
--1553-- Page sizes: currently 4096, max supported 4096
--1553-- Valgrind library directory: /usr/lib/valgrind
--1553-- Reading syms from /usr/bin/ls
==1553== Downloading debug info for /usr/bin/ls...
==1553== Server query failed: No such file or directory
--1553--    object doesn't have a symbol table
--1553-- Reading syms from /usr/lib/ld-linux-x86-64.so.2
==1553== Downloading debug info for /usr/lib/ld-linux-x86-64.so.2...
==1553== Server query failed: No such file or directory
--1553--    object doesn't have a symbol table

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.

This solved the problem for me! Thank you!

Hello, same issue here… on my system can’t downgrade glibc:

warning: downgrading package glibc (2.36-2 => 2.35-6)
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing glibc (2.35-6) breaks dependency 'glibc=2.36' required by lib32-glibc

I don’t see the option of a version 2.6-3 as upgrade… What I have here is:

GNU C Library glibc [Installed] 2.36-2 core
pamac update                                                                                                                           
Preparing...
Synchronizing package databases...
Nothing to do.

You want to upgrade glibc to 2.36-3 and install the debuginfod package. Unfortunately, that version of glibc is not yet available in the stable branch.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.