[PATCH] report some ptrace failures; nuke tcp->ptrace_errno

Denys Vlasenko dvlasenk at redhat.com
Tue Mar 20 15:41:50 UTC 2012


Hi,

I tried to add code which prints a note whenever ptrace fails,
something like "<ptrace(OP):err>".

Looks like "whenever" part of this plan is not easy:
in my testing, I was always striking a case when the resulting
log is messed up in some way...

I would like to commit a limited version of this patch,
which reports only *some* ptrace errors, namely,
errors on ptrace restart operations.

While at it, patch removes tcp->ptrace_errno. I added it many months ago,
and it looks that after all it is not needed for ptrace error detection:
I failed to execute a single existing code path which is accessible
through that variable only.

I used test/sigkill_rain for testing. This patch seems
to generate non-messed-up logs. Basically,
sometimes instead of line like this:

10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <unfinished ...>

strace will emit line like this:

10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <ptrace(SYSCALL):No such process>

which tells user that strace failed to let sendto syscall
to be entered - process was dead at that point of time.

I think it is (marginally) better than what we had before.

I observed no other changes in logs while testing.

Please review.
-- 
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4.patch
Type: text/x-patch
Size: 2989 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20120320/b583473e/attachment.bin>


More information about the Strace-devel mailing list