|
From: Julian S. <js...@ac...> - 2011-10-25 07:28:45
|
Hi Philippe,
You recently made vgdb.c work on Android (#283600, r12204), and
also re-enabled --vgdb=yes by default on Android. This is good,
and I presume it works OK on the Android emulator (yes?)
Problem is it fails at startup on a real device (Pandaboard running
Linaro Android 2.3.5), when creating the FIFOs:
==5127== error 1 Operation not permitted
==5127== mknod /sdcard/vgdb-pipe-from-vgdb-to-5127-by-???-on-???
==5127== valgrind: fatal error: vgdb FIFOs cannot be created.
Trying to do 'mknod' from the shell shows I can't do that either:
/data/local# busybox mknod /sdcard/vgdb-pipe-from-vgdb-to-5127 p
mknod: /sdcard/vgdb-pipe-from-vgdb-to-5127: Operation not permitted
and stracing the above command makes it clear:
mknod("/sdcard/vgdb-pipe-from-vgdb-to-5127", S_IFIFO|0666) = -1 EPERM
(Operation not permitted)
This seems strange at first because V can create temp files in /sdcard
ok. On reading the man page for mknod I see this
ERRORS
[...]
EPERM mode requested creation of something other than a regular
file, FIFO (named pipe), or Unix domain socket, and the caller is
not privileged (Linux: does not have the CAP_MKNOD capability);
also returned if the file system containing pathname does not
support the type of node requested.
So .. probable cause is that /sdcard is VFAT, and VFAT can't support
FIFO nodes.
If I can't figure out how to fix this easily, I might revert the hunk
below for 3.7.0, so that it doesn't fail by default at startup on Android.
Not an ideal solution, I know, but time is short, and it doesn't mean
gdbserver is unusable on Android -- only that you need to have --vgdb=yes
to use it (+ put the FIFOs on a non-vfat filesystem).
J
-#if defined(VGPV_arm_linux_android)
-VgVgdb VG_(clo_vgdb) = Vg_VgdbNo; // currently disabled on Android
-#else
VgVgdb VG_(clo_vgdb) = Vg_VgdbYes;
-#endif
|
|
From: Philippe W. <phi...@sk...> - 2011-10-25 19:33:23
|
> You recently made vgdb.c work on Android (#283600, r12204), and > also re-enabled --vgdb=yes by default on Android. This is good, > and I presume it works OK on the Android emulator (yes?) I (manually) tested it on the Android armv5 emulator (I had to put several patches from John Reiser to have Valgrind working on Android armv5 emulator). Note that I did not run the regression tests. But I still had multiple permissions problems with /sdcard (e.g. with the FIFO, but also with creating executables on /sdcard). According to the README.android, it understood this is a common problem. I first tried to solve it with things such as mount -o remount rw /sdcard mount -o remount exec /mnt/secure/asec which somewhat helped (e.g. it was possible to have executable files on /sdcard) but still had problems with FIFOs, similar to yours. I thought it was a "normal failure". => using the following option in configure works for me: --with-tmpdir=/data/local/Inst An alternative (not tried) might be --with-tmpdir=/data/local I assume that having the tmpdir in /data/local will be ok for all Android systems (as the Inst directory can be created there). So, it might solve more generally the problem of temp files for Valgrind (/sdcard being problematic very often it seems). > So .. probable cause is that /sdcard is VFAT, and VFAT can't support > FIFO nodes. > > If I can't figure out how to fix this easily, I might revert the hunk > below for 3.7.0, so that it doesn't fail by default at startup on Android. > Not an ideal solution, I know, but time is short, and it doesn't mean > gdbserver is unusable on Android -- only that you need to have --vgdb=yes > to use it (+ put the FIFOs on a non-vfat filesystem). If /data/local is not ok as a tmpdir, setting --vgdb=no as a default on Android is as you indicate not ideal but better than a failing Valgrind. (if this bypass is applied, it would be worth adding a note about this default + the non-vfat in the user manual section "Connecting to an Android gdbserver"). Philippe |