[lkml]   [2011]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: waitpid(WNOHANG) should report SIGCHLD-notified signals [Re: [PATCH 09/11] job control: reorganize wait_task_stopped()]
Hello, Jan.

On Sun, May 15, 2011 at 04:40:17PM +0200, Jan Kratochvil wrote:
> It may be not related, I do not inderstand the kernel internals being
> discussed.
> I was told by Roland McGrath that after SIGCHLD of a ptrace even from tracee
> invokes sighandler for that SIGCHLD in the tracer then waitpid(WNOHANG) still
> may return 0 as the signal is not yet ready. I was not able to reproduce it
> with a testcase myself.

Hmmm... I could easily be wrong but AFAICS that shouldn't happen. If
you can reproduce the problem, please let us know.

> But if it is a case it should be fixed as there is no later notification when
> to call waitpid(WNOHANG) again. And sure the debugger cannot busy-loop poll
> it.

But, the current WNOHANG wait is racy. It's unlikely but definitely
possible for WNOHANG to fail when it's expected to succeed (not the
above case but more convoluted ones).

But, just out of curiosity, is there any reason the ptracer itself
should be doing something other than waitpid() while tracee is
running? It's not like ptrace requests can be issued during that time
and sleeping waitpid() is way saner mechanism to wait for tracee
events than signal.



 \ /
  Last update: 2011-05-15 18:49    [W:0.128 / U:7.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site