This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Refactor Linux raise implementation (BZ#15368)

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
>     values);
>  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       

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]