|
From: Patrick B. <der...@cd...> - 2005-01-24 11:51:30
|
Hi *!
I'm new to this list and to valgrind... but I'm also very enthusisat about =
it!
I'm actually using it in order to profile a project of mines: it's a C++ CP=
U=20
simulator consisting of a core engine and a set of arch-specific libraries.
I'm particularly interested in memory profiling... and memory leaks hunting.
So... I've compiled with gcc using
CXXFLAGS =3D -O0 -g -fno-inline
both the simulator core and its libraries.
After that I've runned valgrind with that switches:
valgrind -v --suppressions=3Dmy_valgrind.supp --log-file=3Dvalgrind.log \=
=20
--num-callers=3D40 --tool=3Dmemcheck --leak-check=3Dyes --leak-resolution=
=3Dhigh \
<mysimulator exe>
In the log I've found, among others, those lines:
=3D=3D24233=3D=3D Reading syms
from /home/derkling/Tesi/Sources/myroot/lib/libarm7.so.0.0.0 (0x1BC6A000)
=3D=3D24233=3D=3D TRANSLATE: 0x1B9FD240 redirected to 0x1B905248
=3D=3D24233=3D=3D TRANSLATE: 0x1B9FB9F0 redirected to 0x1B905590
=3D=3D24233=3D=3D discard syms at 0x1BC6A000-0x1BC89000
in /home/derkling/Tesi/Sources/myroot/lib/libarm7.so.0.0.0 due to munmap()
=3D=3D24233=3D=3D TRANSLATE: 0x1BAB4640 redirected to 0x1B9053DA
where I've read that the munmap here means that debug symbols are unloaded =
and=20
so they cannot be traced... in fact, I've got in example:
=3D=3D24233=3D=3D 12 bytes in 1 blocks are definitely lost in loss record =
23 of 62
=3D=3D24233=3D=3D at 0x1B90506F: operator new(unsigned) (vg_replace_mal=
loc.c:133)
=3D=3D24233=3D=3D by 0x1B955F82: Instruction::fuAccess(unsigned short, =
long long)
(Instruction.cpp:98)
=3D=3D24233=3D=3D by 0x1BC79FB1: ???
=3D=3D24233=3D=3D by 0x1BC77506: ???
=3D=3D24233=3D=3D by 0x1B9518D5: Simulator::run(RunMode, std::ostream&,
std::ostream&) (Simulator.cpp:94)
=3D=3D24233=3D=3D by 0x804A8F2: main (tribes.cpp:293)
BUT: I would like to know what happens on 0x1BC77506 and 0x1BC79FB1!!!
Is it possible?!? How can I avoid debug symbol unloading for my libraries?!?
NOTE: the code without debug symbols is always from my libs... even if I've=
=20
compiled with -g!!!
I load libs using into the simulator core that syscall:
useLib =3D dlopen( libname , RTLD_NOW | RTLD_GLOBAL );
I'm using autotools (with libtools) for compilation.
Thanks in advance,
Patrick
=2D-=20
<--------------------------------------------------------------------------=
=2D------------------------------->
DERKLING
LRU 338214 (http://counter.li.org)
make linux | more > user-firendly=20
<--------------------------------------------------------------------------=
=2D------------------------------->
Patrick Bellasi <derkling_at_users.sourceforge.net>
Student (Politecnico di Milano)
Comp.Sci & Soft.Eng
=20
Contacts:
- Room +39 02 23952621
- Home +39 0342 621043 (week-ends)
- ICQ 344672588
- MSN der...@em...
=20
Privacy:
- GnuPG 0x72ABC1EE (keyserver.linux.it)
pub 1024D/72ABC1EE 2003-12-04 Patrick Bellasi
(Zeus - Spektra System Administrator) <ze...@cd...>
Key fingerprint: 3958 7B5F 36EC D1F8 C752 9589 C3B7 FD49 72AB C1EE
<--------------------------------------------------------------------------=
=2D-------------------------------> =20
|