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

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to