Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 388065 - Valgrind should notify users of splitdebug FEATURE
Summary: Valgrind should notify users of splitdebug FEATURE
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-21 23:59 UTC by Roger
Modified: 2011-10-26 23:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roger 2011-10-21 23:59:29 UTC
Valgrind should notify to users (via einfo after compile) to use splitdebug FEATURE. (ie. /etc/make.conf FEATURES="splitdebug")

glibc requires to be compiled and installed without stripping.

With the "splitdebug" feature, symbols are still stripped, but will be stored in a separate system folder.  (ie. /usr/lib/debug)

Reproducible: Always

Steps to Reproduce:
1. Install valgrind for your first time.
2. Wooh Nelly!  Valgrind refuses to run.
3. After Googling "valgrind gentoo" you find this is because glibc was stripped of symbols, for which valgrind requires to be able to execute.
4. And then your find the "Gentoo Solution" is to use a new Gentoo feature called "splitdebug"



To resolve, just add a few einfo statements to the ebuild to notify the user, it's recommended to use the "splitdebug" compile time FEATURE for glibc, and recompile glibc.

(Other distros supposedly provide a separate glibc-debug package to temporarily work around this, but sounds more hackish then a reliable solution.)
Comment 1 Roger 2011-10-22 00:20:05 UTC
...ok.  Where has the "splitdebug" feature gone to?

It doesn't seem to be available in =sys-apps/portage-2.1.10.11.
Comment 2 Roger 2011-10-22 00:47:05 UTC
(FYI: splitdeubg != splitdebug.  oops.  my fault here.)
Comment 3 Anthony Basile gentoo-dev 2011-10-23 14:24:27 UTC
Roger, thanks, you're absolutely right.  This is one of those things that is obvious to those to whom it is obvious :P  A newbie coming to valgrind on gentoo would have to repeat your search.

How does this sound:

In order for valgrind to work properly, you will need to include debugging
information in glibc.  To do so, add FEATURES="splitdebug" to your /etc/make.conf
file and emerge glibc.

Was there a particularly informative url that I might refer to?
Comment 4 Roger 2011-10-23 23:41:37 UTC
Now that I think of it.  If valgrind requires symbols to work, mayabe the ebuild should check for FEATURES=nostrip or FEATURES=splitdebug at the beginning of the emerge and warn -- so a user can rebuild glibc and build valgrind at the same time?  Instead of coming back from a break and finding they now have to rebuild another package.

But the above is a very minor issue.  Just being informed there's a very useful "splitdebug" option is good enough for me, and would have saved an hour of searching for "the common Gentoo solution for getting symbols for glibc and valgrind working".  Besides, I'm retired and doing this for fun, not work.

As far as a useful url, there's no Gentoo Valgrind documentation page (yet) and "splitdebug" was only found on the Gentoo "How to get meaningful backtraces (using GDB)"  ... all non-related to valgrind and the only thing found related to Valgrind was mentioned within the User Forums.


However, you might want to make mention of the "Valgrind Quick Start Guide" and the "Valgrind User Manual" found on valgrind's homepage.

---snip---
++ In order for valgrind to work properly, you will need to include debugging
information (symbols) in glibc.  To do so, add FEATURES="splitdebug" or FEATURES="nostrip" to your /etc/make.conf file or /etc/portage/savedconfig and recompile glibc.

++ Valgrind has a Quick Start Guide and a User Manual available in HTML/PDF/PS on it's homepage, as well as installed locally within the docs folder of this install.
---snip---

(I think this recompile information more then adequate information for a user and can be further minimized if you'd like.  The locally and remotely available manuals might be a good thing to mention -- as even I didn't know the HTML/PDF/PS were installed locally!  Could also print the file location: /usr/share/doc/valgrind-${VERSION}/ ... somebody's bound to complain there should be a USE=doc option next. ;-)

After several reruns of valgrind and examining it's stdout recommendations, I find "valgrind -v --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind.log" is a useful incantation.  Also, just was informed via a developer by email the --suppress option provide a *lot* more readable output. (I would imagine he's talking about --suppressions=<filename> and --gen-suppressions=yes as well as the keyword "suppressions" mentioned elsewhere amongst the man page.)
Comment 5 Anthony Basile gentoo-dev 2011-10-26 18:29:53 UTC
Actually, I feel silly.  If you read the ebuild there is a message at the bottom.  I forgot that was there.

pkg_postinst() {
	if use ppc || use ppc64 || use amd64 ; then
		ewarn "Valgrind will not work on ppc, ppc64 or amd64 if glibc does not have"
		ewarn "debug symbols (see https://bugs.gentoo.org/show_bug.cgi?id=214065"
		ewarn "and http://bugs.gentoo.org/show_bug.cgi?id=274771)."
		ewarn "To fix this you can add splitdebug to FEATURES in make.conf and"
		ewarn "remerge glibc."
	fi
}
Comment 6 Roger 2011-10-26 23:57:41 UTC
My bag.  I should have looked at the ebuild, and thought I *did* look at it.

But it looks like the real culprit is "emerge -q".

Wish emerge -q would just be quiet, but still print einfo/ewarn messages!  Instead, it's too quiet.  Should be emerge -q & emerge -qq or similar.