|
From: Sarcar, S. C (MED) <Sho...@me...> - 2003-06-17 15:44:28
|
I am a new Valgrind user When I run Valgrind with any program (ls, ps, even my own HEllo , World), Valgrind displays messages. But when I run this with a particular program (I call it 've'), the program executes but Valgrind prints out no messages at all. The only outputs are the printfs from the executable (ve). I have tried running with the -v option but to no avail. Shourya |
|
From: Nicholas N. <nj...@ca...> - 2003-06-17 15:56:04
|
On Tue, 17 Jun 2003, Sarcar, Shourya C (MED) wrote:
> When I run Valgrind with any program (ls, ps, even my own HEllo ,
> World), Valgrind displays messages.
> But when I run this with a particular program (I call it 've'), the
> program executes but Valgrind prints out no messages at all.
> The only outputs are the printfs from the executable (ve).
>
> I have tried running with the -v option but to no avail.
From valgrind/FAQ.txt:
Q5. I try running "valgrind my_program", but my_program runs normally,
and Valgrind doesn't emit any output at all.
A5. Is my_program statically linked? Valgrind doesn't work with
statically linked binaries. my_program must rely on at least one
shared object. To determine if a my_program is statically linked,
run:
ldd my_program
It will show what shared objects my_program relies on, or say:
not a dynamic executable
if my_program is statically linked.
N
|
|
From: Olly B. <ol...@su...> - 2003-06-17 16:01:36
Attachments:
valgrind-static.patch
|
On Tue, Jun 17, 2003 at 10:04:15AM -0500, Sarcar, Shourya C (MED) wrote:
> But when I run this with a particular program (I call it 've'), the
> program executes but Valgrind prints out no messages at all.
> The only outputs are the printfs from the executable (ve).
This is FAQ #5.
It probably means 've' is statically linked. Try running ldd on ve:
ldd ve
This will say "not a dynamic executable" if ve is statically linked. In
order to hook into execution, valgrind uses LD_PRELOAD tricks which only
work for dynamically linked executables.
Which reminds me that I wrote a quick patch to add a test for this case
(attached). Not sure if it's worth the overhead or not, but I might as
well post it rather than leaving it sitting on my harddisk...
Cheers,
Olly
|