On Mon, Mar 30, 2015 at 01:02:12PM +0300, Dmitry V. Levin wrote: > On Sun, Mar 29, 2015 at 10:37:33PM -0400, Andrew Guertin wrote: > > When running the command > > `strace -e trace=file man` > > I don't get filenames in the output. For all other executables I've > > tried, strace works fine. Only man has problems. > > I suppose /usr/bin/man is installed as a privileged executable in your > system, and process_vm_readv syscall fails.
This patch workarounds this issue, which is definitely a kernel bug.
--- a/util.c
+++ b/util.c
@@ -1003,10 +1003,13 @@ umoven(struct tcb *tcp, long addr, unsigned int len,
void *our_addr)
case ENOSYS:
process_vm_readv_not_supported = 1;
break;
+ case EPERM:
+ /* operation not permitted, try PTRACE_PEEKDATA
*/
+ break;
case ESRCH:
/* the process is gone */
return -1;
- case EFAULT: case EIO: case EPERM:
+ case EFAULT: case EIO:
/* address space is inaccessible */
return -1;
default:
@@ -1158,7 +1161,12 @@ umovestr(struct tcb *tcp, long addr, unsigned int len,
char *laddr)
case ESRCH:
/* the process is gone */
return -1;
- case EFAULT: case EIO: case EPERM:
+ case EPERM:
+ /* operation not permitted, try
PTRACE_PEEKDATA */
+ if (!nread)
+ goto vm_readv_didnt_work;
+ /* fall through */
+ case EFAULT: case EIO:
/* address space is inaccessible */
if (nread) {
perror_msg("umovestr: short
read (%d < %d) @0x%lx",
--
ldv
pgpz4n0cOM8YA.pgp
Description: PGP signature
------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
