Browse Source

README-linux-ptrace: correct the description of suppressed signals

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Denys Vlasenko 7 years ago
parent
commit
0ed9947c14
1 changed files with 8 additions and 12 deletions
  1. 8
    12
      README-linux-ptrace

+ 8
- 12
README-linux-ptrace View File

@@ -53,7 +53,7 @@ process (all its threads), even if some threads of the process are
53 53
 ptraced.
54 54
 
55 55
 Tracer can kill a tracee with ptrace(PTRACE_KILL, pid, 0, 0). This
56
-opeartion is deprecated, use kill/tgkill(SIGKILL) instead.
56
+operation is deprecated, use kill/tgkill(SIGKILL) instead.
57 57
 
58 58
 ^^^ Oleg prefers to deprecate it instead of describing (and needing to
59 59
 support) PTRACE_KILL's quirks.
@@ -165,17 +165,13 @@ Note that sig value may be different from WSTOPSIG(status) value -
165 165
 tracer can cause a different signal to be injected.
166 166
 
167 167
 Note that suppressed signal still causes syscalls to return
168
-prematurely. Restartable syscalls will be restarted (tracer will
169
-observe tracee to execute restart_syscall(2) syscall if tracer uses
170
-PTRACE_SYSCALL), non-restartable syscalls (for example, nanosleep) may
171
-return with -EINTR even though no observable signal is injected to the
172
-tracee.
173
-
174
-Note that restarting ptrace commands issued in ptrace-stops other than
175
-signal-delivery-stop are not guaranteed to inject a signal, even if sig
176
-is nonzero. No error is reported, nonzero sig may simply be ignored.
177
-Ptrace users should not try to "create new signal" this way: use
178
-tgkill(2) instead.
168
+prematurely. Kernel should always restart the syscall in this case:
169
+tracer would observe a new syscall-enter-stop for the same syscall,
170
+or, in case of syscalls returning ERESTART_RESTARTBLOCK,
171
+tracer would observe a syscall-enter-stop for restart_syscall(2)
172
+syscall. There may still be bugs in this area which cause some syscalls
173
+to instead return with -EINTR even though no observable signal
174
+was injected to the tracee.
179 175
 
180 176
 This is a cause of confusion among ptrace users. One typical scenario
181 177
 is that tracer observes group-stop, mistakes it for

Loading…
Cancel
Save