On Thu, Sep 18, 2014 at 9:35 PM, Chris Packham <judge.pack...@gmail.com> wrote: > Hi, > > I'm trying to use valgrind on an embedded powerpc system. When I start > a process under valgrind the it seems to lock up. I can connect to the > process using gdb/vgdb and the the following backtrace > > #0 0x0ffbaba8 in _vgr20190ZU_ldZdsoZd1_bcmp (s1V=0x401d000, > s2V=0x401a2e7, n=11) at ../shared/vg_replace_strmem.c:974 > #1 0x0ffbabac in _vgr20190ZU_ldZdsoZd1_bcmp (s1V=<optimized out>, > s2V=<optimized out>, n=<error reading variable: value has been > optimized out>) at ../shared/vg_replace_strmem.c:974 > > Originally I thought it was a problem with 3.10.0 but I've tried a few > versions and they all seem to have the same type of issue so I think > it's something about our system causing the problem. > > We have successfully run valgrind 3.7.0 on an earlier version of our > system using uclibc (after a few patches). I did a quick test with > 3.7.0 after convincing configure to allow eglibc-2.16 and got the same > behaviour but given the fact that 3.7.0 doesn't claim to support > glib-2.16 I'm not sure how valid that result is. > > Has anyone got any clues as to what I need to do to get valgrind > running on this system? > > Thanks, > Chris
Update. I was able to try a mips based target and valgrind works fine. So this appears to be specific to powerpc. If it helps here is some output from a powerpc target vs a mips target POWERPC: $ valgrind --verbose more /proc/self/cmdline ==6250== Memcheck, a memory error detector ==6250== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==6250== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==6250== Command: more /proc/self/cmdline ==6250== --6250-- Valgrind options: --6250-- --verbose --6250-- Contents of /proc/version: --6250-- Linux version 3.6.11 (@chrisp-dl) (gcc version 4.6.3 (Gentoo 4.6.3-r1 p1.9, pie-0.5.2) ) #1 SMP Thu Sep 18 14:22:06 NZST 2 014 --6250-- Arch and hwcaps: PPC32, BigEndian, ppc32-int-flt-GX --6250-- Page sizes: currently 4096, max supported 65536 --6250-- Valgrind library directory: /usr/lib/valgrind --6250-- Reading syms from /lib/ld-2.16.so --6250-- Reading syms from /bin/more --6250-- object doesn't have a symbol table --6250-- Reading syms from /usr/lib/valgrind/memcheck-ppc32-linux --6250-- object doesn't have a symbol table --6250-- object doesn't have a dynamic symbol table --6250-- Scheduler: using generic scheduler lock implementation. --6250-- Reading suppressions file: /usr/lib/valgrind/default.supp ==6250== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-6250-by-root-on-AT_SBx81CFC960 ==6250== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-6250-by-root-on-AT_SBx81CFC960 ==6250== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-6250-by-root-on-AT_SBx81CFC960 ==6250== ==6250== TO CONTROL THIS PROCESS USING vgdb (which you probably ==6250== don't want to do, unless you know exactly what you're doing, ==6250== or are doing some strange experiment): ==6250== /usr/lib/valgrind/../../bin/vgdb --pid=6250 ...command... ==6250== ==6250== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==6250== /path/to/gdb more ==6250== and then give GDB the following command ==6250== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=6250 ==6250== --pid is optional if only one valgrind process is running ==6250== --6250-- REDIR: 0x4016c58 (ld.so.1:strlen) redirected to 0x3806c5a0 (???) --6250-- REDIR: 0x4016a90 (ld.so.1:strcmp) redirected to 0x3806c5c8 (???) --6250-- REDIR: 0x40169b4 (ld.so.1:index) redirected to 0x3806c63c (???) --6250-- Reading syms from /usr/lib/valgrind/vgpreload_core-ppc32-linux.so --6250-- object doesn't have a symbol table --6250-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-ppc32-linux.so --6250-- object doesn't have a symbol table --6250-- REDIR: 0x40176f8 (ld.so.1:memcpy) redirected to 0xffb9fa4 (memcpy) <hang> MIPS: $ valgrind --verbose more /proc/self/cmdline ==13966== Memcheck, a memory error detector ==13966== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==13966== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==13966== Command: more /proc/self/cmdline ==13966== --13966-- Valgrind options: --13966-- --verbose --13966-- Contents of /proc/version: --13966-- Linux version 3.6.11-at1 (@chrisp-dl) (gcc version 4.6.3 (Gentoo 4.6.3-r1 p1.9, pie-0.5.2) ) #1 Thu Sep 18 17:23:47 NZST 2014 --13966-- Arch and hwcaps: MIPS32, BigEndian, Broadcom-baseline --13966-- Page sizes: currently 4096, max supported 4096 --13966-- Valgrind library directory: /usr/lib/valgrind --13966-- Reading syms from /bin/more --13966-- object doesn't have a symbol table --13966-- Reading syms from /lib/ld-2.16.so --13966-- Reading syms from /usr/lib/valgrind/memcheck-mips32-linux --13966-- object doesn't have a symbol table --13966-- object doesn't have a dynamic symbol table --13966-- Scheduler: using generic scheduler lock implementation. --13966-- Reading suppressions file: /usr/lib/valgrind/default.supp ==13966== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-13966-by-root-on-x510_52GTX ==13966== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-13966-by-root-on-x510_52GTX ==13966== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-13966-by-root-on-x510_52GTX ==13966== ==13966== TO CONTROL THIS PROCESS USING vgdb (which you probably ==13966== don't want to do, unless you know exactly what you're doing, ==13966== or are doing some strange experiment): ==13966== /usr/lib/valgrind/../../bin/vgdb --pid=13966 ...command... ==13966== ==13966== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==13966== /path/to/gdb more ==13966== and then give GDB the following command ==13966== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=13966 ==13966== --pid is optional if only one valgrind process is running ==13966== --13966-- Reading syms from /usr/lib/valgrind/vgpreload_core-mips32-linux.so --13966-- object doesn't have a symbol table --13966-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-mips32-linux.so --13966-- object doesn't have a symbol table --13966-- REDIR: 0x4019980 (ld.so.1:bcmp) redirected to 0x484c8f8 (bcmp) --13966-- REDIR: 0x4019fc0 (ld.so.1:memcpy) redirected to 0x484bef0 (memcpy) --13966-- REDIR: 0x4019ea0 (ld.so.1:mempcpy) redirected to 0x484da94 (mempcpy) --13966-- Reading syms from /usr/lib/libncurses.so.5.9 --13966-- object doesn't have a symbol table --13966-- Reading syms from /lib/libpthread-2.16.so --13966-- Reading syms from /lib/libc-2.16.so ==13966== Invalid write of size 4 ==13966== at 0x4001348: _dl_start_user (in /lib/ld-2.16.so) ==13966== by 0x40012DC: __start (in /lib/ld-2.16.so) ==13966== Address 0x7eab38cc is on thread 1's stack ==13966== 4 bytes below stack pointer ==13966== --13966-- REDIR: 0x49483d0 (libc.so.6:memset) redirected to 0x484d0b8 (memset) --13966-- REDIR: 0x4948b30 (libc.so.6:memcpy) redirected to 0x484b650 (memcpy) --13966-- REDIR: 0x49470e0 (libc.so.6:rindex) redirected to 0x48493b0 (rindex) --13966-- REDIR: 0x4946780 (libc.so.6:strcmp) redirected to 0x484ae1c (strcmp) --13966-- REDIR: 0x4946d30 (libc.so.6:strlen) redirected to 0x4849ad8 (strlen) --13966-- REDIR: 0x4946f60 (libc.so.6:strncmp) redirected to 0x484a328 (strncmp) --13966-- REDIR: 0x4946690 (libc.so.6:index) redirected to 0x4849608 (index) --13966-- REDIR: 0x4942134 (libc.so.6:free) redirected to 0x4847330 (free) --13966-- REDIR: 0x4941a30 (libc.so.6:malloc) redirected to 0x4848d60 (malloc) --13966-- REDIR: 0x4948460 (libc.so.6:mempcpy) redirected to 0x484d95c (mempcpy) --13966-- REDIR: 0x494296c (libc.so.6:calloc) redirected to 0x4845fc0 (calloc) --13966-- REDIR: 0x494a620 (libc.so.6:strchrnul) redirected to 0x484d7b0 (strchrnul) --13966-- REDIR: 0x4946de0 (libc.so.6:strnlen) redirected to 0x4849a70 (strnlen) --13966-- REDIR: 0x4947978 (libc.so.6:strstr) redirected to 0x484df98 (strstr) --13966-- REDIR: 0x4947010 (libc.so.6:strncpy) redirected to 0x4849e28 (strncpy) more/proc/self/cmdline ==13966== ==13966== HEAP SUMMARY: ==13966== in use at exit: 8,514 bytes in 8 blocks ==13966== total heap usage: 13 allocs, 5 frees, 9,288 bytes allocated ==13966== ==13966== Searching for pointers to 8 not-freed blocks ==13966== Checked 80,244 bytes ==13966== ==13966== LEAK SUMMARY: ==13966== definitely lost: 0 bytes in 0 blocks ==13966== indirectly lost: 0 bytes in 0 blocks ==13966== possibly lost: 0 bytes in 0 blocks ==13966== still reachable: 8,514 bytes in 8 blocks ==13966== suppressed: 0 bytes in 0 blocks ==13966== Rerun with --leak-check=full to see details of leaked memory ==13966== ==13966== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ==13966== ==13966== 1 errors in context 1 of 1: ==13966== Invalid write of size 4 ==13966== at 0x4001348: _dl_start_user (in /lib/ld-2.16.so) ==13966== by 0x40012DC: __start (in /lib/ld-2.16.so) ==13966== Address 0x7eab38cc is on thread 1's stack ==13966== 4 bytes below stack pointer ==13966== ==13966== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that Matters. http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users