Hello,
I've re-built my toolchain to include debugging info (I'm not sure if it
was there before). Hopefully that would guarantee that the libraries aren't
stripped? The end result is, unfortunately, unchanged.
Due to the complexity in implementing Valgrind on our systems, our
priorities have shifted. I'm no longer actively attempting to make the
application function, but will still happily reply with more information if
it is helpful for developers (although it has become apparent that this is
a problem with our own setup, and not with the valgrind product). If you
would still like the results of the detailed detailed tracing, I can send
it to you off-list (it's too long to post here).
- Woodrow Barlow
On Fri, Oct 10, 2014 at 4:59 PM, Philippe Waroquiers <
philippe.waroqui...@skynet.be> wrote:
> On Fri, 2014-10-10 at 08:11 -0400, Woodrow Barlow wrote:
> > Hello Sir,
> >
> >
> > Thank you for the help. I'm not entirely sure whether malloc is provided
> by libc.so.0 or by ld-uClibc.so.0,
> > so I've executed the requested command against both. I'm afraid I don't
> know how to interpret the output,
> > but I've included it below:
> >
> >
> > $ readelf -d lib/libc.so.0 | grep SONAME
> >
> > 0x0000000e (SONAME) Library soname: [libc.so.0]
> > $ readelf -d lib/ld-uClibc.so.0 | grep SONAME
> > 0x0000000e (SONAME) Library soname:
> [ld-uClibc.so.0]
> It is unlikely that ld-uClibc.so.0 does provide malloc.
> So, probably it will be libc.so.0 that will provide it.
>
>
>
> > Finally, as requested, I've run Valgrind with the debugging options
> against a very simple application with malloc
> It looks like the trace below has some lines truncated at column 90 and
> joined with the next line(s).
> E.g. some aspacemgr lines, or (more annoying :), the preload_string value.
> A full not truncated trace would be better.
>
> In any case, the trace shows that LD_PRELOAD is working, as we
> see e.g. the line:
> --1209-- Reading syms from
> /mnt/usb1_1/valgrind/lib/valgrind/vgpreload_memcheck-mips32-linux.so
>
> The difference I see between a working run on a x86/linux and the trace
> below
> is that no 'ACTIVE' redirection is being added.
> On the x86/linux, we obtain some lines such as:
> ...
> --2582-- ------ ACTIVE ------
> ...
> --2582-- 0x00286b40 (malloc ) R-> (1001.0) 0x040078cc
> malloc
>
> which means that the malloc function at 0x00286b40 (which the intercepted
> malloc in libc)
> will be redirected to 0x040078cc, which is the 'intercepting malloc' in
> vgpreload_memcheck.
>
> So, it looks like in your case, the valgrind files to preloaded are
> effectively preloaded,
> that the redirection 'instructions' from these preloaded files are
> properly built,
> giving the 'TOPSPEC' lines
> but that they do not become active when the functions to intercepts are
> seen/found.
>
> Looking at the code that makes such redirections active, this might be
> caused by
> having a stripped library.
> At least, in the x86 working case, I see:
> --2582-- Reading syms from /lib/libc-2.11.2.so
> while no such Reading Syms lines are visible in your trace for the libc.
>
> Valgrind is supposed to detect that the dynamic linker was stripped,
> and report a fatal error, and indicate to install the libc debug info.
> but from what I can see, in the mips case, the warning is only given
> for ld.so.3, while in your case, the loader soname is ld-uClibc.so.0,
> as you do not use the "standard" linux loader.
>
> So, at this state, the best guess is that you have a somewhat stripped
> libraries and/or libraries without debug info, and/or syms for these
> libs are not read properly
> and that makes redirection not working.
>
> There are ways to have more tracing, e.g. by doing
>
> valgrind -v -v -v -d -d -d --debug-dump=syms --trace-symtab-patt=*libc*
> --trace-symtab=yes --trace-redir=yes --trace-malloc=yes
>
> but I think this should be tried only after having verified that libc
> debug info
> is available and/or that symbols are available in your lib.
>
> Philippe
>
>
>
>
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users