Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Valgrind running on PowerPc does not report any leaks?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
abhay192
n00b
n00b


Joined: 11 Jul 2012
Posts: 1
Location: Gurgaon

PostPosted: Wed Jul 11, 2012 8:32 am    Post subject: Valgrind running on PowerPc does not report any leaks? Reply with quote

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 memory leaks.
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 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==

... snip ...

==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)
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Wed Jul 11, 2012 4:35 pm    Post subject: Reply with quote

Have you done what was requested by valgrind ebuild at postinst stage?
Code:

pkg_postinst() {
   ewarn "Valgrind will not work if glibc does not have debug symbols."
   ewarn "To fix this you can add splitdebug to FEATURES in make.conf"
   ewarn "and remerge glibc.  See:"
   ewarn "https://bugs.gentoo.org/show_bug.cgi?id=214065"
   ewarn "https://bugs.gentoo.org/show_bug.cgi?id=274771"
   ewarn "https://bugs.gentoo.org/show_bug.cgi?id=388703"
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum