valgrind on Android does not listen to vgdb -
on android, running valgrind 3.9.0 --vgdb=yes
creates fifo pipe should listen vgdb commands (along pipe reverse direction , piece of shared memory). however, command such vgdb instrumentation on
hangs forever.
- this tested on armv7 emulator android 4.0.3 (which reported work on readme.android) , on galaxy note ii android 4.3.1 based cyanogenmod
- valgrind built
export hwkind=generic
,--with-tmpdir=/data/local/inst
; other options accordingreadme.android
file - both devices rooted , running insecure adbd's
- two valgrind builds tested, 1 built ndk-r6 , 1 ndk-r9d. result same on configurations
- both devices able run valgrind neither runs listen vgdb
for reference, valgrind command , output follows:
# ./valgrind -v -v -v --vgdb=yes sleep 1000 ==3640== memcheck, memory error detector ==3640== copyright (c) 2002-2013, , gnu gpl'd, julian seward et al. ==3640== using valgrind-3.9.0 , libvex; rerun -h copyright info ==3640== command: sleep 1000 ==3640== --3640-- valgrind options: --3640-- -v --3640-- -v --3640-- -v --3640-- --vgdb=yes --3640-- contents of /proc/version: --3640-- linux version 2.6.29-g46b05b2 (vchtchetkine@vc-irv.irv.corp.google.com) (gcc version 4.4.3 (gcc) ) #28 thu nov 17 06:39:36 pst 2011 --3640-- arch , hwcaps: arm, armv7-vfp-neon --3640-- page sizes: 4096, max supported 4096 --3640-- valgrind library directory: /data/local/inst/lib/valgrind --3640-- tt/tc: vg_(init_tt_tc) (startup of code management) --3640-- tt/tc: cache: 6 sectors of 27597024 bytes each = 165582144 total --3640-- tt/tc: table: 6 tables of 11531696 bytes each = 69190176 total --3640-- tt/tc: table: 65521 entries each = 393126 total entries max occupancy 255528 (65%) --3640-- reading syms /system/xbin/busybox --3640-- svma 0x0000008120, avma 0x0000008120 --3640-- object doesn't have symbol table --3640-- object doesn't have dynamic symbol table --3640-- reading syms /data/local/inst/lib/valgrind/memcheck-arm-linux --3640-- svma 0x0038000000, avma 0x0038000000 --3640-- object doesn't have dynamic symbol table --3640-- scheduler: using generic scheduler lock implementation. --3640-- reading suppressions file: /data/local/inst/lib/valgrind/default.supp ==3640== embedded gdbserver: reading /data/local/inst/vgdb-pipe-from-vgdb-to-3640-by-???-on-??? ==3640== embedded gdbserver: writing /data/local/inst/vgdb-pipe-to-vgdb-from-3640-by-???-on-??? ==3640== embedded gdbserver: shared mem /data/local/inst/vgdb-pipe-shared-mem-vgdb-3640-by-???-on-??? ==3640== ==3640== control process using vgdb (which ==3640== don't want do, unless know you're doing, ==3640== or doing strange experiment): ==3640== /data/local/inst/lib/valgrind/../../bin/vgdb --pid=3640 ...command... ==3640== ==3640== debug process using gdb: start gdb ==3640== /path/to/gdb sleep ==3640== , give gdb following command ==3640== target remote | /data/local/inst/lib/valgrind/../../bin/vgdb --pid=3640 ==3640== --pid optional if 1 valgrind process running ==3640== --3640-- tt/tc: initialise sector 0
the vgdb command (there no output until it's killed):
# ./vgdb instrumentation on ^csyscall failed: interrupted system call error opening /data/local/inst/vgdb-pipe-to-vgdb-from-3640-by-???-on-??? read cmd result pid
some notes:
on real device, hostname , user not ???
t0lte
,root
properly. has nothing issue.i'm sure fifo piping works in aforementioned
/data/local/inst
directory because following works:
in root shell inside /data/local/inst
:
# mkfifo examplepipe # echo message > examplepipe ... command exits after pipe read in shell ... #
in shell:
# cat examplepipe message
i'm sure vgdb finding valgrind instance because doesn't report
fifo not found
error.i'm guessing @ point reason vgdb hangs valgrind not listen pipe reason.
valgrind operation runs expected. callgrind outputs produced etc. since vgdb doesn't work, instrumentation starting/stopping , therefore on-demand profiling not possible.
what may issue?
this known limitation of vgdb on android. vgdb-invoker-ptrace.c should ported on android.
see https://bugs.kde.org/show_bug.cgi?id=338977 more details
Comments
Post a Comment