diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-09-20 03:40:16 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-09-20 03:40:16 -0400 |
commit | c17c4b85ca9e9af75bc16c9e49b6bf0b3ee6b4c8 (patch) | |
tree | 400953685e512a2e7f7c74c4bcc034b0169d50c0 | |
parent | libsandbox: improve debugging output a bit (diff) | |
download | sandbox-c17c4b85ca9e9af75bc16c9e49b6bf0b3ee6b4c8.tar.gz sandbox-c17c4b85ca9e9af75bc16c9e49b6bf0b3ee6b4c8.tar.bz2 sandbox-c17c4b85ca9e9af75bc16c9e49b6bf0b3ee6b4c8.zip |
libsandbox: work around process_vm_readv EFAULTsv2.8
Some people are seeing this call fail, but it's not clear why. Include
more debugging output so as to improve the reports, and let the code fall
back to the existing ptrace logic since that seems to work. This will at
least unblock people's builds.
URL: https://bugs.gentoo.org/560396
Reported-by: Jeroen Roovers <jer@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | libsandbox/trace.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libsandbox/trace.c b/libsandbox/trace.c index 1d40392..ed05c4d 100644 --- a/libsandbox/trace.c +++ b/libsandbox/trace.c @@ -104,10 +104,23 @@ static char *do_peekstr(unsigned long lptr) while (1) { if (process_vm_readv(trace_pid, &liov, 1, &riov, 1, 0) == -1) { - if (errno == ENOSYS) + int e = errno; + if (e == ENOSYS) break; + sb_eqawarn("process_vm_readv(%i, %p{%p, %zu}, 1, %p{%p, %zu}, 1, 0) failed: %s\n", + trace_pid, + &liov, liov.iov_base, liov.iov_len, + &riov, riov.iov_base, riov.iov_len, + strerror(e)); + if (e == EFAULT) { + /* This sometimes happens, but it's not clear why. + * Throw some extended debugging info before falling + * back to the ptrace code. #560396 + */ + break; + } sb_ebort("ISE:do_peekstr: process_vm_readv() hates us: %s\n", - strerror(errno)); + strerror(e)); } for (i = 0; i < liov.iov_len; ++i) |