> On Thu, 2014-11-27 at 23:06 +0300, Mikhail Baikov wrote: > >> ==1654== Invalid read of size 4 >> ==1654== at 0x489B248: __uClibc_main (in /lib/libuClibc-0.9.32.1.so) >> ==1654== Address 0xbdd74b44 is on thread 1's stack >> ==1654== 20 bytes below stack pointer >> ==1654== >> I also have >> # valgrind -v -v -v -d -d -d --trace-redir=yes /bin/true >> log but it's really big to attach it here. >> >> And i really can't understand where is the problem because I tried to >> build trunk valgring (which fails with the same errors), tried 3.10.0 >> with patches from buildroot with the same result. >> >> And now I don't know where to dig. > A possible cause of the above problem is that valgrind does > not recognise the name of the uClibc dynamic loader. > There is some code that handles specially the dynamic loader. > See coregrind/m_redir.c line 1363 for the expected names on arm > or some similar names in include/pub_tool_redir.h In include/pub_tool_redir.h there is a # define VG_Z_LIBC_SONAME libcZdsoZa // libc.so* that corresponds with what I have in my /lib directory ls -la /lib/libc.so.0 lrwxrwxrwx 1 root root 21 Nov 18 2014 /lib/libc.so.0 -> libuClibc-0.9.32.1.so # readelf -a /lib/libuClibc-0.9.32.1.so | grep soname 0x0000000e (SONAME) Library soname: [libc.so.0]
In coregrind/m_redir.c there are two ld-linux.so.3 and ld-linux-armhf.so.3 loader names. If I add ld-uClibc.so.0 loader, rebuild valgrind and try to run any binary i get this kind of error valgrind: Fatal error at startup: a function redirection valgrind: which is mandatory for this platform-tool combination valgrind: cannot be set up. Details of the redirection are: valgrind: valgrind: A must-be-redirected function valgrind: whose name matches the pattern: strcmp valgrind: in an object with soname matching: ld-uClibc.so.0 valgrind: was not found whilst processing valgrind: symbols from the object with soname: ld-uClibc.so.0 > It might also just be "normal" errors, that are suppressed > by the standard valgrind suppression files, but that in your > case are not matching due to the uClibc use ? > See e.g. default.supp (generated from various *.supp files). > I see no uclibc specific files there, which makes me believe > valgrind is not (yet) fine tuned to be used with uclibc. > > For what concerns the error message > /bin/true: can't resolve symbol '__libc_freeres' > again that is probably caused by uClib, which I guess does not > provide __libc_freeres > To avoid this msg, you can use --run-libc-freeres=no I've taken uclibc.supp from buildroot and added suppression option with it but it hasn't helped. > Note however that I see in coregrind/vg_preloaded.c (line 59) > that the call should not be done when valgrind is "compiled" > for UCLIBC. > So, might be good to verify how e.g. vg_preloaded.c was > compiled. gcc -v of the toolchain i've been given is ./arm-linux-uclibcgnueabi-gcc -v Using built-in specs. COLLECT_GCC=./arm-linux-uclibcgnueabi-gcc COLLECT_LTO_WRAPPER=/home/mikhail/zodiac/toolchain/humax-fxpp/opt/toolchains/stbgcc-4.5.4-2.7_uclibc_ssp/bin/../libexec/gcc/arm-linux-uclibcgnueabi/4.5.4/lto-wrapper Target: arm-linux-uclibcgnueabi Configured with: ../gcc-4.5.4/configure --target=arm-linux-uclibcgnueabi --enable-multilib --prefix=/usr/src/redhat/BUILD/build-toolchain//opt/toolchains/stbgcc-4.5.4-2.7_uclibc_ssp --with-local-prefix=/usr/src/redhat/BUILD/build-toolchain//opt/toolchains/stbgcc-4.5.4-2.7_uclibc_ssp/arm-linux-uclibcgnueabi/sys-root --with-sysroot=/usr/src/redhat/BUILD/build-toolchain//opt/toolchains/stbgcc-4.5.4-2.7_uclibc_ssp/arm-linux-uclibcgnueabi/sys-root --enable-threads=posix --enable-long-long --enable-c99 --enable-__cxa_atexit --with-gmp=/usr/src/redhat/BUILD/prereq --with-mpfr=/usr/src/redhat/BUILD/prereq --with-mpc=/usr/src/redhat/BUILD/prereq --with-libelf=/usr/src/redhat/BUILD/prereq --disable-nls --enable-symvers=gnu --enable-languages=c,c++ --enable-target-optspace --with-pkgversion='Broadcom stbgcc-4.5.4-2.7_uclibc_ssp' --with-host-libstdcxx='-Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-float=soft Thread model: posix gcc version 4.5.4 (Broadcom stbgcc-4.5.4-2.7_uclibc_ssp) The single line where I see something about vg_preloaded.c is /home/mikhail/zodiac/toolchain/humax-fxpp/opt/toolchains/stbgcc-4.5.4-2.7_uclibc_ssp/bin/../libexec/gcc/arm-linux-uclibcgnueabi/4.5.4/cc1 -quiet -v -I. -I.. -I.. -I../include -I../VEX/pub -I../VEX/pub -I../coregrind -iprefix /home/mikhail/zodiac/toolchain/humax-fxpp/opt/toolchains/stbgcc-4.5.4-2.7_uclibc_ssp/bin/../lib/gcc/arm-linux-uclibcgnueabi/4.5.4/ -isysroot /home/mikhail/zodiac/toolchain/humax-fxpp/opt/toolchains/stbgcc-4.5.4-2.7_uclibc_ssp/bin/../arm-linux-uclibcgnueabi/sys-root -MD vgpreload_core_arm_linux_so-vg_preloaded.d -MF .deps/vgpreload_core_arm_linux_so-vg_preloaded.Tpo -MP -MT vgpreload_core_arm_linux_so-vg_preloaded.o -DHAVE_CONFIG_H -DVGA_arm=1 -DVGO_linux=1 -DVGP_arm_linux=1 -DVGPV_arm_linux_vanilla=1 -DVG_LIBDIR="/bin/mbaikov/valgrind_arm/lib/valgrind" -DVG_PLATFORM="arm-linux" vg_preloaded.c -quiet -dumpbase vg_preloaded.c -marm -mcpu=cortex-a8 -marm -mabi=aapcs-linux -msoft-float -muclibc -auxbase-strip vgpreload_core_arm_linux_so-vg_preloaded.o -g -g -O2 -O -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -Wno-long-long -Wall -Wno-endif-labels -Wno-multichar -Wno-switch -Wno-unknown-pragmas -Wsystem-headers -Wno-unused-parameter -Wno-missing-field-initializers -version -fpic -fno-builtin -fPIC -fmerge-constants -funswitch-loops -fno-jump-tables -fno-strict-aliasing -fno-omit-frame-pointer -fno-stack-protector -o /tmp/cchpJUN3.s and I can't get whether it is compiled for uClibc or not. > Philippe > > The main problem for me is not in basic applications. The problem is that the application that I want to test works fine without valgrind but segfaults when I try to run it in valgrind. ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users