|
From: Tom H. <to...@co...> - 2005-08-17 12:24:20
|
In message <1124280839.7051.7.camel@localhost.localdomain>
Rob Holland <ti...@ge...> wrote:
> On Wed, 2005-08-17 at 12:50 +0100, Tom Hughes wrote:
>> In message <1124276546.3197.16.camel@localhost.localdomain>
>> Rob Holland <ti...@ge...> wrote:
>>
>>
>> We've loaded the preload library. Why is it vg_preload_core by the
>> way? Surely it should be vgpreload_<tool>.so?
>
> Valgrind loads/names that itself, it's nothing to do with me :)
>
>> > --30136-- resolving any unresolved redirs with it
>> > --30136-- Finished resolving
>>
>> We checked if there were redirections pending for any symbols in
>> that library and (as expected) there weren't.
>>
>> > --30136-- REDIR sym to addr: soname:libc.so.6:printf to 0x2571AF50
>>
>> We found a redirection for printf in the vg_preload_core.so library
>> but as libc has not been loaded yet we can't resolve it.
>
> No we can't have done, because there isn't one... valgrind doesn't do
> any redirection for printf itself. Try: 'valgrind --tool=memcheck
> --trace-redir=yes ls'. You'll see there is no mention of printf.
>
> Now if I do 'valgrind --tool=formatcheck --trace-redir=yes ls' I do see
> a prinf redirection, but "in the wrong place" (i.e. attributed to
> valgrind_preload_core.so).
It's all right. I misunderstood the output - the "REDIR sym to addr"
lines are actually printed before it reports having loaded the library
so they apply to the library after not the one before.
So it all looks fine...
>> Are you sure your test program is actually calling printf and that gcc
>> and/or the glibc headers haven't turned it into a call to some other
>> routine?
>
> Well, the only thing I have to go on really is nm output. nm is the same
> for printf and fprintf and both look like they have undefined symbols
> against glibc, which would imply they would be resolved the same way to
> me.
It would seem that way... I take it nm on libc only shows one printf
and not multiple versions? Even better use objdump -T which will show
the versions. In libc 2.3.4 I am only seeing one version of printf
and fprintf certainly.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|