|
From: Piotr A. <ad...@gm...> - 2011-03-01 09:43:00
|
Hello,
I built Valgrind 3.6.0 for ppc architecture and probably something
went wrong because every time I try to analyze my applications on ppc,
results are completely different than results from x86. I am going to
give you an example.
Let's consider this simple application:
#include <iostream>
int main()
{
char * array_char = new char[9];
for (int i=0; i<11; i++)
{
array_char[i]= 'a';
}
delete [] array_char;
char * array_char1 = new char[100];
array_char[4] = 'b';
return 0;
}
The result from x86:
==1961== Memcheck, a memory error detector
==1961== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==1961== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==1961== Command: ./a.out
==1961== Parent PID: 1593
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x401611E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4007020: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400113E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400D7E5: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000FF6: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400334E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x401612D: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4007020: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400113E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400D7E5: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000FF6: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400334E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x401613C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4007020: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400113E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400D7E5: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000FF6: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400334E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x40162CC: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4007020: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400113E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400D7E5: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000FF6: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400334E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x40162CC: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4005967: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x40070D3: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400113E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400D7E5: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000FF6: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x400334E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x400B187: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4003150: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x400AE7F: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4003150: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x400B1EA: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4003150: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x400A54E: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4003083: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x400A556: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4003083: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Conditional jump or move depends on uninitialised value(s)
==1961== at 0x400AE7F: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4003083: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4014076: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000C6C: ??? (in /lib/ld-2.11.1.so)
==1961== by 0x4000856: ??? (in /lib/ld-2.11.1.so)
==1961==
==1961== Invalid write of size 1
==1961== at 0x804862F: main (in /home/piotr/Programowanie/test/a.out)
==1961== Address 0x42ce031 is 0 bytes after a block of size 9 alloc'd
==1961== at 0x40235A6: operator new[](unsigned int) (vg_replace_malloc.c:299)
==1961== by 0x8048618: main (in /home/piotr/Programowanie/test/a.out)
==1961==
==1961== Invalid write of size 1
==1961== at 0x804866D: main (in /home/piotr/Programowanie/test/a.out)
==1961== Address 0x42ce02c is 4 bytes inside a block of size 9 free'd
==1961== at 0x4023F5E: operator delete[](void*) (vg_replace_malloc.c:409)
==1961== by 0x8048655: main (in /home/piotr/Programowanie/test/a.out)
==1961==
==1961==
==1961== HEAP SUMMARY:
==1961== in use at exit: 100 bytes in 1 blocks
==1961== total heap usage: 2 allocs, 1 frees, 109 bytes allocated
==1961==
==1961== LEAK SUMMARY:
==1961== definitely lost: 100 bytes in 1 blocks
==1961== indirectly lost: 0 bytes in 0 blocks
==1961== possibly lost: 0 bytes in 0 blocks
==1961== still reachable: 0 bytes in 0 blocks
==1961== suppressed: 0 bytes in 0 blocks
==1961== Rerun with --leak-check=full to see details of leaked memory
==1961==
==1961== For counts of detected and suppressed errors, rerun with: -v
==1961== Use --track-origins=yes to see where uninitialised values come from
==1961== ERROR SUMMARY: 25 errors from 13 contexts (suppressed: 0 from 0)
and the result from ppc:
(1) ==21287== Memcheck, a memory error detector
(1) ==21287== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
(1) ==21287== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
(1) ==21287== Command: ./test_val
(1) ==21287==
(1) ==21287== Conditional jump or move depends on uninitialised value(s)
(1) ==21287== at 0xFD3F414: strcmp (strcmp.S:67)
(1) ==21287== by 0xFCF92EB: setlocale (setlocale.c:228)
(1) ==21287== by 0xFF30D8B: std::locale::_Impl::_Impl(unsigned int)
(in /usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF3176B: ??? (in /usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF317EB: ??? (in /usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF31873: std::locale::locale() (in
/usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF2EC97: std::ios_base::Init::Init() (in
/usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0x100008C3:
__static_initialization_and_destruction_0(int, int) (in
/ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x10000953: global constructors keyed to main (in
/ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x10000CB7: ??? (in /ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x100004A3: ??? (in /ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x100009E7: __libc_csu_init (elf-init.c:77)
(1) ==21287==
(1) ==21287== Conditional jump or move depends on uninitialised value(s)
(1) ==21287== at 0xFD3F41C: strcmp (strcmp.S:73)
(1) ==21287== by 0xFCF92EB: setlocale (setlocale.c:228)
(1) ==21287== by 0xFF30D8B: std::locale::_Impl::_Impl(unsigned int)
(in /usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF3176B: ??? (in /usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF317EB: ??? (in /usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF31873: std::locale::locale() (in
/usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0xFF2EC97: std::ios_base::Init::Init() (in
/usr/lib/libstdc++.so.6.0.3)
(1) ==21287== by 0x100008C3:
__static_initialization_and_destruction_0(int, int) (in
/ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x10000953: global constructors keyed to main (in
/ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x10000CB7: ??? (in /ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x100004A3: ??? (in /ffs/fs3/valgrind/bin/test_val)
(1) ==21287== by 0x100009E7: __libc_csu_init (elf-init.c:77)
(1) ==21287==
(1) ==21287==
(1) ==21287== HEAP SUMMARY:
(1) ==21287== in use at exit: 0 bytes in 0 blocks
(1) ==21287== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
(1) ==21287==
(1) ==21287== All heap blocks were freed -- no leaks are possible
(1) ==21287==
(1) ==21287== For counts of detected and suppressed errors, rerun with: -v
(1) ==21287== Use --track-origins=yes to see where uninitialised
values come from
(1) ==21287== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 7 from 5)
Could you tell me why results from ppc target are different ? What
could I do wrong ?
--
Best Regards
Piotr Adaszynski
|
|
From: Bart V. A. <bva...@ac...> - 2011-03-02 17:38:55
|
2011/3/1 Piotr Adaszyński <ad...@gm...> > > [ ... ] > Could you tell me why results from ppc target are different ? What > could I do wrong ? Strange. Does the output of "make -s regtest" on your setup match that of the nightly PPC build (available in the valgrind-developers mailing list archives) ? Bart. |
|
From: Piotr A. <ad...@gm...> - 2011-03-09 21:33:54
|
> > Strange. Does the output of "make -s regtest" on your setup match that > of the nightly PPC build (available in the valgrind-developers mailing > list archives) ? > Unfortunately, it's impossible to run "make -s regtest" and perform regression tests on my target platform because of limited resources (no make, no perl etc.). Maybe the problem here is my processor ? It's MPC8548 (ppc e500) and I have to use gcc 3.4.x . -- Piotr |
|
From: Bart V. A. <bva...@ac...> - 2011-03-10 11:29:28
|
2011/3/9 Piotr Adaszyński <ad...@gm...> > > > > Strange. Does the output of "make -s regtest" on your setup match that > > of the nightly PPC build (available in the valgrind-developers mailing > > list archives) ? > > > > Unfortunately, it's impossible to run "make -s regtest" and perform > regression tests on my target platform because of limited resources > (no make, no perl etc.). > > Maybe the problem here is my processor ? It's MPC8548 (ppc e500) and I > have to use gcc 3.4.x . > gcc 3.4 should be fine, but don't think the PPC e500 is already supported by Valgrind. Bart. |
|
From: Julian S. <js...@ac...> - 2011-04-05 10:35:55
|
On Tuesday, March 01, 2011, Piotr Adaszyński wrote:
> Hello,
> I built Valgrind 3.6.0 for ppc architecture and probably something
> went wrong because every time I try to analyze my applications on ppc,
> results are completely different than results from x86. I am going to
> give you an example.
> Let's consider this simple application:
> #include <iostream>
> int main()
> {
> char * array_char = new char[9];
> for (int i=0; i<11; i++)
> {
> array_char[i]= 'a';
> }
> delete [] array_char;
> char * array_char1 = new char[100];
> array_char[4] = 'b';
> return 0;
> }
Hmm, that's strange. Here's what I get using the svn trunk
on 32-bit ppc (Debian 6.0.1):
==24922== Memcheck, a memory error detector
==24922== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==24922== Using Valgrind-3.7.0.SVN and LibVEX; rerun with -h for copyright
info
==24922== Command: ./oor
==24922==
==24922== Invalid write of size 1
==24922== at 0x10000690: main (oor.cpp:7)
==24922== Address 0x4035031 is 0 bytes after a block of size 9 alloc'd
==24922== at 0xFFB939C: operator new[](unsigned int)
(vg_replace_malloc.c:299)
==24922== by 0x10000667: main (oor.cpp:4)
==24922==
==24922== Invalid write of size 1
==24922== at 0x100006F4: main (oor.cpp:11)
==24922== Address 0x403502c is 4 bytes inside a block of size 9 free'd
==24922== at 0xFFB7DD0: operator delete[](void*) (vg_replace_malloc.c:409)
==24922== by 0x100006D3: main (oor.cpp:9)
==24922==
==24922==
==24922== HEAP SUMMARY:
==24922== in use at exit: 100 bytes in 1 blocks
==24922== total heap usage: 2 allocs, 1 frees, 109 bytes allocated
==24922==
==24922== LEAK SUMMARY:
==24922== definitely lost: 100 bytes in 1 blocks
==24922== indirectly lost: 0 bytes in 0 blocks
==24922== possibly lost: 0 bytes in 0 blocks
==24922== still reachable: 0 bytes in 0 blocks
==24922== suppressed: 0 bytes in 0 blocks
==24922== Rerun with --leak-check=full to see details of leaked memory
==24922==
==24922== For counts of detected and suppressed errors, rerun with: -v
==24922== ERROR SUMMARY: 3 errors from 2 contexts (suppressed: 5 from 3)
|