Re: [PATCH 5/5] coredump: ignore non-fatal signals when coredumping to a pipe
From: Oleg Nesterov
Date: Sat Feb 23 2013 - 14:23:41 EST
Mandeep, sorry for delay.
On 02/20, Mandeep Singh Baines wrote:
>
> On Tue, Feb 19, 2013 at 12:20 PM, Mandeep Singh Baines <msb@xxxxxxxxxxxx> wrote:
> > Ah. Good point. How about this then:
> >
> > /* can't use wait_event_freezable since we suppress the fake signal on
> > SIGNAL_GROUP_COREDUMP */
> > freezer_do_not_count();
> > wait_event_interruptible(pipe->wait, pipe->readers == 1);
> > freezer_count();
Yes, I thought about freezer_do_not_count() + wait_event_interruptible()
too, but
> No that won't work either. You can't block the fake signal.
Yes.
And wait_event_freezable() can't work because it is buggy, it doesn't
clear TIF_SIGPENDING so it becomes a busy-wait loop after freezing.
34b087e48 broke the logic. Perhaps my fault, I do not remember when
I sent the patch which was applied as 24b7ead3 (but the code was wrong
anyway). And its usage is wrong too, unless I missed something. But
lets discuss this later.
As for coredump, we can fix wait_event_freezable() or reintroduce
recalc_sigpending() in __refrigerator() as you suggested.
But this doesn't solve other problems, we need more try_to_freeze's
before wait_for_dump_helper() is called.
> On suspend, you might truncate a core-dump but at least you can
> reliably suspend.
Btw, yes. Perhaps coredump should simply fail if it races with
freezer, in this case the necessary changes are simple.
But so far I'll try to make the fixes which will allow to freeze
the dumping task correctly, I hope I'll send the patches tomorrow.
It is still not clear to me whether we should change freeze_task(),
but most probably yes, this would be simpler.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/