Valgrind not working properly on Openwrt on imx6 platform

494 views Asked by At

By default valgrind is not selectable in menuconfig for IMX6 platform when crosscompiling for Openwrt, but this platform is based on ARM Cortex A9 core which is implementing ARMv7 architecture. This architecture is supported by valgrind, so I made little changes in Makefile of valgrind package to make the package selectable from menuconfig and compilable.
I'm using GCC-5.3 and uClibc-0.9.33.2 (can't proceed to musl for now because it is very expensive).
The problem is that valgrind is not working properly even for /bin/true:

valgrind --leak-check=yes /bin/true

Output:

...
==24113== Invalid read of size 4
==24113==    at 0x4000E54: ??? (in /lib/ld-uClibc-0.9.33.2.so)
==24113==  Address 0x7d99c9f4 is on thread 1's stack
==24113==  20 bytes below stack pointer
...
==24113== For counts of detected and suppressed errors, rerun with: -v
==24113== ERROR SUMMARY: 64 errors from 4 contexts (suppressed: 0 from 0)
1

There are 1 answers

0
K. Koovalsky On

As a workaround --ignore-range-below=44-13 valgrind parameter could be used.
As John Reiser said:

Using --ignore-range-below-sp does reduce the noise, but has the danger of ignoring actual errors for references in that range.

Full description of this issue can be found at Valgrind-users mailing list under the topic:

[Valgrind-users] Valgrind not working properly on imx6 platform