|
From: John R. <jr...@bi...> - 2013-05-27 05:06:10
|
On 05/23/2013 10:14 AM, Britton Kerin wrote:
> On Mon, May 20, 2013 at 7:53 AM, John Reiser <jr...@bi...> wrote:
>>> I'm on a beaglebone white with vanilla Angstrom (linux 3.2)
>>> distribution. Valgrind fails like this:
>>
>>> ==13719== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
>>
>>> valgrind: A must-be-redirected function
>>> valgrind: whose name matches the pattern: memcpy
>>> valgrind: in an object with soname matching: ld-linux.so.3
>>> valgrind: was not found whilst processing
>>> valgrind: symbols from the object with soname: ld-linux.so.3
>>
>>> I've installed libc6-dbg as it says. Same problem.
>>
>> Which other Linux distribution is Angstrom derived from, or is most similar to?
>
> Well, its based in part on OpenZaurus, which was debian-based. And it seems
> pretty debian-like in the way its package manager opkg works. But that
> about all I know, I'm just using it because it ships on the beaglebone.
OK. It's Debian. The specific version of Debian might matter,
but perhaps in this case that info is no longer so significant.
>
>> Try running the previous version 3.7 of valgrind.
>
> This version doesnt seem to be available on the release archive page,
> where can I get it?
In general, try the Internet Archive. But in this case the source code
to valgrind is better anyway; see below.
>
>> Also post the output from:
>> readelf --symbols ld-linux.so.3 | grep mem
>
> root@bboneumh:/# readelf --symbols /lib/ld-linux.so.3 | grep mem
> 12: 000150a8 332 FUNC WEAK DEFAULT 10 __libc_memalign@@GLIBC_2.4
> root@bboneumh:/#
The actual source of memcheck's complaint is coregrind/m_redir.c:
void VG_(redir_initialise) ( void )
<<snip>>
# elif defined(VGP_arm_linux)
/* If we're using memcheck, use these intercepts right from
the start, otherwise ld.so makes a lot of noise. */
if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
add_hardwired_spec(
"ld-linux.so.3", "strlen",
(Addr)&VG_(arm_linux_REDIR_FOR_strlen),
complain_about_stripped_glibc_ldso
);
//add_hardwired_spec(
// "ld-linux.so.3", "index",
// (Addr)&VG_(arm_linux_REDIR_FOR_index),
// NULL
//);
add_hardwired_spec(
"ld-linux.so.3", "memcpy",
(Addr)&VG_(arm_linux_REDIR_FOR_memcpy),
complain_about_stripped_glibc_ldso
);
}
So the deal is: any valgrind tool [not just memcheck] for ARM Linux
will demand that ld-linux.so.3 has a subroutine named "memcpy"
which can be re-directed to an internal valgrind routine
that "does the same thing" in a way that valgrind considers
to be easier to understand and emulate or instrument.
Perhaps your version of ld-linux.so.3 does not have such a 'memcpy'.
The "readelf --symbols" shows that ld-linux.so.3 does not have this
itself, and you say that installing the debug package still does not
have a symbol for 'memcpy'. So perhaps ld-linux.so.3 no longer uses
_subroutine_ memcpy; it was replaced by memmove, or a macro which was
expanded inline, or by an open-coded loop. Therefore, try commenting-out
the code for memcpy, just like the code for 'index' is commented out:
//add_hardwired_spec(
// "ld-linux.so.3", "memcpy",
// (Addr)&VG_(arm_linux_REDIR_FOR_memcpy),
// complain_about_stripped_glibc_ldso
//);
Visit the main web page http://www.valgrind.org/ ,
follow the "Code Repository" link, use 'svn' source code manager
to checkout some version (try for top-of-trunk first, else 3.8.1).
Modify VG_(redir_initialise) as indicated. Build, install, test, use.
--
|