On 2/4/2016 1:30 PM, kevin.lemorzadec wrote:
Hi all,
I am having troubles understanding the outputs generated by valgrind.
I compile my fortran code with the following flags: -c -tp x64 -r8
-i4 -Mnolre -Mnovect -Mnounroll -g
I start it using valgrind doing: valgrind --tool=memcheck
--leak-check=full ./rsiNE 54 2002SK1 NAEUa
rsiNE is a csh script starts the code with some parameters and file
names doing:
#!/bin/csh
./paleonSG<< EOF >& out.pal
4 1 1
02
...
...
...
EOF
You are seeing messages from the execution of the shell (/bin/tcsh is a
common implementation of the C shell), not the FORTRAN program launched
inside. Try adding the valgrind parameters to the front of the paleonSG
command line within the script:
#!/bin/csh
valgrind --tool=memcheck --leak-check=full ./paleonSG<< EOF >& out.pal
...
By default valgrind does not trace into spawned programs, and there is
no reason for you to look for memory leaks in tcsh unless you are a tcsh
developer.
I use Valgrind-3.5.0 and added the apport-valgrind package
The output results are:
==4880== HEAP SUMMARY:
==4880== in use at exit: 174,555 bytes in 2,130 blocks
==4880== total heap usage: 53,125 allocs, 50,995 frees, 16,456,811
bytes allocated
==4880==
==4880== 4 bytes in 1 blocks are definitely lost in loss record 7 of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x439361: ??? (in /bin/tcsh)
==4880== by 0x43F964: ??? (in /bin/tcsh)
==4880== by 0x415F14: ??? (in /bin/tcsh)
==4880== by 0x412012: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x410EBE: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880==
==4880== 8 bytes in 1 blocks are definitely lost in loss record 18 of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41B33B: ??? (in /bin/tcsh)
==4880== by 0x404ABC: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x404D84: ??? (in /bin/tcsh)
==4880== by 0x406910: ??? (in /bin/tcsh)
==4880== by 0x3522A1D9F3: (below main) (in /lib64/libc-2.5.so
<http://libc-2.5.so>)
==4880==
==4880== 8 bytes in 1 blocks are definitely lost in loss record 19 of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41B33B: ??? (in /bin/tcsh)
==4880== by 0x404ABC: ??? (in /bin/tcsh)
==4880== by 0x4067B9: ??? (in /bin/tcsh)
==4880== by 0x3522A1D9F3: (below main) (in /lib64/libc-2.5.so
<http://libc-2.5.so>)
==4880==
==4880== 8 bytes in 1 blocks are definitely lost in loss record 20 of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41B33B: ??? (in /bin/tcsh)
==4880== by 0x404ABC: ??? (in /bin/tcsh)
==4880== by 0x41677B: ??? (in /bin/tcsh)
==4880== by 0x405FD9: ??? (in /bin/tcsh)
==4880== by 0x3522A1D9F3: (below main) (in /lib64/libc-2.5.so
<http://libc-2.5.so>)
==4880==
==4880== 16 bytes in 1 blocks are definitely lost in loss record 120
of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41AFC8: ??? (in /bin/tcsh)
==4880== by 0x410C43: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x404A42: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880==
==4880== 24 bytes in 3 blocks are definitely lost in loss record 240
of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41B33B: ??? (in /bin/tcsh)
==4880== by 0x404ABC: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x404A42: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880==
==4880== 104 bytes in 13 blocks are definitely lost in loss record 493
of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41B33B: ??? (in /bin/tcsh)
==4880== by 0x404ABC: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x406734: ??? (in /bin/tcsh)
==4880== by 0x3522A1D9F3: (below main) (in /lib64/libc-2.5.so
<http://libc-2.5.so>)
==4880==
==4880== 920 bytes in 3 blocks are definitely lost in loss record 518
of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41AFC8: ??? (in /bin/tcsh)
==4880== by 0x410C43: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F7D8: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x404A42: ??? (in /bin/tcsh)
==4880==
==4880== 1,288 bytes in 4 blocks are definitely lost in loss record
522 of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x4392EA: ??? (in /bin/tcsh)
==4880== by 0x41AFC8: ??? (in /bin/tcsh)
==4880== by 0x410C43: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F7D8: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x404D84: ??? (in /bin/tcsh)
==4880==
==4880== 2,200 (800 direct, 1,400 indirect) bytes in 1 blocks are
definitely lost in loss record 528 of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x439361: ??? (in /bin/tcsh)
==4880== by 0x415338: ??? (in /bin/tcsh)
==4880== by 0x415E6D: ??? (in /bin/tcsh)
==4880== by 0x4133F1: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x406734: ??? (in /bin/tcsh)
==4880== by 0x3522A1D9F3: (below main) (in /lib64/libc-2.5.so
<http://libc-2.5.so>)
==4880==
==4880== 8,148 (1,040 direct, 7,108 indirect) bytes in 1 blocks are
definitely lost in loss record 542 of 548
==4880== at 0x4A0610C: malloc (vg_replace_malloc.c:195)
==4880== by 0x439361: ??? (in /bin/tcsh)
==4880== by 0x43FF0A: ??? (in /bin/tcsh)
==4880== by 0x411C0F: ??? (in /bin/tcsh)
==4880== by 0x412020: ??? (in /bin/tcsh)
==4880== by 0x41FD30: ??? (in /bin/tcsh)
==4880== by 0x41F827: ??? (in /bin/tcsh)
==4880== by 0x403BC4: ??? (in /bin/tcsh)
==4880== by 0x40470B: ??? (in /bin/tcsh)
==4880== by 0x404931: ??? (in /bin/tcsh)
==4880== by 0x404D84: ??? (in /bin/tcsh)
==4880== by 0x406910: ??? (in /bin/tcsh)
==4880==
==4880== LEAK SUMMARY:
==4880== definitely lost: 4,220 bytes in 30 blocks
==4880== indirectly lost: 8,508 bytes in 143 blocks
==4880== possibly lost: 0 bytes in 0 blocks
==4880== still reachable: 161,827 bytes in 1,957 blocks
==4880== suppressed: 0 bytes in 0 blocks
==4880== Reachable blocks (those to which a pointer was found) are not
shown.
==4880== To see them, rerun with: --leak-check=full --show-reachable=yes
==4880==
==4880== For counts of detected and suppressed errors, rerun with: -v
==4880== ERROR SUMMARY: 11 errors from 11 contexts (suppressed: 4 from 4)
Any idea of what I am doing wrong??
Thanks in advance for any clarification.
--
Kevin Le Morzadec - Ph.D. candidate
Dept of Physics and Physical Oceanography,
Memorial University of Newfoundland, Canada
Tel 709-864-8654
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users
--
David Chapman dcchap...@acm.org
Chapman Consulting -- San Jose, CA
Software Development Done Right.
www.chapman-consulting-sj.com
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users