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.
Get latest updates about Open Source Projects, Conferences and News.