Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wait for SIGSTOP during attach, reinjecting unrelated signals
PTRACE_ATTACH sends SIGSTOP to this thread. However, on waitpid() we may receive some other pending signal sooner than this SIGSTOP. Therefore, we need to call waitpid() until we receive SIGSTOP. Signals other than SIGSTOP that are received need to be reinjected with PTRACE_CONT, or they will otherwise get lost. If we do not wait for the SIGSTOP signal in waitpid(), this signal will be delivered after PTRACE_DETACH, and the thread will enter the "T (stopped)" state. See ptrace(2) manpage, under the section "Attaching and detaching". Change-Id: Ifcc89cc34086988d496cd31f5dc63e9fceebcaf6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/5582149 Reviewed-by: Mike Frysinger <vapier@chromium.org>
- Loading branch information