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) ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users