|
From: Yeshurun, M. <mei...@in...> - 2005-08-11 09:43:49
|
Hi, =20 I am trying to redirect an STL port allocator (_STL::__node_alloc<true, 0>::allocate) to the same function that malloc is redirected to. I updated the functions and structures involved in the redirection mechanism. =20 When I run Valgrind with -trace-redir=3Dyes I get the following =20 ... ... =20 29764-- REDIR sym to addr: soname:libstlport_gcc*:_ZN4_STL12__node_allocILb1ELi0EE8allocateEm to 0x140281D1E0 (I am using the mangled name I got from Valgrind using --demangle=3Dno) ... ... =20 --29764-- Just loaded /nfs/proj/dt/sc13/x86-64_linux26/STLport/4.5.2_64/lib/libstlport_gcc.so. 4.5 (soname=3D(null)), --29764-- resolving any unresolved redirs with it --29764-- Finished resolving =20 =20 Does this mean the redirection was successful? Is something like this even possible using the existing redirection mechanism? =20 =20 From the stack trace it looks like the redirection didn't work: =20 =3D=3D29764=3D=3D 2852128 bytes in 47 blocks are still reachable in loss = record 33 of 33 =3D=3D29764=3D=3D at 0x140281D608: operator new(unsigned long) (vg_replace_malloc.c:175) =3D=3D29764=3D=3D by 0x1402972C31: _STL::__node_alloc<true, 0>::_S_chunk_alloc(unsigned long, int&) (in /a/nfs/iil/proj/dt/sc13/x86-64_linux26/STLport/4.5.2_64/lib/libstlport_g cc.so.4.5) =3D=3D29764=3D=3D by 0x1402972D31: _STL::__node_alloc<true, 0>::_S_refill(unsigned long) (in /a/nfs/iil/proj/dt/sc13/x86-64_linux26/STLport/4.5.2_64/lib/libstlport_g cc.so.4.5) =3D=3D29764=3D=3D by 0x1402972DEA: _STL::__node_alloc<true, 0>::_M_allocate(unsigned long) (in /a/nfs/iil/proj/dt/sc13/x86-64_linux26/STLport/4.5.2_64/lib/libstlport_g cc.so.4.5) =3D=3D29764=3D=3D by 0x40270D: _STL::__node_alloc<true, = 0>::allocate(unsigned long) (_alloc.h:251) =3D=3D29764=3D=3D by 0x402538: _STL::allocator<_STL::_List_node<int> >::allocate(unsigned long, void const*) const (_alloc.h:355) =3D=3D29764=3D=3D by 0x402666: _STL::list<int, _STL::allocator<int> >::_M_create_node(int const&) (_list.h:235) =3D=3D29764=3D=3D by 0x402267: _STL::list<int, _STL::allocator<int> >::insert(_STL::_List_iterator<int, _STL::_Nonconst_traits<int> >, int const&) (_list.h:294) =3D=3D29764=3D=3D by 0x401E67: _STL::list<int, _STL::allocator<int> >::push_back(int const&) (_list.h:339) =3D=3D29764=3D=3D by 0x401BCF: main (stlp.cpp:19) =20 =20 Any help would be greatly appreciated. =20 Regards, =20 Meir =20 =20 =20 =20 =20 |
|
From: Tom H. <to...@co...> - 2005-08-11 09:51:19
|
In message <942...@ha...>
Meir Yeshurun <mei...@in...> wrote:
> I am trying to redirect an STL port allocator (_STL::__node_alloc<true,
> 0>::allocate) to the same function that malloc is redirected to. I
> updated the functions and structures involved in the redirection
> mechanism.
Why are you trying to do that? It sounds like quite an odd thing to do?
> 29764-- REDIR sym to addr:
> soname:libstlport_gcc*:_ZN4_STL12__node_allocILb1ELi0EE8allocateEm to
> 0x140281D1E0
So the redirect is installed (but not resolved yet). The redirect is
from a library with an soname matching libstlport_gcc*.
> --29764-- Just loaded
> /nfs/proj/dt/sc13/x86-64_linux26/STLport/4.5.2_64/lib/libstlport_gcc.so.
> 4.5 (soname=(null)),
>
> --29764-- resolving any unresolved redirs with it
>
> --29764-- Finished resolving
Now you loaded a library with no soname so the redirect won't match
and (as expected) we don't see any resolutions.
> Does this mean the redirection was successful?
No - you would see a "redir resolved" message if it was.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|