• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Valgrind running on PowerPc does not report any leaks?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Downloaded the latest version, Valgrind 3.7.0, untarred it to create a folder "Valgrind-3.7.0"
Now, what I did was export gcc for compatibility with the target machine and configured to disable tls and give the host.
Also I made a C Program "leak.c" and its object file "a.out" compiled with the following command

export CC=/usr/local/netd_tools_v1/powerpc/bin/powerpc-linux-gnu-gcc leak.c

so

a. export CC=/usr/local/netd_tools_v1/powerpc/bin/powerpc-linux-gnu-gcc
b. ./configure --prefix=/netd --host=powerpc-linux --disable-tls
c. make
d. make install

- Link the library path and valgrind executable
(go to /netd/lib and do
ln –s /u/netd/lib/valgrind THEN
goto /netd/usr/sbin and
do ln –s /u/netd/bin/valgrind)
Some files were made in "Valgrind-3.7.0" and a folder "netd" was formed.
"netd" contained "lib", "bin", "share" and "include"


(/netd/lib and /netd/usr/sbin are project specific directories)

Copied these files (files in "netd") into the Target Machine and ran Valgrind on the file "a.out" by the following command :

valgrind --log-file=/u/july5.txt --leak-check=summary --tool=memcheck ./a.out


(`/u` is the mount point, `july5` is the log file)

The output shows 0 leaks reported

int main()
{
printf("I am leaking.");
int *a =(int *) malloc(100);
return 0;
}
This ran on linux just fine and reported errors.
If this would have worked, then I would have run Valgrind on project specific processes.


Output of Log File on LINUX for a.out:



[asaini@OTN05 abhaysaini]$ vi xyz.txt

==14843== Memcheck, a memory error detector

==14843== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==14843== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==14843== Command: ./a.out
==14843== Parent PID: 51

61
==14843==
==14843==
==14843== HEAP SUMMARY:
==14843== in use at exit: 100 bytes in 1 blocks
==14843== total heap usage: 1 allocs, 0 frees, 100 bytes allocated
==14843==
==14843== LEAK SUMMARY:
==14843== definitely lost: 100 bytes in 1 blocks
==14843== indirectly lost: 0 bytes in 0 blocks
==14843== possibly lost: 0 bytes in 0 blocks
==14843== still reachable: 0 bytes in 0 blocks
==14843== suppressed: 0 bytes in 0 blocks
==14843== Rerun with --leak-check=full to see details of leaked memory
==14843==
==14843== For counts of detected and suppressed errors, rerun with: -v
==14843== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from 6)


Output of Log File on LINUX for a.out

[00002003-Unknown] Debug> cat leak.txt
==1208== Memcheck, a memory error detector
==1208== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==1208== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==1208== Command: ./a.out
==1208== Parent PID: 1195
==1208==
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /lib/ld-2.3.2.so:
--1208-- Can't make sense of .data section mapping
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /u/Leak/a.out:
--1208-- Can't make sense of .data section mapping
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /u/netd/lib/valgrind/vgpreload_core-ppc32-linux.so:
--1208-- Can't make sense of .eh_frame section mapping
==1208== Use of uninitialised value of size 4
==1208== at 0x4011E08: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4016517: ???
==1208== by 0x400917F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4005083: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4006967: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002C0F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /u/netd/lib/valgrind/vgpreload_memcheck-ppc32-linux.so:
--1208-- Can't make sense of .eh_frame section mapping
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /lib/libc-2.3.2.so:
--1208-- Can't make sense of .data section mapping
==1208== Use of uninitialised value of size 4
==1208== at 0x4011CC0: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x7: ???
==1208== by 0x400AB33: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002ECB: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x4011D38: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x7: ???
==1208== by 0x400AB33: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002ECB: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x4011D64: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x7: ???
==1208== by 0x400AB33: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002ECB: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400B958: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400B9E8: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400B9F4: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BA04: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BA38: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BA4C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BAC8: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BAF4: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB04: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB20: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB2C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB6C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BBC0: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BBCC: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BBE0: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB0C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208==
==1208== HEAP SUMMARY:
==1208== in use at exit: 0 bytes in 0 blocks
==1208== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==1208==
==1208== All heap blocks were freed -- no leaks are possible
==1208==
==1208== For counts of detected and suppressed errors, rerun with: -v
==1208== Use --track-origins=yes to see where uninitialised values come from
==1208== ERROR SUMMARY: 40 errors from 20 contexts (suppressed: 3908 from 442)






OUTPUT of Log File on PowerPc

[00002003-Unknown] Debug> cat leak.txt
==1208== Memcheck, a memory error detector
==1208== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==1208== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==1208== Command: ./a.out
==1208== Parent PID: 1195
==1208==
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /lib/ld-2.3.2.so:
--1208-- Can't make sense of .data section mapping
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /u/Leak/a.out:
--1208-- Can't make sense of .data section mapping
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /u/netd/lib/valgrind/vgpreload_core-ppc32-linux.so:
--1208-- Can't make sense of .eh_frame section mapping
==1208== Use of uninitialised value of size 4
==1208== at 0x4011E08: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4016517: ???
==1208== by 0x400917F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4005083: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4006967: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002C0F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /u/netd/lib/valgrind/vgpreload_memcheck-ppc32-linux.so:
--1208-- Can't make sense of .eh_frame section mapping
--1208-- WARNING: Serious error when reading debug info
--1208-- When reading debug info from /lib/libc-2.3.2.so:
--1208-- Can't make sense of .data section mapping
==1208== Use of uninitialised value of size 4
==1208== at 0x4011CC0: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x7: ???
==1208== by 0x400AB33: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002ECB: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x4011D38: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x7: ???
==1208== by 0x400AB33: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002ECB: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x4011D64: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x7: ???
==1208== by 0x400AB33: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4002ECB: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400DF03: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x4001BD3: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400215F: ??? (in /lib/ld-2.3.2.so)
==1208== by 0x400EF2B: ??? (in /lib/ld-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400B958: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400B9E8: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400B9F4: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BA04: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BA38: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BA4C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BAC8: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BAF4: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB04: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB20: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB2C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB6C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BBC0: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BBCC: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BBE0: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208== Use of uninitialised value of size 4
==1208== at 0x400BB0C: ??? (in /lib/ld-2.3.2.so)
==1208== by 0xFE8ABE7: ??? (in /lib/libc-2.3.2.so)
==1208== by 0xFE7278B: ??? (in /lib/libc-2.3.2.so)
==1208==
==1208==
==1208== HEAP SUMMARY:
==1208== in use at exit: 0 bytes in 0 blocks
==1208== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==1208==
==1208== All heap blocks were freed -- no leaks are possible
==1208==
==1208== For counts of detected and suppressed errors, rerun with: -v
==1208== Use --track-origins=yes to see where uninitialised values come from
==1208== ERROR SUMMARY: 40 errors from 20 contexts (suppressed: 3908 from 442)



 
Rancher
Posts: 280
VI Editor C++ Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pure and utter speculation here -- When you compiled, did you enable optimisations?

Try and use the allocated memory, e.g.,

Note that I haven't run this on Valgrind myself, and just guessing that this would show the leak.

hope this helps,
- Anand
 
You get good luck from rubbing the belly of a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic