|
From: RHF <kx...@16...> - 2012-10-31 07:54:09
|
Hi, All, I cross compiled valgrind-3.8.1 for my MIPS platform with: # CC=/opt/cross-uxl/bin/mipsel-uxl-linux-gnu-gcc \ CC=/opt/cross-uxl/bin/mipsel-uxl-linux-gnu-gcc \ NM=/opt/cross-uxl/bin/mipsel-uxl-linux-gnu-nm \ STRIP=/opt/cross-uxl/bin/mipsel-uxl-linux-gnu-strip \ AR=/opt/cross-uxl/bin/mipsel-uxl-linux-gnu-ar \ RANLIB=/opt/cross-uxl/bin/mipsel-uxl-linux-gnu-ranlib \ ./configure --host=mipsel-linux --prefix=/opt/nfsdir/ --with-pagesize=4 my mips tool chain version: /opt/valgrind-3.8.1# mipsel-uxl-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=mipsel-uxl-linux-gnu-gcc COLLECT_LTO_WRAPPER=/opt/cross-uxl/libexec/gcc/mipsel-uxl-linux-gnu/4.6.3/lto-wrapper Target: mipsel-uxl-linux-gnu Configured with: //home/zyf/work/uxl//build//src/gcc-4.6.3/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=mipsel-uxl-linux-gnu --prefix=/opt/cross-uxl --with-sysroot=/opt/cross-uxl/mipsel-uxl-linux-gnu/sysroot --enable-languages=c,c++ --disable-multilib --with-arch=74kf1_1 --with-abi=32 --with-tune=74kf1_1 --with-pkgversion='crosstool-NG 1.13.2' --disable-sjlj-exceptions --disable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --with-gmp=//home/zyf/work/uxl//build//mipsel-uxl-linux-gnu/build/static --with-mpfr=//home/zyf/work/uxl//build//mipsel-uxl-linux-gnu/build/static --with-mpc=//home/zyf/work/uxl//build//mipsel-uxl-linux-gnu/build/static --with-ppl=//home/zyf/work/uxl//build//mipsel-uxl-linux-gnu/build/static --with-cloog=//home/zyf/work/uxl//build//mipsel-uxl-linux-gnu/build/static --with-libelf=//home/zyf/work/uxl//build//mipsel-uxl-linux-gnu/build/static --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++ -lm -L//home/zyf/work/uxl//build//mipsel-uxl-linux-gnu/build/static/lib -lpwl' --enable-threads=posix --enable-target-optspace --without-long-double-128 --with-local-prefix=/opt/cross-uxl/mipsel-uxl-linux-gnu/sysroot --disable-nls --enable-c99 --enable-long-long Thread model: posix gcc version 4.6.3 (crosstool-NG 1.13.2) when I run valgrind on my embedded system, I meet the below issue: /opt # ./bin/valgrind /bin/true ==527== Memcheck, a memory error detector ==527== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==527== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==527== Command: /bin/true ==527== ==527== valgrind: Unrecognised instruction at address 0x4016348. ==527== at 0x4016348: _dl_sysdep_start (in /lib/ld-2.13.so) ==527== by 0x4001F48: _dl_start_final (in /lib/ld-2.13.so) ==527== Your program just tried to execute an instruction that Valgrind ==527== did not recognise. There are two possible reasons for this. ==527== 1. Your program has a bug and erroneously jumped to a non-code ==527== location. If you are running Memcheck and you just saw a ==527== warning about a bad jump, it's probably your program's fault. ==527== 2. The instruction is legitimate but Valgrind doesn't handle it, ==527== i.e. it's Valgrind's fault. If you think this is the case or ==527== you are not sure, please let us know and we'll try to fix it. ==527== Either way, Valgrind will now raise a SIGILL signal which will ==527== probably kill your program. ==527== ==527== Process terminating with default action of signal 4 (SIGILL) ==527== Illegal opcode at address 0x4016348 ==527== at 0x4016348: _dl_sysdep_start (in /lib/ld-2.13.so) ==527== by 0x4001F48: _dl_start_final (in /lib/ld-2.13.so) ==527== ==527== HEAP SUMMARY: ==527== in use at exit: 0 bytes in 0 blocks ==527== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==527== ==527== All heap blocks were freed -- no leaks are possible ==527== ==527== For counts of detected and suppressed errors, rerun with: -v ==527== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) Illegal instruction Any suggestion? Thanks. |
|
From: John R. <jr...@bi...> - 2012-10-31 14:47:55
|
> ==527== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info > ==527== Command: /bin/true > ==527== Illegal opcode at address 0x4016348 > ==527== at 0x4016348: _dl_sysdep_start (in /lib/ld-2.13.so) Find out what the instruction is. [It's a sorry indictment that valgrind does not print it.] See if it's actually undefined for a) your hardware or b) valgrind's model of your hardware. If the /lib/ld-2.13.so was prelinked, then most likely its address is identical in every process, so: $ gdb /lib/ld-2.13.so (gdb) x/i 0x4016348 (gdb) x/x 0x4016348 If /lib/ld-2.13.so was not prelinked, then we need to find the base address at runtime. Try $ cat /proc/self/maps and see what the lowest address is for ld-2.13.so. It should be something like 0x4000000. Then (remember "0x" prefix on the base address): $ gdb /lib/ld-2.13.so (gdb) x/i 0x4016348 - base (gdb) x/x 0x4016348 - base But in rare cases the runtime placement can differ between processes. So: $ gdb /lib/ld-2.13.so (gdb) disassemble _dl_sysdep_start and then show all instructions whose addresses are 0x348 modulo 0x1000 (the page size.) Sometimes a few instructions of context help, too: $ gdb /lib/ld-2.13.so (gdb) x/6i 0x4016348 - 3*4 -- |
|
From: John R. <jr...@bi...> - 2012-10-31 15:53:16
|
>> I cross compiled valgrind-3.8.1 for my MIPS platform ... >> ==527== Illegal opcode at address 0x4016348 >> ==527== at 0x4016348: _dl_sysdep_start (in /lib/ld-2.13.so) > Find out what the instruction is. [It's a sorry indictment that valgrind > does not print it.] https://bugs.kde.org/show_bug.cgi?id=309323 -- |