From: l. <238...@qq...> - 2014-09-25 11:41:48
|
# /opt/vg/bin/valgrind ls ==5290== Memcheck, a memory error detector ==5290== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==5290== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info ==5290== Command: ls ==5290== ==5290== ==5290== Process terminating with default action of signal 4 (SIGILL) ==5290== Illegal opcode at address 0x3808AE70 ==5290== at 0x4000E50: _start (in /lib/ld-uClibc-0.9.32.1.so) valgrind: m_scheduler/scheduler.c:957 (run_thread_for_a_while): Assertion 'done_this_time >= 0' failed. ==5290== at 0x38039528: report_and_quit (m_libcassert.c:260) ==5290== by 0xE08F4003: ??? sched status: running_tid=1 Thread 1: status = VgTs_Runnable ==5290== at 0x4000E50: _start (in /lib/ld-uClibc-0.9.32.1.so) Note: see also the FAQ in the source distribution. It contains workarounds to several common problems. In particular, if Valgrind aborted or crashed after identifying problems in your program, there's a good chance that fixing those problems will prevent Valgrind aborting or crashing, especially if it happened in m_mallocfree.c. If that doesn't help, please report this bug to: www.valgrind.org In the bug report, send all the above text, the valgrind version, and what OS and version you are using. Thanks. # cat /proc/cpu /proc/cpu/ /proc/cpuinfo # cat /proc/cpuinfo Processor : ARMv7 Processor rev 1 (v7l) processor : 0 BogoMIPS : 1987.37 processor : 1 BogoMIPS : 1993.93 Features : swp half thumb fastmult edsp tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x4 CPU part : 0xc09 CPU revision : 1 Hardware : hi3535 Revision : 0000 Serial : 0000000000000000 # uname -a Linux (none) 3.4.35_hi3535 #4 SMP Tue Jul 22 11:14:11 CST 2014 armv7l GNU/Linux # /opt/vg/bin/valgrind --version valgrind-3.9.0 what's wrong with me? |
From: John R. <jr...@Bi...> - 2014-09-26 02:49:04
|
> ==5290== Process terminating with default action of signal 4 (SIGILL) > ==5290== Illegal opcode at address 0x3808AE70 > ==5290== at 0x4000E50: _start (in /lib/ld-uClibc-0.9.32.1.so) > # cat /proc/cpuinfo > Processor : ARMv7 Processor rev 1 (v7l) > processor : 0 > BogoMIPS : 1987.37 > processor : 1 > BogoMIPS : 1993.93 > Features : swp half thumb fastmult edsp tls This smells like valgrind was built (compiled) for some other ARM architecture, but installed on this box. Or, it could be a bug the code which valgrind uses to determine the current CPU architecture. Find out what instruction (the four bytes) is at 0x3808AE70, and tell is in hex and disassembled (use gdb). That address is inside one of the valgrind tools itself. On x86_64 it would be /usr/lib64/valgrind/memcheck-amd64-linux so look for /usr/lib/valgrind/memcheck-arm*-linux or similar. Then run gdb on that file, and say: x/x 0x3808AE70 x/i 0x3808AE70 q -- |
From: Julian S. <js...@ac...> - 2014-09-26 16:34:57
|
That's a bit strange. Can you please try with the recently released 3.10.0 version, and see if you still have the problem? Thanks. J On 09/25/2014 01:41 PM, lchquan wrote: > # /opt/vg/bin/valgrind ls > ==5290== Memcheck, a memory error detector > ==5290== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. > ==5290== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info > ==5290== Command: ls > ==5290== > ==5290== > ==5290== Process terminating with default action of signal 4 (SIGILL) > ==5290== Illegal opcode at address 0x3808AE70 > ==5290== at 0x4000E50: _start (in /lib/ld-uClibc-0.9.32.1.so) > valgrind: m_scheduler/scheduler.c:957 (run_thread_for_a_while): Assertion 'done_this_time >= 0' failed. > ==5290== at 0x38039528: report_and_quit (m_libcassert.c:260) > ==5290== by 0xE08F4003: ??? > sched status: > running_tid=1 > Thread 1: status = VgTs_Runnable > ==5290== at 0x4000E50: _start (in /lib/ld-uClibc-0.9.32.1.so) > > Note: see also the FAQ in the source distribution. > It contains workarounds to several common problems. > In particular, if Valgrind aborted or crashed after > identifying problems in your program, there's a good chance > that fixing those problems will prevent Valgrind aborting or > crashing, especially if it happened in m_mallocfree.c. > If that doesn't help, please report this bug to: www.valgrind.org > In the bug report, send all the above text, the valgrind > version, and what OS and version you are using. Thanks. > # cat /proc/cpu > /proc/cpu/ /proc/cpuinfo > # cat /proc/cpuinfo > Processor : ARMv7 Processor rev 1 (v7l) > processor : 0 > BogoMIPS : 1987.37 > processor : 1 > BogoMIPS : 1993.93 > Features : swp half thumb fastmult edsp tls > CPU implementer : 0x41 > CPU architecture: 7 > CPU variant : 0x4 > CPU part : 0xc09 > CPU revision : 1 > Hardware : hi3535 > Revision : 0000 > Serial : 0000000000000000 > # uname -a > Linux (none) 3.4.35_hi3535 #4 SMP Tue Jul 22 11:14:11 CST 2014 armv7l GNU/Linux > # /opt/vg/bin/valgrind --version > valgrind-3.9.0 > > what's wrong with me? > > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
From: superdha <cha...@it...> - 2015-11-06 02:48:00
|
Hello John, I have the same problem in HI3535 platform, Please help me to figure out the problem. # valgrind -v -d /bin/true --2222:1:debuglog DebugLog system started by Stage 1, level 1 logging requested --2222:1:launcher no tool requested, defaulting to 'memcheck' --2222:1:launcher selected platform 'arm-linux' --2222:1:launcher launching /lib/valgrind/memcheck-arm-linux --2222:1:debuglog DebugLog system started by Stage 2 (main), level 1 logging requested --2222:1: main Welcome to Valgrind version 3.11.0 debug logging --2222:1: main Checking current stack is plausible --2222:1: main Checking initial stack was noted --2222:1: main Starting the address space manager --2222:1: main Address space manager is running --2222:1: main Starting the dynamic memory manager --2222:1:mallocfr newSuperblock at 0x617B0000 (pszB 4194288) owner VALGRIND/core --2222:1:mallocfr deferred_reclaimSuperblock at 0x617B0000 (pszB 4194288) (prev 0x0) owner VALGRIND/core --2222:1: main Dynamic memory manager is running --2222:1: main Initialise m_debuginfo --2222:1: main VG_(libdir) = /lib/valgrind --2222:1: main Getting launcher's name ... --2222:1: main ... /mnt/nfs/gateway-hi3535/sdk/modules/valgrind-3.11.0/inst/bin/valgrind --2222:1: main Get hardware capabilities ... --2222:1: machine ARMv7 VFP 0 VFP2 0 VFP3 0 NEON 0 --2222:1: cache Could not autodetect cache info --2222:1: main ... arch = ARM, hwcaps = ARMv7 --2222:1: main Getting the working directory at startup --2222:1: main ... /root --2222:1: main Split up command line --2222:1: main (early_) Process Valgrind's command line options --2222:1: main Create initial image --2222:1: initimg Loading client --2222:1: initimg Setup client env --2222:1: initimg Setup client stack: size will be 8388608 --2222:1: initimg Setup client data (brk) segment --2222:1: main Setup file descriptors --2222:1: main Create fake /proc/<pid>/cmdline --2222:1: main Create fake /proc/<pid>/auxv --2222:1: main Initialise the tool part 1 (pre_clo_init) --2222:1:mallocfr deferred_reclaimSuperblock NULL (prev 0x617B0000) owner VALGRIND/core --2222:1:mallocfr newSuperblock at 0x61BB0000 (pszB 4194288) owner VALGRIND/core --2222:1: main Print help and quit, if requested --2222:1: main (main_) Process Valgrind's command line options, setup logging --2222:1: main Print the preamble... ==2222== Memcheck, a memory error detector ==2222== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==2222== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==2222== Command: /bin/true ==2222== --2222-- Valgrind options: --2222-- -v --2222-- -d --2222-- Contents of /proc/version: --2222-- Linux version 3.4.35_hi3535 (charles@localsrv) (gcc version 4.4.1 (Hisilicon_v200(gcc4.4-290+glibc-2.11+eabi+nptl)) ) #1 SMP Tue Oct 27 12:07:52 CST 2015 --2222-- --2222-- Arch and hwcaps: ARM, LittleEndian, ARMv7 --2222-- Page sizes: currently 4096, max supported 4096 --2222-- Valgrind library directory: /lib/valgrind --2222:1: main ...finished the preamble --2222:1: main Initialise the tool part 2 (post_clo_init) --2222:1: main Initialise TT/TC --2222:1: main Initialise redirects --2222:1:mallocfr newSuperblock at 0x6202B000 (pszB 1048560) owner VALGRIND/dinfo --2222:1: main Load initial debug info --2222-- Reading syms from /bin/busybox --2222-- object doesn't have a symbol table --2222-- Reading EXIDX entries: 1 available ==2222== Warning: whilst reading EXIDX: Implausible EXIDX last entry size 666259; using 1 instead. --2222-- Reading EXIDX entries: 0 attempted, 0 successful --2222:1:mallocfr newSuperblock at 0x6212B000 (pszB 65520) owner VALGRIND/demangle --2222-- Reading syms from /lib/ld-2.11.1.so --2222-- Reading syms from /mnt/nfs/gateway-hi3535/sdk/modules/valgrind-3.11.0/inst/lib/valgrind/memcheck-arm-linux --2222:1:hashtabl resizing table `di.storage.addStr.1' from 769 to 1543 (total elems 770) --2222:1:hashtabl resizing table `di.storage.addStr.1' from 1543 to 3079 (total elems 1544) --2222:1:hashtabl resizing table `di.storage.addStr.1' from 3079 to 6151 (total elems 3080) --2222-- object doesn't have a dynamic symbol table --2222:1:mallocfr newSuperblock at 0x6213B000 (pszB 1048560) owner VALGRIND/dinfo --2222:1:hashtabl resizing table `di.storage.DiCfSI_m_pool' from 769 to 1543 (total elems 770) --2222:1:hashtabl resizing table `di.storage.DiCfSI_m_pool' from 1543 to 3079 (total elems 1544) --2222:1:hashtabl resizing table `di.storage.DiCfSI_m_pool' from 3079 to 6151 (total elems 3080) --2222:1:hashtabl resizing table `di.storage.DiCfSI_m_pool' from 6151 to 12289 (total elems 6152) --2222:1:mallocfr newSuperblock at 0x6223B000 (pszB 1048560) owner VALGRIND/dinfo --2222:1:mallocfr newSuperblock at 0x6233B000 (pszB 1048560) owner VALGRIND/dinfo --2222:1:mallocfr newSuperblock at 0x6243B000 (pszB 1048560) owner VALGRIND/dinfo --2222:1:mallocfr newSuperblock at 0x6253B000 (pszB 1048560) owner VALGRIND/dinfo --2222:1: redir transfer ownership V -> C of 0x38056000 .. 0x38056fff --2222:1: main Initialise scheduler (phase 1) --2222:1: sched sched_init_phase1 --2222-- Scheduler: using generic scheduler lock implementation. --2222:1: main Tell tool about initial permissions --2222:1: main Initialise scheduler (phase 2) --2222:1: sched sched_init_phase2: tid_main=1, cls_end=0xbdf5efff, cls_sz=8388608 --2222:1: main Finalise initial image --2222:1: main Initialise signal management --2222:1: main Load suppressions --2222-- Reading suppressions file: /lib/valgrind/default.supp --2222:1: main --2222:1: main --2222:1: aspacem <<< SHOW_SEGMENTS: Memory layout at client startup (28 segments) --2222:1: aspacem 3 segment names in 3 slots --2222:1: aspacem freelist is empty --2222:1: aspacem (0,4,4) /mnt/nfs/gateway-hi3535/sdk/modules/valgrind-3.11.0/inst/lib/valgrind/memcheck-arm-linux --2222:1: aspacem (1,97,2) /bin/busybox --2222:1: aspacem (2,114,2) /lib/ld-2.11.1.so --2222:1: aspacem 0: RSVN 0000000000-0000007fff 32768 ----- SmFixed --2222:1: aspacem 1: file 0000008000-00000cefff 815104 r-x-- d=0x1f03 i=30 o=0 (1,97) --2222:1: aspacem 2: RSVN 00000cf000-00000d6fff 32768 ----- SmFixed --2222:1: aspacem 3: file 00000d7000-00000d7fff 4096 rw--- d=0x1f03 i=30 o=815104 (1,97) --2222:1: aspacem 4: anon 00000d8000-00000d9fff 8192 rw--- --2222:1: aspacem 5: RSVN 00000da000-0003ffffff 63m ----- SmFixed --2222:1: aspacem 6: file 0004000000-000401dfff 122880 r-x-- d=0x1f03 i=256 o=0 (2,114) --2222:1: aspacem 7: 000401e000-0004025fff 32768 --2222:1: aspacem 8: file 0004026000-0004027fff 8192 rw--- d=0x1f03 i=256 o=122880 (2,114) --2222:1: aspacem 9: anon 0004028000-0004028fff 4096 rwx-- --2222:1: aspacem 10: RSVN 0004029000-0004827fff 8384512 ----- SmLower --2222:1: aspacem 11: 0004828000-0037ffffff 823m --2222:1: aspacem 12: FILE 0038000000-0038055fff 352256 r-x-- d=0x021 i=13654441 o=0 (0,4) --2222:1: aspacem 13: file 0038056000-0038056fff 4096 r-x-- d=0x021 i=13654441 o=352256 (0,4) --2222:1: aspacem 14: FILE 0038057000-00381dffff 1609728 r-x-- d=0x021 i=13654441 o=356352 (0,4) --2222:1: aspacem 15: FILE 00381e0000-00381e1fff 8192 rw--- d=0x021 i=13654441 o=1966080 (0,4) --2222:1: aspacem 16: ANON 00381e2000-0038b14fff 9646080 rw--- --2222:1: aspacem 17: 0038b15000-00617aefff 652m --2222:1: aspacem 18: RSVN 00617af000-00617affff 4096 ----- SmFixed --2222:1: aspacem 19: ANON 00617b0000-006265afff 14m rwx-- --2222:1: aspacem 20: 006265b000-00bd75efff 1457m --2222:1: aspacem 21: RSVN 00bd75f000-00bdf5dfff 8384512 ----- SmUpper --2222:1: aspacem 22: anon 00bdf5e000-00bdf5efff 4096 rw--- --2222:1: aspacem 23: 00bdf5f000-00bef3dfff 15m --2222:1: aspacem 24: ANON 00bef3e000-00bef5efff 135168 rw--- --2222:1: aspacem 25: RSVN 00bef5f000-00fffeffff 1040m ----- SmFixed --2222:1: aspacem 26: anon 00ffff0000-00ffff0fff 4096 r-x-- --2222:1: aspacem 27: RSVN 00ffff1000-00ffffffff 61440 ----- SmFixed --2222:1: aspacem >>> --2222:1: main --2222:1: main --2222:1: main Running thread 1 --2222:1:syswrap- entering VG_(main_thread_wrapper_NORETURN) --2222:1: aspacem allocated valgrind thread stack at 0x6265b000 size 1064960 --2222:1:syswrap- run_a_thread_NORETURN(tid=1): pre-thread_wrapper --2222:1:syswrap- thread_wrapper(tid=1): entry --2222:1: gdbsrv entering call_gdbserver init_reason ... pid 2222 tid 1 status VgTs_Runnable sched_jmpbuf_valid 0 --2222:1: gdbsrv gdbserver_init gdbserver embedded in valgrind: gdbserver protocol box extracted from gdb 6.6 ==2222== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2222-by-root-on-??? ==2222== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-2222-by-root-on-??? ==2222== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-2222-by-root-on-??? ==2222== ==2222== TO CONTROL THIS PROCESS USING vgdb (which you probably ==2222== don't want to do, unless you know exactly what you're doing, ==2222== or are doing some strange experiment): ==2222== /lib/valgrind/../../bin/vgdb --pid=2222 ...command... ==2222== ==2222== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==2222== /path/to/gdb /bin/true ==2222== and then give GDB the following command ==2222== target remote | /lib/valgrind/../../bin/vgdb --pid=2222 ==2222== --pid is optional if only one valgrind process is running ==2222== --2222:1: gdbsrv Opening read side /tmp/vgdb-pipe-from-vgdb-to-2222-by-root-on-??? --2222:1: gdbsrv result fd 3 --2222:1: gdbsrv result safe_fd 1030 --2222-- transtab: allocate sector 0 --2222:1:mallocfr newSuperblock at 0x646B3000 (pszB 65520) owner VALGRIND/ttaux --2222:1: gdbsrv VG core calling VG_(gdbserver_report_signal) vki_nr 4 SIGILL gdb_nr 4 SIGILL tid 1 --2222:1: gdbsrv not connected => pass ==2222== ==2222== Process terminating with default action of signal 4 (SIGILL) ==2222== Illegal opcode at address 0x380869FC ==2222== at 0x4000790: ??? (in /lib/ld-2.11.1.so) --2222:1:syswrap- thread_wrapper(tid=1): exit, schedreturncode VgSrc_FatalSig --2222:1:syswrap- run_a_thread_NORETURN(tid=1): post-thread_wrapper --2222:1:syswrap- run_a_thread_NORETURN(tid=1): last one standing --2222:1: main entering VG_(shutdown_actions_NORETURN) --2222:1: aspacem <<< SHOW_SEGMENTS: Memory layout at client shutdown (34 segments) --2222:1: aspacem 4 segment names in 4 slots --2222:1: aspacem freelist is empty --2222:1: aspacem (0,4,4) /mnt/nfs/gateway-hi3535/sdk/modules/valgrind-3.11.0/inst/lib/valgrind/memcheck-arm-linux --2222:1: aspacem (1,97,2) /bin/busybox --2222:1: aspacem (2,114,2) /lib/ld-2.11.1.so --2222:1: aspacem (3,136,1) /tmp/vgdb-pipe-shared-mem-vgdb-2222-by-root-on-??? --2222:1: aspacem 0: RSVN 0000000000-0000007fff 32768 ----- SmFixed --2222:1: aspacem 1: file 0000008000-00000cefff 815104 r-x-- d=0x1f03 i=30 o=0 (1,97) --2222:1: aspacem 2: RSVN 00000cf000-00000d6fff 32768 ----- SmFixed --2222:1: aspacem 3: file 00000d7000-00000d7fff 4096 rw--- d=0x1f03 i=30 o=815104 (1,97) --2222:1: aspacem 4: anon 00000d8000-00000d9fff 8192 rw--- --2222:1: aspacem 5: RSVN 00000da000-0003ffffff 63m ----- SmFixed --2222:1: aspacem 6: file 0004000000-000401dfff 122880 r-xT- d=0x1f03 i=256 o=0 (2,114) --2222:1: aspacem 7: 000401e000-0004025fff 32768 --2222:1: aspacem 8: file 0004026000-0004027fff 8192 rw--- d=0x1f03 i=256 o=122880 (2,114) --2222:1: aspacem 9: anon 0004028000-0004028fff 4096 rwx-- --2222:1: aspacem 10: RSVN 0004029000-0004827fff 8384512 ----- SmLower --2222:1: aspacem 11: 0004828000-0037ffffff 823m --2222:1: aspacem 12: FILE 0038000000-0038055fff 352256 r-x-- d=0x021 i=13654441 o=0 (0,4) --2222:1: aspacem 13: file 0038056000-0038056fff 4096 r-x-- d=0x021 i=13654441 o=352256 (0,4) --2222:1: aspacem 14: FILE 0038057000-00381dffff 1609728 r-x-- d=0x021 i=13654441 o=356352 (0,4) --2222:1: aspacem 15: FILE 00381e0000-00381e1fff 8192 rw--- d=0x021 i=13654441 o=1966080 (0,4) --2222:1: aspacem 16: ANON 00381e2000-0038b14fff 9646080 rw--- --2222:1: aspacem 17: 0038b15000-00617aefff 652m --2222:1: aspacem 18: RSVN 00617af000-00617affff 4096 ----- SmFixed --2222:1: aspacem 19: ANON 00617b0000-006265afff 14m rwx-- --2222:1: aspacem 20: ANON 006265b000-006265cfff 8192 ----- --2222:1: aspacem 21: ANON 006265d000-006275cfff 1048576 rwx-- --2222:1: aspacem 22: ANON 006275d000-006275efff 8192 ----- --2222:1: aspacem 23: 006275f000-006275ffff 4096 --2222:1: aspacem 24: FILE 0062760000-0062760fff 4096 rw--- d=0x00c i=9956 o=0 (3,136) --2222:1: aspacem 25: ANON 0062761000-00646c2fff 31m rwx-- --2222:1: aspacem 26: 00646c3000-00bd75efff 1424m --2222:1: aspacem 27: RSVN 00bd75f000-00bdf5dfff 8384512 ----- SmUpper --2222:1: aspacem 28: anon 00bdf5e000-00bdf5efff 4096 rw--- --2222:1: aspacem 29: 00bdf5f000-00bef3dfff 15m --2222:1: aspacem 30: ANON 00bef3e000-00bef5efff 135168 rw--- --2222:1: aspacem 31: RSVN 00bef5f000-00fffeffff 1040m ----- SmFixed --2222:1: aspacem 32: anon 00ffff0000-00ffff0fff 4096 r-x-- --2222:1: aspacem 33: RSVN 00ffff1000-00ffffffff 61440 ----- SmFixed --2222:1: aspacem >>> ==2222== ==2222== HEAP SUMMARY: ==2222== in use at exit: 0 bytes in 0 blocks ==2222== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==2222== ==2222== All heap blocks were freed -- no leaks are possible ==2222== ==2222== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==2222== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) --2222:1: gdbsrv VG core calling VG_(gdbserver_exit) tid 1 will exit --2222:1: gdbsrv not connected --2222:1: gdbsrv remote_finish (reason orderly_finish) 1030 -1 --2222:1: gdbsrv 2222 (creator 2222) maybe unlinking /tmp/vgdb-pipe-from-vgdb-to-2222-by-root-on-??? /tmp/vgdb-pipe-to-vgdb-from-2222-by-root-on-??? /tmp/vgdb-pipe-shared-mem-vgdb-2222-by-root-on-??? --2222:1: core_os VG_(terminate_NORETURN)(tid=1) Illegal instruction # cat /proc/cpuinfo Processor : ARMv7 Processor rev 1 (v7l) processor : 0 BogoMIPS : 1987.37 processor : 1 BogoMIPS : 1993.93 Features : swp half thumb fastmult edsp tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x4 CPU part : 0xc09 CPU revision : 1 Hardware : hi3535 Revision : 0000 Serial : 0000000000000000 $ gdb memcheck-arm-linux GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from memcheck-arm-linux...done. (gdb) x/x 0x380869FC 0x380869fc <vgPlain_disp_run_translations+8>: 0xeee14a10 (gdb) x/i 0x380869FC 0x380869fc <vgPlain_disp_run_translations+8>: adc %cl,-0x1f(%edx) (gdb) q -- View this message in context: http://valgrind.10908.n7.nabble.com/valgrind-run-error-help-me-thx-tp51770p55904.html Sent from the Valgrind - Users mailing list archive at Nabble.com. |
From: John R. <jr...@bi...> - 2015-11-06 04:35:57
|
> # valgrind -v -d /bin/true > --2222:1: main Welcome to Valgrind version 3.11.0 debug logging Thank you for using the current version of valgrind. > --2222:1: main ... > /mnt/nfs/gateway-hi3535/sdk/modules/valgrind-3.11.0/inst/bin/valgrind > --2222:1: main Get hardware capabilities ... > --2222:1: machine ARMv7 VFP 0 VFP2 0 VFP3 0 NEON 0 > --2222:1: cache Could not autodetect cache info > --2222:1: main ... arch = ARM, hwcaps = ARMv7 So valgrind is running on an ARM machine. > ==2222== Process terminating with default action of signal 4 (SIGILL) > ==2222== Illegal opcode at address 0x380869FC > ==2222== at 0x4000790: ??? (in /lib/ld-2.11.1.so) > # cat /proc/cpuinfo ### Yes, it is an ARM machine: > Processor : ARMv7 Processor rev 1 (v7l) > processor : 0 > BogoMIPS : 1987.37 > > processor : 1 > BogoMIPS : 1993.93 > > Features : swp half thumb fastmult edsp tls > CPU implementer : 0x41 > CPU architecture: 7 > CPU variant : 0x4 > CPU part : 0xc09 > CPU revision : 1 > > Hardware : hi3535 > Revision : 0000 > Serial : 0000000000000000 > > Here the shell prompt changes from "# " above, to "$ " below. You change from running on the ARM machine to running on a x86 box. The disassembly "adc %cl,-0x1f(%edx)" proves that gdb is an x86 gdb because "%cl" and "%edx" are x86 register names. Instead: please use a gdb for ARM to look at the instruction at address 0x380869FC in the ARM module memcheck-arm-linux, which probably resides in the filesystem near /mnt/nfs/gateway-hi3535/sdk/modules/valgrind-3.11.0/inst/bin/valgrind > $ gdb memcheck-arm-linux > GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7 > (gdb) x/x 0x380869FC > 0x380869fc <vgPlain_disp_run_translations+8>: 0xeee14a10 That's an ARM opcode. My RaspberryPi says it is "vmsr fpscr,r4" which is attempting to set some modes in the floating point hardware (such as precision, rounding mode, flush-to-zero for denormals, NaN control, etc.) from bits in general register r4. However, valgrind does not allow that because valgrind assumes exactly one configuration for floating point, which cannot be changed. You must inspect the source code (and the value in r4) to find out what the code is trying to do. If it's anything fancy, then it won't work under valgrind. If it is what valgrind assumes, then just comment out the instruction, or replace it with a nop. You can do this in a quick-and-dirty way by overwriting with 0xe1a00000 which is the nop "mov r0,r0". > (gdb) x/i 0x380869FC > 0x380869fc <vgPlain_disp_run_translations+8>: adc %cl,-0x1f(%edx) That is an x86 disassembly. > (gdb) q > |
From: John R. <jr...@bi...> - 2015-11-06 15:42:10
|
> 1. First, I use addr2line to find out the source code: > $ addr2line -e memcheck-arm-linux -a 0x380869FC > 0x380869fc > ~/valgrind-3.11.0/coregrind/m_dispatch/dispatch-arm-linux.S:71 > > 2. Then, I check the source code at line 71 is: > fmxr fpscr, r4 > > 3. Then, I search ARM assembly document: > 6.7.14. FMRX, FMXR, and FMSTAT > Transfer contents between an ARM register and a VFP system register. > > 4. However, this CPU hi3535 seems don't support VFP, because the Makefile in my SDK use > armv7a_soft instead of armv7a_vfp glibc runtime library The minimum hardware which valgrind assumes and requires is armv7 with VFP (vector floating point.) The ability to function without floating point would be a new feature for valgrind. Valgrind would have to notice that the chip lacks VFP, then avoid using it, and give an error if the target software used FP instructions. You could enter a Request For Enhancement using the bug reporting tool http://valgrind.org/support/bug_reports.html Give the explicit example of your chip, and any others that you know that lack FP but otherwise are armv7. Meanwhile, use some other hardware to run your software under valgrind. Most embedded devices have a subroutine library which maps logical functionality to the actual hardware. So make a substitute library which maps that functionality to a hardware device which valgrind does support, such as a RaspberyyPi model B+ version 2 (1GB RAM, 4CPU, VFP, NEON, ...). |