|
From: Josef W. <Jos...@gm...> - 2005-09-15 14:50:20
|
On Thursday 15 September 2005 06:52, Paul Mackerras wrote: > Valgrind sets LD_PRELOAD so that you get a simple Valgrind-supplied > set of string functions, including strlen, from vgpreload_memcheck.so > rather than the fancy glibc ones. However, that doesn't seem to catch > the calls to strlen from inside glibc - the call from vfprintf is a > direct branch rather than going through the PLT, for instance. Just curious: Why is it using LD_PRELOAD and not the VGs symbol redirection mechanism, which should catch strlen even if used inside of glibc? Josef |
|
From: Tom H. <to...@co...> - 2005-09-15 15:09:48
|
In message <200...@gm...>
Josef Weidendorfer <Jos...@gm...> wrote:
> On Thursday 15 September 2005 06:52, Paul Mackerras wrote:
>> Valgrind sets LD_PRELOAD so that you get a simple Valgrind-supplied
>> set of string functions, including strlen, from vgpreload_memcheck.so
>> rather than the fancy glibc ones. However, that doesn't seem to catch
>> the calls to strlen from inside glibc - the call from vfprintf is a
>> direct branch rather than going through the PLT, for instance.
>
> Just curious: Why is it using LD_PRELOAD and not the VGs symbol redirection
> mechanism, which should catch strlen even if used inside of glibc?
We use both in combination - valgrind spots the special symbols in the
preload library and sets up redirections based on them.
Because we use redirection rather than relying on the LD_PRELOAD
acting as an overload it should catch internal calls as well as
ones which go through the PLT. What it won't catch is inlined
ones.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Paul M. <pa...@sa...> - 2005-09-20 10:50:48
|
Josef Weidendorfer writes: > Just curious: Why is it using LD_PRELOAD and not the VGs symbol redirection > mechanism, which should catch strlen even if used inside of glibc? Valgrind-2.4.1 does symbol redirects for stpcpy and strnlen in libc.so.6, and stpcpy and strchr in ld-linux.so.2. I could extend that list on ppc to include strlen et al., but I don't know if that would solve the problem for ld.so, since strlen doesn't appear in the symbol table for ld.so. Paul. |