View previous topic :: View next topic |
Author |
Message |
The Main Man Veteran

Joined: 27 Nov 2014 Posts: 1173 Location: /run/user/1000
|
Posted: Wed Sep 13, 2017 1:12 pm Post subject: [SOLVED] Debugging - Valgrind - glibc -> issue |
|
|
Valgrind gives me this error :
Code: | 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.
|
... was reading Gentoo Wiki (https://wiki.gentoo.org/wiki/Debugging#Valgrind) and it deals with that problem, however I can't try it because I can't find common.eblit file in glibc ebuild directory. This :
Quote: | Create a copy of the glibc ebuild in a custom repository, then edit the file sys-libs/glibc/files/eblits/common.eblit, line 226 : |
Any other way to solve this ?
Last edited by The Main Man on Thu Sep 14, 2017 1:42 pm; edited 2 times in total |
|
Back to top |
|
 |
saboya Guru

Joined: 28 Nov 2006 Posts: 552 Location: Brazil
|
Posted: Wed Sep 13, 2017 2:12 pm Post subject: |
|
|
That wiki entry is out of date. If I'm not mistaken, eblits have been deprecated in favor of eclasses. So you would need to edit /usr/portage/eclasses/toolchain-glibc.eclass.
*edit* - Searching a little, I think that's unnecessary. You just need FEATURES="nostrip". |
|
Back to top |
|
 |
The Main Man Veteran

Joined: 27 Nov 2014 Posts: 1173 Location: /run/user/1000
|
Posted: Wed Sep 13, 2017 2:26 pm Post subject: |
|
|
Thought so, I didn't do that part from Wiki thinking what else from it might be outdated, but I guess I'll try to re-emerge glibc with new features and see what happens. |
|
Back to top |
|
 |
kharitonow n00b

Joined: 10 Dec 2015 Posts: 38
|
Posted: Wed Sep 13, 2017 6:21 pm Post subject: |
|
|
kajzer wrote: | Thought so, I didn't do that part from Wiki thinking what else from it might be outdated, but I guess I'll try to re-emerge glibc with new features and see what happens. |
You could use package.env
E.g something like this:
Code: | sudo echo sys-libs/glibc no-builtin-strlen.conf >> /etc/portage/package.env/glibc
sudo echo CFLAGS="${CFLAGS} -fno-builtin-strlen" >> /etc/portage/env/no-builtin-strlen.conf
sudo emerge -1 glibc |
|
|
Back to top |
|
 |
The Main Man Veteran

Joined: 27 Nov 2014 Posts: 1173 Location: /run/user/1000
|
Posted: Wed Sep 13, 2017 8:39 pm Post subject: |
|
|
kharitonow wrote: |
You could use package.env
E.g something like this:
Code: | sudo echo sys-libs/glibc no-builtin-strlen.conf >> /etc/portage/package.env/glibc
sudo echo CFLAGS="${CFLAGS} -fno-builtin-strlen" >> /etc/portage/env/no-builtin-strlen.conf
sudo emerge -1 glibc |
|
There's no need for "nostrip" in make.conf and to install debugging information (I don't need gdb btw) ? |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23283
|
Posted: Thu Sep 14, 2017 12:31 am Post subject: |
|
|
I think kharitonow was showing an abstract example of how to customize a single package, rather than giving you steps to be followed literally. You still need debugging information for Valgrind, and FEATURES=nostrip on the relevant package is the easiest way to get it. |
|
Back to top |
|
 |
The Main Man Veteran

Joined: 27 Nov 2014 Posts: 1173 Location: /run/user/1000
|
Posted: Thu Sep 14, 2017 11:14 am Post subject: |
|
|
I know, but I'm confused with installing debugging info, wiki says :
Quote: | If nostrip is in your default FEATURES, splitdebug won't do anything, so we disable it for debug-packages!
FEATURES="${FEATURES} splitdebug compressdebug -nostrip" |
So I don't know how I should use "FEATURES=nostrip" in that case.
To be clear, I just need Valgrind to run, nothing more, I understand how to do those steps per package, but Wiki is clearly outdated and I'm just not sure about the right steps. |
|
Back to top |
|
 |
saboya Guru

Joined: 28 Nov 2006 Posts: 552 Location: Brazil
|
Posted: Thu Sep 14, 2017 11:26 am Post subject: |
|
|
kajzer wrote: | I know, but I'm confused with installing debugging info, wiki says :
Quote: | If nostrip is in your default FEATURES, splitdebug won't do anything, so we disable it for debug-packages!
FEATURES="${FEATURES} splitdebug compressdebug -nostrip" |
So I don't know how I should use "FEATURES=nostrip" in that case.
To be clear, I just need Valgrind to run, nothing more, I understand how to do those steps per package, but Wiki is clearly outdated and I'm just not sure about the right steps. |
You either don't strip symbols out with nostrip or split them into separate files fomr the binary with splitdebug. That's my understanding. |
|
Back to top |
|
 |
The Main Man Veteran

Joined: 27 Nov 2014 Posts: 1173 Location: /run/user/1000
|
Posted: Thu Sep 14, 2017 12:56 pm Post subject: |
|
|
I'll recompile glibc with splitdebug feature and -fno-builtin-strlen, hopefully that should be enough.
edit: Yeah that did it, thanks everyone! |
|
Back to top |
|
 |
icyhearts n00b


Joined: 24 Sep 2017 Posts: 31
|
Posted: Sat Apr 20, 2019 4:48 am Post subject: |
|
|
kajzer wrote: | I'll recompile glibc with splitdebug feature and -fno-builtin-strlen, hopefully that should be enough.
edit: Yeah that did it, thanks everyone! |
How did you do that in detail? like this?
Code: |
"FEATURES=nostrip" emerge -a sys-libs/glibc
|
I am not so experienced gentoo user. |
|
Back to top |
|
 |
The Main Man Veteran

Joined: 27 Nov 2014 Posts: 1173 Location: /run/user/1000
|
Posted: Sat Apr 20, 2019 8:40 am Post subject: |
|
|
icyhearts wrote: | How did you do that in detail? like this?
|
You just edit /etc/portage/make.conf and add this line :
Code: | FEATURES="splitdebug" |
then emerge glibc
btw in case you're wondering it's like that now, it wasn't that simple when I posted that issue, it required more magic. |
|
Back to top |
|
 |
cynapse n00b

Joined: 05 Jan 2022 Posts: 4
|
Posted: Mon Jan 10, 2022 2:12 am Post subject: |
|
|
I faced the same error but didn't want to make global changes to my make.conf.
I created the file /etc/portage/env/glibc.conf
Code: |
CFLAGS="-O2 -gdwarf-4 -pipe -fno-builtin-strlen"
FEATURES="${FEATURES} nostrip"
|
Note: I am using -gdwarf-4 instead of -ggdb which wasnt working. see this thread
Then in /etc/portage/package.env/my.env
Code: |
sys-libs/glibc glibc.conf
|
Version info:
sys-libs/glibc-2.33-r7
dev-util/valgrind-3.17.0
Linux 5.15.11-gentoo
Hopefully this helps someone else (Or my future self).
Dont forget to emerge glibc after these config changes. |
|
Back to top |
|
 |
|