lkml.org 
[lkml]   [2009]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] signal: make group kill signal fatal
On 06/02, Jiri Slaby wrote:
>
> On 05/26/2009 12:51 AM, Oleg Nesterov wrote:
> > Heh. In this case you have another (long-standing) issue, please note
> > the "if (p->flags & PF_EXITING)" check in wants_signal().
> >
> > There is no guarantee the signal will wake up the exiting task task.
> > Even SIGKILL, even if you use wait_event_interruptible() instead of
> > _killable.
>
> Last question, doesn't wait_event_interruptible return immediately in
> this case? signal_pending returns true

Yes, if a thread exits with the pending signal, then of course interruptible
wait doesn work.

> due to non-captured signal which
> killed the application

This signal can be already dequeued, but not necessary. Most probably,
when the process is killed by group the fatal signal, each thread will
exit with the shared signal pending.

> I think this is not much expected behavior, is
> it?

Well. I don't know. I'd say this is expected, but I don't think this
was specially designed ;)

> Shouldn't be that signal dequeued/cleared instead?

We can't. Think about the multithreads program. Some thread exits,
and we have a shared signal. We must not dequeue it.

We can clear TIF_SIGPENDING, and we can change recalc_sigpending_xxx()
to take PF_EXITING into account (or change their callers), but this
needs changes. And I am not sure this will right.

Oleg.



\
 
 \ /
  Last update: 2009-06-02 16:59    [W:0.627 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site