This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Refactor Linux raise implementation (BZ#15368)
- From: Aurelien Jarno <aurelien at aurel32 dot net>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 4 Sep 2016 01:50:35 +0200
- Subject: Re: [PATCH] Refactor Linux raise implementation (BZ#15368)
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
On 2016-06-17 15:43, Adhemerval Zanella wrote:
> This patch changes both the nptl and libc Linux raise implementation
> to avoid the issues described in BZ#15368. The strategy used is
> summarized in bug report first comment:
> 1. Block all signals (including internal NPTL ones);
> 2. Get pid and tid directly from syscall (not relying on cached
> 3. Call tgkill;
> 4. Restore old signal mask.
This new implementation introduces a behaviour change when a process is
run under ptrace:
1) The process call raise(SIGSTOP)
2) The parent process run ptrace (PTRACE_CONT, pid, NULL, SOME_SIGNAL)
3) The process runs some code generating a ptrace event
With the old implementation, the ptrace event captured after the process
is restarted is the one from 3). With the new implementation, given the
signals are blocked, they are only delivered when raise unblocks them.
This generates an additional ptrace event for the delivery of
SOME_SIGNAL before 3).
For reference this breaks the libnih testsuite. I believe that it is a
corner case and that the testsuite has too precise expectations. Still
I think it is worth mentioning the behavior change here in case someone
ends up debugging the same issue.
Aurelien Jarno GPG: 4096R/1DDD8C9B