[Valgrind-users] failure to run on armv6 following the armv6 legacy patches suggested by bug 276897
Hi all, I've followed the excellent work done by John Reiser to support armv6/armv5te. I've managed to build valgrind after patching with 64365,64147,64366,64946 AND using the following configure: export CC=arm-wrs-linux-gnueabi-armv6jel-glibc_small-gcc export AR=arm-wrs-linux-gnueabi-armv6jel-glibc_small-ar export LD=arm-wrs-linux-gnueabi-armv6jel-glibc_small-ld CPPFLAGS=--sysroot=/koby/96x1/workspace/library/bcom/sysroot CFLAGS=--sysroot=/koby/96x1/workspace/library/bcom/sysroot ./configure --host=armv6jel-wrs-linux-gnueabi --target=armv6jel-wrs-linux-gnueabi --prefix=/AvayaDir/Tools/valgrind the target board is: Processor : ARMv6-compatible processor rev 7 (v6l) BogoMIPS: 299.00 Features: swp half thumb fastmult edsp java CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part: 0xb76 CPU revision: 7 Cache type : write-back Cache clean : cp15 c7 ops Cache lockdown : format C Cache format: Harvard I size : 32768 I assoc : 4 I line length : 32 I sets : 256 D size : 32768 D assoc : 4 D line length : 32 D sets : 256 Hardware: BCMRING_AV9611g2 Revision: 111090b0 When I try to run it I get the following error: # ./bin/valgrind -v /bin/ls ==2776== Memcheck, a memory error detector ==2776== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==2776== Using Valgrind-3.7.0.SVN and LibVEX; rerun with -h for copyright info ==2776== Command: /bin/ls ==2776== --2776-- Valgrind options: --2776---v --2776-- Contents of /proc/version: --2776-- Linux version 2.6.27.18 (fo...@bcmsl2180.ca.avaya.com) (gcc version 4.3.2 (Wind River Linux Sourcery G++ 4.3-85) ) #1 PREEMPT Tue Dec 20 08:18:40 EST 2011 --2776-- Arch and hwcaps: ARM, ARMv6 --2776-- Page sizes: currently 4096, max supported 4096 --2776-- Valgrind library directory: /AvayaDir/Tools/valgrind/lib/valgrind --2776-- Reading syms from /bin/busybox (0x8000) --2776--object doesn't have a symbol table --2776-- Reading syms from /lib/ld-2.8.so.UNS.so (0x400) --2776-- Reading syms from /AvayaDir/Tools/valgrind/lib/valgrind/memcheck-arm-linux (0x3800) --2776--object doesn't have a dynamic symbol table --2776-- Reading suppressions file: /AvayaDir/Tools/valgrind/lib/valgrind/default.supp ==2776== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2776-by-root-on-??? ==2776== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-2776-by-root-on-??? ==2776== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-2776-by-root-on-??? ==2776== ==2776== TO CONTROL THIS PROCESS USING vgdb (which you probably ==2776== don't want to do, unless you know exactly what you're doing, ==2776== or are doing some strange experiment): ==2776== /AvayaDir/Tools/valgrind/lib/valgrind/../../bin/vgdb --pid=2776 ...command... ==2776== ==2776== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==2776== /path/to/gdb /bin/ls ==2776== and then give GDB the following command ==2776== target remote | /AvayaDir/Tools/valgrind/lib/valgrind/../../bin/vgdb --pid=2776 ==2776== --pid is optional if only one valgrind process is running ==2776== ==2776== error 22 Invalid argument ==2776== error VG_(am_shared_mmap_file_float_valgrind) /tmp/vgdb-pipe-shared-mem-vgdb-2776-by-root-on-??? This maps in the code to: coregrind/m_gdbserver/remote-utils.c: SysRes res = VG_(am_shared_mmap_file_float_valgrind) (sizeof(VgdbShared), VKI_PROT_READ|VKI_PROT_WRITE, shared_mem_fd, (Off64T)0); if (sr_isError(res)) { sr_perror(res, error VG_(am_shared_mmap_file_float_valgrind) %s\n, shared_mem); fatal(); coregrind/m_aspacemgr/aspacemgr-linux.c: extern SysRes VG_(am_shared_mmap_file_float_valgrind) ( SizeT length, UInt prot, Int fd, Off64T offset ) { return VG_(am_mmap_file_float_valgrind_flags) (length, prot, VKI_MAP_FIXED|VKI_MAP_SHARED, fd, offset ); } I am at a loss and how to continue debugging this. I'd appreciate any help offered! Thanks, Koby Koby Hershkovitz | Software Development Engineer| Avaya | Atidim Technology Park | Building 3 | Tel Aviv, Israel 61131 | Voice +972 3 645 7555/Fax +972 3 645 7555| khers...@avaya.com P Please consider your environmental responsibility. Before printing this e-mail please ask yourself: Do I really need a hard copy? image001.png-- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it
Re: [Valgrind-users] failure to run on armv6 following the armv6legacy patches suggested by bug 276897
Indeed I have check this patch is correctly in place. The relevant strace output is: mmap2(0x6229, 1064960, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x6229 mprotect(0x6229, 8192, PROT_NONE) = 0 mprotect(0x62392000, 8192, PROT_NONE) = 0 gettid()= 1793 read(1017, A, 1) = 1 gettid()= 1793 getpid()= 1793 getpid()= 1793 unlink(/tmp/vgdb-pipe-from-vgdb-to-1793-by-root-on-???) = -1 ENOENT (No such file or directory) unlink(/tmp/vgdb-pipe-to-vgdb-from-1793-by-root-on-???) = -1 ENOENT (No such file or directory) unlink(/tmp/vgdb-pipe-shared-mem-vgdb-1793-by-root-on-???) = -1 ENOENT (No such file or directory) mknod(/tmp/vgdb-pipe-from-vgdb-to-1793-by-root-on-???, S_IFIFO|0666) = 0 mknod(/tmp/vgdb-pipe-to-vgdb-from-1793-by-root-on-???, S_IFIFO|0666) = 0 open(/tmp/vgdb-pipe-shared-mem-vgdb-1793-by-root-on-???, O_RDWR|O_CREAT, 0666) = 3 write(3, \0\0\0\0\0\0\0\0\0\0\0\0\360\240\0068\0\210\2468\240\26\0\0\4\0\0\0\350 \24\0\0, 32) = 32 mmap2(0x401d000, 32, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 3, 0) = -1 EINVAL (Invalid argument) getpid()= 1793 write(1016, ==1793== error 22 Invalid argume..., 35==1793== error 22 Invalid argument ) = 35 getpid()= 1793 write(1016, ==1793== error VG_(am_shared_mma..., 106==1793== error VG_(am_shared_mmap_file_float_valgrind) /tmp/vgdb-pipe-shared-mem-vgdb-1793-by-root-on-??? Moreover valgrind only started to work with --vgdb=no only after I put the armv5 patch (although I have an arm v6l) But still the same error when trying to run it with the embedded gdbserver. Thanks, Koby Koby Hershkovitz | Software Development Engineer| Avaya | Atidim Technology Park | Building 3 | Tel Aviv, Israel 61131 | Voice +972 3 645 7555/Fax +972 3 645 7555| khers...@avaya.com P Please consider your environmental responsibility. Before printing this e-mail please ask yourself: Do I really need a hard copy? -Original Message- From: John Reiser [mailto:jrei...@bitwagon.com] Sent: Friday, December 30, 2011 17:24 To: valgrind-users@lists.sourceforge.net Subject: Re: [Valgrind-users] failure to run on armv6 following the armv6legacy patches suggested by bug 276897 I've managed to build valgrind after patching with 64365,64147,64366,64946 AND using the following configure: [[snip]] ==2776== error 22 Invalid argument ==2776== error VG_(am_shared_mmap_file_float_valgrind) /tmp/vgdb-pipe-shared-mem-vgdb-2776-by-root-on-??? This hints that it might be a good idea to double-check that the actual code does contain the part of patch 64147 that provides 16KB alignment for mmap: Index: coregrind/m_syswrap/syswrap-generic.c === --- coregrind/m_syswrap/syswrap-generic.c(revision 12084) +++ coregrind/m_syswrap/syswrap-generic.c(working copy) @@ -2025,8 +2025,19 @@ mreq.rkind = MAny; } + /* handle alignment to 4 pages we need for MAP_FIXED to succeed on ARM */ [[snip]] Also, run with valgrind command-line parameter --trace-syscalls=yes and check the parameter values for mmap(): valgrind --trace-syscalls=yes ./my_app ... Another way to do this is to run valgrind under strace: strace valgrind ./my_app ... -- -- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox ___ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users