From: venkat k. <ven...@gm...> - 2016-04-12 12:49:20
|
> > I have compiled the above program using below commands > > arm-linux-gnueabi-gcc -o test-arm -g test.c > arm-linux-gnueabi-gcc -o test-arm-static -g test.c > > when i am running in my ARM architecture with valgrind > So that looks like you are cross compiling? But you are actually running valgrind on the target machine, not on the host where you do the compil? -----> Yes i cross compiled both test app and valgrind, then i copied to target machine. I cross compiled valgrind like this ./configure --host=arm-linux-gnueabi --target=arm-linux-gnueabi 1) valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./test-arm > > valgrind: m_ume.c: can't open interpreter > Well that means whatever ELF interpreter your program is declaring can't be opened by valgrind. Run "file ./test-arm" and see what interpreter it says it is using. 2) /writable/valgrind/bin/valgrind --tool=memcheck --leak-check=yes > --show-reachable=yes ./test-arm-static > > ==8118== Memcheck, a memory error detector ==8118== Copyright (C) > 2002-2013, and GNU GPL'd, by Julian Seward et al. ==8118== Using > Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==8118== > Command: ./test-arm-static ==8118== Enter number of elements: 1 Enter > elements of array: 1 Sum=1==8118== ==8118== HEAP SUMMARY: ==8118== in > use at exit: 0 bytes in 0 blocks ==8118== total heap usage: 0 allocs, 0 > frees, 0 bytes allocated ==8118== ==8118== All heap blocks were freed -- > no leaks are possible ==8118== ==8118== For counts of detected and > suppressed errors, rerun with: -v ==8118== ERROR SUMMARY: 0 errors from > 0 contexts (suppressed: 0 from 0) > > In both the cases i didn't get LEAK SUMMERY , but in my linux machine i > am able to get the valgrind report. can you suggest me the how to > resolve this on ? > You won't be able to get a leak report for a statically linked program because valgrind won't be able to intercept calls to malloc and free. Thanks, Venkateswarlu.K On Tue, Apr 12, 2016 at 4:46 PM, Tom Hughes <to...@co...> wrote: > On 12/04/16 11:52, venkat konamki wrote: > > I have compiled the above program using below commands >> >> arm-linux-gnueabi-gcc -o test-arm -g test.c >> arm-linux-gnueabi-gcc -o test-arm-static -g test.c >> >> when i am running in my ARM architecture with valgrind >> > > So that looks like you are cross compiling? But you are actually running > valgrind on the target machine, not on the host where you do the compil? > > 1) valgrind --tool=memcheck --leak-check=yes --show-reachable=yes >> ./test-arm >> >> valgrind: m_ume.c: can't open interpreter >> > > Well that means whatever ELF interpreter your program is declaring can't > be opened by valgrind. Run "file ./test-arm" and see what interpreter it > says it is using. > > 2) /writable/valgrind/bin/valgrind --tool=memcheck --leak-check=yes >> --show-reachable=yes ./test-arm-static >> >> ==8118== Memcheck, a memory error detector ==8118== Copyright (C) >> 2002-2013, and GNU GPL'd, by Julian Seward et al. ==8118== Using >> Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==8118== >> Command: ./test-arm-static ==8118== Enter number of elements: 1 Enter >> elements of array: 1 Sum=1==8118== ==8118== HEAP SUMMARY: ==8118== in >> use at exit: 0 bytes in 0 blocks ==8118== total heap usage: 0 allocs, 0 >> frees, 0 bytes allocated ==8118== ==8118== All heap blocks were freed -- >> no leaks are possible ==8118== ==8118== For counts of detected and >> suppressed errors, rerun with: -v ==8118== ERROR SUMMARY: 0 errors from >> 0 contexts (suppressed: 0 from 0) >> >> In both the cases i didn't get LEAK SUMMERY , but in my linux machine i >> am able to get the valgrind report. can you suggest me the how to >> resolve this on ? >> > > You won't be able to get a leak report for a statically linked program > because valgrind won't be able to intercept calls to malloc and free. > > Tom > > -- > Tom Hughes (to...@co...) > http://compton.nu/ > |