|
From: WANG Q. <Qua...@al...> - 2013-05-08 06:48:04
|
Hi,
When we try to use valgrind on our board(cpu-mips, os-linux, clib-glibc), but met with some problem.
Please check if you met such problem before? Any suggestions?
Thanks!
CPU Info:
#cat /proc/cpuinfo
Processor : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 1297.61
Features : swp half thumb fastmult edsp
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0
Hardware : hsan
Revision : 0000
Serial : 0000000000000000
GCC Info:
mips_74k_softfp-target-linux-gnu-gcc --verbose
Using built-in specs.
Target: mips-wrs-linux-gnu
Configured with: /scratch/joseph/wrs/4.4a/src/gcc-4.4-wrs/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=mips-wrs-linux-gnu --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-float=soft --with-mips-plt --with-arch-32=4kc --with-arch-64=5kf --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Wind River Linux Sourcery G++ 4.4a-323' --wit...@wi... --disable-nls --prefix=/opt/windriver/wrlinux/mips --with-sysroot=/opt/windriver/wrlinux/mips/mips-wrs-linux-gnu/libc --with-build-sysroot=/scratch/joseph/wrs/4.4a/mips/install/mips-wrs-linux-gnu/libc --with-gmp=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-mpfr=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-ppl=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-libelf=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --disable-libgomp --with-license=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-csl-license-version=20101201 --with-csl-license-feature=gcc_MIPS_Wind_River_Linux --enable-poison-system-directories --with-debug-prefix-map='/scratch/joseph/wrs/4.4a/mips/install=/opt/windriver/wrlinux/mips /scratch/joseph/wrs/4.4a/src/gcc-4.4-wrs=/opt/windriver/wrlinux/mips/mips-wrs-linux-gnu/src/gcc /scratch/joseph/wrs/4.4a/mips/obj/gcc-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu=/opt/windriver/wrlinux/mips/mips-wrs-linux-gnu/src/generated/gcc' --with-build-time-tools=/scratch/joseph/wrs/4.4a/mips/install/mips-wrs-linux-gnu/bin --with-build-time-tools=/scratch/joseph/wrs/4.4a/mips/install/mips-wrs-linux-gnu/bin
Thread model: posix
gcc version 4.4.1 (Wind River Linux Sourcery G++ 4.4a-323)
Crash Log1(The application was linked as static):
./valgrind ./test
==3269== Memcheck, a memory error detector
==3269== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==3269== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==3269== Command: ./test
==3269==
==3269== valgrind: Unrecognised instruction at address 0x40c038.
==3269== at 0x40C038: _dl_aux_init (in /tmp/wqf/Install/bin/test)
==3269== by 0x400400: (below main) (in /tmp/wqf/Install/bin/test)
==3269== Your program just tried to execute an instruction that Valgrind
==3269== did not recognise. There are two possible reasons for this.
==3269== 1. Your program has a bug and erroneously jumped to a non-code
==3269== location. If you are running Memcheck and you just saw a
==3269== warning about a bad jump, it's probably your program's fault.
==3269== 2. The instruction is legitimate but Valgrind doesn't handle it,
==3269== i.e. it's Valgrind's fault. If you think this is the case or
==3269== you are not sure, please let us know and we'll try to fix it.
==3269== Either way, Valgrind will now raise a SIGILL signal which will
==3269== probably kill your program.
==3269==
==3269== Process terminating with default action of signal 4 (SIGILL)
==3269== Illegal opcode at address 0x40C038
==3269== at 0x40C038: _dl_aux_init (in /tmp/wqf/Install/bin/test)
==3269== by 0x400400: (below main) (in /tmp/wqf/Install/bin/test)
==3269==
==3269== HEAP SUMMARY:
==3269== in use at exit: 0 bytes in 0 blocks
==3269== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==3269==
==3269== All heap blocks were freed -- no leaks are possible
==3269==
==3269== For counts of detected and suppressed errors, rerun with: -v
==3269== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction
Crash Log2(The application was linked as dynamic):
./valgrind ../../../a.out
==4441== Memcheck, a memory error detector
==4441== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==4441== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==4441== Command: ../../../a.out
==4441==
==4441== valgrind: Unrecognised instruction at address 0x4016fd8.
==4441== at 0x4016FD8: ??? (in /lib/ld-2.11.1.so)
==4441== by 0x4000E5C: ??? (in /lib/ld-2.11.1.so)
==4441== Your program just tried to execute an instruction that Valgrind
==4441== did not recognise. There are two possible reasons for this.
==4441== 1. Your program has a bug and erroneously jumped to a non-code
==4441== location. If you are running Memcheck and you just saw a
==4441== warning about a bad jump, it's probably your program's fault.
==4441== 2. The instruction is legitimate but Valgrind doesn't handle it,
==4441== i.e. it's Valgrind's fault. If you think this is the case or
==4441== you are not sure, please let us know and we'll try to fix it.
==4441== Either way, Valgrind will now raise a SIGILL signal which will
==4441== probably kill your program.
==4441==
==4441== Process terminating with default action of signal 4 (SIGILL)
==4441== Illegal opcode at address 0x4016FD8
==4441== at 0x4016FD8: ??? (in /lib/ld-2.11.1.so)
==4441== by 0x4000E5C: ??? (in /lib/ld-2.11.1.so)
==4441==
==4441== HEAP SUMMARY:
==4441== in use at exit: 0 bytes in 0 blocks
==4441== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==4441==
==4441== All heap blocks were freed -- no leaks are possible
==4441==
==4441== For counts of detected and suppressed errors, rerun with: -v
==4441== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction
|
|
From: WANG Q. <Qua...@al...> - 2013-05-08 06:53:27
|
Sorry a wong cpu info was given, now the correct one.
#cat cpuinfo
system type : Broadlight Lilac SOC
processor : 0
cpu model : MIPS 74Kc V4.12
BogoMIPS : 248.21
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0000, 0x0000, 0x0000]
ASEs implemented : mips16 dsp
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available
-----Original Message-----
From: WANG Quanfu
Sent: 2013年5月8日 14:42
To: 'Val...@li...'
Subject: Application crashes on MIPS cpu if we valgrind it
Hi,
When we try to use valgrind on our board(cpu-mips, os-linux, clib-glibc), but met with some problem.
Please check if you met such problem before? Any suggestions?
Thanks!
CPU Info:
#cat /proc/cpuinfo
Processor : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 1297.61
Features : swp half thumb fastmult edsp
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0
Hardware : hsan
Revision : 0000
Serial : 0000000000000000
GCC Info:
mips_74k_softfp-target-linux-gnu-gcc --verbose Using built-in specs.
Target: mips-wrs-linux-gnu
Configured with: /scratch/joseph/wrs/4.4a/src/gcc-4.4-wrs/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=mips-wrs-linux-gnu --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-float=soft --with-mips-plt --with-arch-32=4kc --with-arch-64=5kf --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Wind River Linux Sourcery G++ 4.4a-323' --wit...@wi... --disable-nls --prefix=/opt/windriver/wrlinux/mips --with-sysroot=/opt/windriver/wrlinux/mips/mips-wrs-linux-gnu/libc --with-build-sysroot=/scratch/joseph/wrs/4.4a/mips/install/mips-wrs-linux-gnu/libc --with-gmp=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-mpfr=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-ppl=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-libelf=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --disable-libgomp --with-license=/scratch/joseph/wrs/4.4a/mips/obj/host-libs-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu/usr --with-csl-license-version=20101201 --with-csl-license-feature=gcc_MIPS_Wind_River_Linux --enable-poison-system-directories --with-debug-prefix-map='/scratch/joseph/wrs/4.4a/mips/install=/opt/windriver/wrlinux/mips /scratch/joseph/wrs/4.4a/src/gcc-4.4-wrs=/opt/windriver/wrlinux/mips/mips-wrs-linux-gnu/src/gcc /scratch/joseph/wrs/4.4a/mips/obj/gcc-4.4a-323-mips-wrs-linux-gnu-i686-pc-linux-gnu=/opt/windriver/wrlinux/mips/mips-wrs-linux-gnu/src/generated/gcc' --with-build-time-tools=/scratch/joseph/wrs/4.4a/mips/install/mips-wrs-linux-gnu/bin --with-build-time-tools=/scratch/joseph/wrs/4.4a/mips/install/mips-wrs-linux-gnu/bin
Thread model: posix
gcc version 4.4.1 (Wind River Linux Sourcery G++ 4.4a-323)
Crash Log1(The application was linked as static):
./valgrind ./test
==3269== Memcheck, a memory error detector ==3269== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==3269== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==3269== Command: ./test ==3269== ==3269== valgrind: Unrecognised instruction at address 0x40c038.
==3269== at 0x40C038: _dl_aux_init (in /tmp/wqf/Install/bin/test)
==3269== by 0x400400: (below main) (in /tmp/wqf/Install/bin/test)
==3269== Your program just tried to execute an instruction that Valgrind ==3269== did not recognise. There are two possible reasons for this.
==3269== 1. Your program has a bug and erroneously jumped to a non-code
==3269== location. If you are running Memcheck and you just saw a
==3269== warning about a bad jump, it's probably your program's fault.
==3269== 2. The instruction is legitimate but Valgrind doesn't handle it,
==3269== i.e. it's Valgrind's fault. If you think this is the case or
==3269== you are not sure, please let us know and we'll try to fix it.
==3269== Either way, Valgrind will now raise a SIGILL signal which will ==3269== probably kill your program.
==3269==
==3269== Process terminating with default action of signal 4 (SIGILL) ==3269== Illegal opcode at address 0x40C038
==3269== at 0x40C038: _dl_aux_init (in /tmp/wqf/Install/bin/test)
==3269== by 0x400400: (below main) (in /tmp/wqf/Install/bin/test)
==3269==
==3269== HEAP SUMMARY:
==3269== in use at exit: 0 bytes in 0 blocks
==3269== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==3269==
==3269== All heap blocks were freed -- no leaks are possible ==3269== ==3269== For counts of detected and suppressed errors, rerun with: -v ==3269== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) Illegal instruction
Crash Log2(The application was linked as dynamic):
./valgrind ../../../a.out
==4441== Memcheck, a memory error detector ==4441== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==4441== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==4441== Command: ../../../a.out ==4441== ==4441== valgrind: Unrecognised instruction at address 0x4016fd8.
==4441== at 0x4016FD8: ??? (in /lib/ld-2.11.1.so)
==4441== by 0x4000E5C: ??? (in /lib/ld-2.11.1.so)
==4441== Your program just tried to execute an instruction that Valgrind ==4441== did not recognise. There are two possible reasons for this.
==4441== 1. Your program has a bug and erroneously jumped to a non-code
==4441== location. If you are running Memcheck and you just saw a
==4441== warning about a bad jump, it's probably your program's fault.
==4441== 2. The instruction is legitimate but Valgrind doesn't handle it,
==4441== i.e. it's Valgrind's fault. If you think this is the case or
==4441== you are not sure, please let us know and we'll try to fix it.
==4441== Either way, Valgrind will now raise a SIGILL signal which will ==4441== probably kill your program.
==4441==
==4441== Process terminating with default action of signal 4 (SIGILL) ==4441== Illegal opcode at address 0x4016FD8
==4441== at 0x4016FD8: ??? (in /lib/ld-2.11.1.so)
==4441== by 0x4000E5C: ??? (in /lib/ld-2.11.1.so)
==4441==
==4441== HEAP SUMMARY:
==4441== in use at exit: 0 bytes in 0 blocks
==4441== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==4441==
==4441== All heap blocks were freed -- no leaks are possible ==4441== ==4441== For counts of detected and suppressed errors, rerun with: -v ==4441== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) Illegal instruction
|
|
From: John R. <jr...@bi...> - 2013-05-08 14:26:57
|
> ==3269== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info > ==3269== valgrind: Unrecognised instruction at address 0x40c038. > ==3269== at 0x40C038: _dl_aux_init (in /tmp/wqf/Install/bin/test) > ==3269== by 0x400400: (below main) (in /tmp/wqf/Install/bin/test) > ==4441== valgrind: Unrecognised instruction at address 0x4016fd8. > ==4441== at 0x4016FD8: ??? (in /lib/ld-2.11.1.so) > ==4441== by 0x4000E5C: ??? (in /lib/ld-2.11.1.so) Your ld-2.11.1.so uses some instruction opcode(s) that valgrind (memcheck; VEX) does not implement yet. You have also encountered a usability bug in memcheck, namely memcheck 3.8.1 does not print the actual instruction bytes, and therefore it is hard for anyone to discover exactly what is necessary to make memcheck work on your program. The memcheck bug is https://bugs.kde.org/show_bug.cgi?id=309323. Please add a comment there "I encountered this bug, also." Copy+paste those two error reports above [7 or 8 lines] into your new comment at bug 309323. Meanwhile, https://bugs.kde.org/show_bug.cgi?id=309323#c5 says that the source for memcheck has been changed to print the instruction bytes. However, no release has been made that incorporates the changes. So, you could try checking out the current source tree, then building and running your own local version of memcheck. If "successful", then at least you will know what opcode is missing from memcheck/VEX. That's the first half of what needs to be done. Then you should look up that opcode in the MIPS documentation, and file another bug against memcheck: "Please implement opocde 0xYYYYYYYY ("foo") for MIPS-74K." Give the information about where that opcode appears: ld-2.11.1, routine _dl_aux_init, etc. You can also find the opcode by using a disassembler and/or debugger. Disassemble the 8 instructions (4 before, 4 after) which surround addresses 0x40c038 and 0x4016fd8. The reported address is the actual address in the static linked version. The reported address probably is 0x4000000 higher than in the shared library /lib/ld-2.11.1. All that will not solve the problem, but it will identify precisely what the problem _is_. Then you need to convince the valgrind(VEX) maintainers to implement the missing opcode, or you need to re-write the code to avoid using that instruction. -- |