By default valgrind is not selectable in menuconfig for IMX6 platform when cross compiling 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:
|
==19124== Memcheck, a memory error detector
==19124== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==19124== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==19124== Command: /bin/true
==19124==
==19124== Invalid read of size 4
==19124== at 0x40054EC: ??? (in /lib/ld-uClibc-0.9.33.2.so
<http://ld-uClibc-0.9.33.2.so>)
==19124== Address 0x7df01864 is on thread 1's stack
==19124== 20 bytes below stack pointer
How do you know that memcheck's complaint is incorrect? At times in the past
messages such as these were valid complaints, particularly for uClibc and some
compilers
for ARM and MIPS.
Find some way to look at register values and instruction stream in the context
of the error.
If the valgrind gdb server is installed and working, then one good way is to
invoke via
valgrind --vgdb-error=0 /bin/true
and follow the directions.
(gdb) continue ## to get started
Then at the point of complaint by memcheck:
(gdb) info reg ## values of all registers
(gdb) x/9i $pc-4*4 ## probable instruction stream
It would also help to install the debuginfo package for uClibc (compiled with
-g)
so that you could get a meaningful backtrace via the "bt" command to gdb,
but that might be a lot of work.
Please tell us the target operating system version ("uname -a"),
and which ELF program INTERP (readelf --segments /bin/true | grep interpreter).
--
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users