|
From: shankha <sha...@gm...> - 2007-01-16 08:26:23
|
Hi,
i compiled the test program given in your user manual
#include <stdio.h>
#include <stdlib.h>
void f(void)
{
int * x = malloc(10 * sizeof(int));
x[10] = 0;
}
int main()
{
f();
return 0;
}
i compiled it using gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)
gcc -g -o test test.c( debug option is there)
then i did
valgrind -v test
the output :
==19628== Memcheck, a memory error detector.
==19628== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==19628== Using LibVEX rev 1606, a library for dynamic binary translation.
==19628== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==19628== Using valgrind-3.2.0, a dynamic binary instrumentation framework.
==19628== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==19628==
--19628-- Command line
--19628-- test
--19628-- Startup, with flags:
--19628-- -v
--19628-- Contents of /proc/version:
--19628-- Linux version 2.6.9-34.EL (bhc...@hs...)
(gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)) #1 Fri Feb 24 16:44:51 EST
2006
--19628-- Arch and hwcaps: X86, x86-sse1-sse2
--19628-- Valgrind library directory:
/home/shankha/softwares/valgrind/valgrind/lib/valgrind
--19628-- Reading syms from /lib/ld-2.3.4.so (0x779000)
--19628-- Reading syms from /usr/bin/test (0x8048000)
--19628-- object doesn't have a symbol table
--19628-- Reading syms from
/home/shankha/softwares/valgrind/valgrind/lib/valgrind/x86-linux/memcheck
(0x38000000)
--19628-- object doesn't have a dynamic symbol table
--19628-- Reading suppressions file:
/home/shankha/softwares/valgrind/valgrind/lib/valgrind/default.supp
--19628-- REDIR: 0x78AF70 (index) redirected to 0x38021BDF
(vgPlain_x86_linux_REDIR_FOR_index)
--19628-- Reading syms from
/home/shankha/softwares/valgrind/valgrind/lib/valgrind/x86-linux/vgpreload_core.so
(0x4000000)
--19628-- Reading syms from
/home/shankha/softwares/valgrind/valgrind/lib/valgrind/x86-linux/vgpreload_memcheck.so
(0x4003000)
==19628== WARNING: new redirection conflicts with existing -- ignoring it
--19628-- new: 0x0078AF70 (index ) R-> 0x04005EF0 index
--19628-- REDIR: 0x78B110 (strlen) redirected to 0x4006134 (strlen)
--19628-- Reading syms from /lib/tls/libc-2.3.4.so (0x796000)
--19628-- REDIR: 0x7FF330 (rindex) redirected to 0x4005E20 (rindex)
--19628-- REDIR: 0x7FE9F0 (strcmp) redirected to 0x40063D4 (strcmp)
--19628-- REDIR: 0x7FEF50 (strlen) redirected to 0x4006118 (strlen)
--19628-- REDIR: 0x7FF150 (strncmp) redirected to 0x4006384 (strncmp)
--19628-- REDIR: 0x7FE880 (index) redirected to 0x4005ED0 (index)
--19628-- REDIR: 0x800FD0 (strchrnul) redirected to 0x4006930 (strchrnul)
--19628-- REDIR: 0x7FA030 (malloc) redirected to 0x4004474 (malloc)
--19628-- REDIR: 0x8006A0 (memcpy) redirected to 0x40064A0 (memcpy)
--19628-- REDIR: 0x7F7F60 (free) redirected to 0x400500D (free)
--19628-- REDIR: 0x800180 (memset) redirected to 0x40068BC (memset)
==19628==
==19628== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 14 from 1)
--19628--
--19628-- supp: 14 Ubuntu-stripped-ld.so
==19628== malloc/free: in use at exit: 0 bytes in 0 blocks.
==19628== malloc/free: 30 allocs, 30 frees, 1,985 bytes allocated.
==19628==
==19628== All heap blocks were freed -- no leaks are possible.
--19628-- memcheck: sanity checks: 0 cheap, 1 expensive
--19628-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--19628-- memcheck: auxmaps: 0 searches, 0 comparisons
--19628-- memcheck: SMs: n_issued = 11 (176k, 0M)
--19628-- memcheck: SMs: n_deissued = 0 (0k, 0M)
--19628-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M)
--19628-- memcheck: SMs: max_undefined = 0 (0k, 0M)
--19628-- memcheck: SMs: max_defined = 49 (784k, 0M)
--19628-- memcheck: SMs: max_non_DSM = 11 (176k, 0M)
--19628-- memcheck: max sec V bit nodes: 1 (0k, 0M)
--19628-- memcheck: set_sec_vbits8 calls: 1 (new: 1, updates: 0)
--19628-- memcheck: max shadow mem size: 480k, 0M
--19628-- translate: fast SP updates identified: 1,569 ( 88.6%)
--19628-- translate: generic_known SP updates identified: 101 ( 5.7%)
--19628-- translate: generic_unknown SP updates identified: 100 ( 5.6%)
--19628-- tt/tc: 3,738 tt lookups requiring 3,769 probes
--19628-- tt/tc: 3,738 fast-cache updates, 3 flushes
--19628-- transtab: new 1,770 (36,730 -> 611,791; ratio 166:10) [0
scs]
--19628-- transtab: dumped 0 (0 -> ??)
--19628-- transtab: discarded 6 (144 -> ??)
--19628-- scheduler: 32,068 jumps (bb entries).
--19628-- scheduler: 0/2,069 major/minor sched events.
--19628-- sanity: 1 cheap, 1 expensive checks.
--19628-- exectx: 30,011 lists, 26 contexts (avg 0 per list)
--19628-- exectx: 74 searches, 48 full compares (648 per 1000)
--19628-- exectx: 0 cmp2, 54 cmp4, 0 cmpAll
but your manual says i should get something like this
but your manual says i should get a different report. There is no
information about the pointer x whose contents are not getting freed.
Thanks.
|
|
From: Adam S. <ad...@sp...> - 2007-01-16 08:37:21
|
shankha wrote:
> Hi,
> i compiled the test program given in your user manual
> i compiled it using gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)
>
> gcc -g -o test test.c( debug option is there)
>
> then i did
> valgrind -v test
>
> the output :
This is the important line:
> --19628-- Reading syms from /usr/bin/test (0x8048000)
You needed to have done "valgrind -v ./test" to run the "test" program
in the current directory, and not the one in your path.
Never call programs "test" under Unix/Linux - you nearly always get
/usr/bin/test by accident and wonder what the !?*^ is going on. :)
Adam
--
To describe religions as mind viruses is sometimes interpreted as
contemptuous or even hostile. It is both.
-- Richard Dawkins - "A Devil's Chaplain"
|
|
From: Patrick O. <pat...@in...> - 2007-01-16 08:39:57
|
On Tue, 2007-01-16 at 13:55 +0530, shankha wrote: > i compiled it using gcc version 3.4.5 20051201 (Red Hat 3.4.5-2) > > gcc -g -o test test.c( debug option is there) > > then i did > valgrind -v test If you don't have "." in your PATH variable, then valgrind will pick up /usr/bin/test instead of ./test. Try "valgrind ./test". -- Best Regards, Patrick Ohly The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter. |
|
From: shankha <sha...@gm...> - 2007-01-16 10:24:58
|
Hi Patrick, Thanks .. It runs properly now. On 1/16/07, Patrick Ohly <pat...@in...> wrote: > > On Tue, 2007-01-16 at 13:55 +0530, shankha wrote: > > i compiled it using gcc version 3.4.5 20051201 (Red Hat 3.4.5-2) > > > > gcc -g -o test test.c( debug option is there) > > > > then i did > > valgrind -v test > > If you don't have "." in your PATH variable, then valgrind will pick > up /usr/bin/test instead of ./test. Try "valgrind ./test". > > -- > Best Regards, Patrick Ohly > > The content of this message is my personal opinion only and although > I am an employee of Intel, the statements I make here in no way > represent Intel's position on the issue, nor am I authorized to speak > on behalf of Intel on this matter. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: Paul F. <pa...@fr...> - 2007-01-16 08:57:38
|
Quoting shankha <sha...@gm...>: > then i did > valgrind -v test What happens if you do valgrind -v ./test ? (I'm not sure if it makes any difference). A+ Paul |