Valgrind may not compatible to gcc(4.9), Why?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Valgrind may not compatible to gcc(4.9), Why?

Wuweijia

I compile a demo testcase with gcc 4.9 , run it in aarch64 server with valgrind . valgrind report there is some memory error as below. I do not think that it maybe a problem.

 

==6494== 1 errors in context 1 of 4:

==6494== Use of uninitialised value of size 4

==6494==    at 0x1089F8: main (testAlgo.cpp:84)

==6494==

==6494==

==6494== 1 errors in context 2 of 4:

==6494== Use of uninitialised value of size 4

==6494==    at 0x10898E: fun() (testAlgo.cpp:67)

==6494==    by 0x1089D9: main (testAlgo.cpp:80)

==6494==

==6494==

==6494== 2 errors in context 3 of 4:

==6494== Invalid write of size 4

==6494==    at 0x10885C: A::A(int const&) (testAlgo.cpp:36)

==6494==    by 0x108973: fun() (testAlgo.cpp:64)

==6494==    by 0x1089D9: main (testAlgo.cpp:80)

==6494==  Address 0xfed715b8 is on thread 1's stack

==6494==  16 bytes below stack pointer

 

 

And then I compile a demo testcase with clang, run it in aarch64 server with valgrind . valgrind report there is no memory error

 

 

 

Valgrind version: valgrind-3.11.0.SVN.aosp

 


------------------------------------------------------------------------------

_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

testcase.rar (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Valgrind may not compatible to gcc(4.9), Why?

John Reiser
On 11/29/2016 06:48 PM, Wuweijia wrote:
> I compile a demo testcase with gcc 4.9 , run it in aarch64 server with valgrind . valgrind report there is some memory error as below. I do not think that it maybe a problem.

The testAlgo.cpp that was in the attached testcase.rar compiles to less
than 2KB of code using gcc-4.9.2 on a RaspberryPi3 running in 32-bit mode.
So you should run "g++ -S testAlgo.cpp" then look at testAlgo.s and
analyze the generated code.  Or, run "objdump -d ./a.out" on the binary.
Anyway: "g++ testAlgo.cpp; valgrind-3.12 ./a.out" gave no complaints.


------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Loading...