Bug 359645

Summary: [patch] "You need libc6-dbg" help message could be more helpful with 32-bit target on-64-bit arch
Product: [Developer tools] valgrind Reporter: Sami Liedes <sami.liedes>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.12 SVN   
Target Milestone: ---   
Platform: Compiled Sources   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Patch to add bitness help note.

Description Sami Liedes 2016-02-21 17:08:22 UTC
Created attachment 97343 [details]
Patch to add bitness help note.

I have a few times helped people run Valgrind on a 32-bit target on a 64-bit architecture. If the 32-bit libc debug info is not installed, the usual error message is shown:

"valgrind:  Fatal error at startup: a function redirection
[...]
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"

This error message often leaves people mystified when they have the suggested package (libc6-dbg) installed. Also quick googling reveals this is a frequent source of confusion.

The attached patch adds a further paragraph to the error message:

"valgrind:  Please note that if you are debugging a 32-bit target on a
valgrind:  64-bit system, you will need a corresponding 32-bit debuginfo
valgrind:  package (e.g. libc6-dbg:i386)."

Of course this is a bit more general problem than 32-bit on 64-bit, but that's probably the most common case. Also, I do not know if RHEL & friends need something similar or if glibc-debuginfo takes care of the 32-bit case too.

(I'm not sure about the wording; is "debugging" the correct verb to use with Valgrind, and is "target" the word used for the, well, target binary?)
Comment 1 Julian Seward 2016-10-19 16:19:31 UTC
Committed, r16078.  Thanks for the patch.