Re: [PATCH 1/1] signal: on exit skip waiting for an ack from the tracer if it is frozen
From: Oleg Nesterov
Date: Wed Jul 03 2024 - 12:50:50 EST
Suren, I am sorry for the late reply,
On 06/30, Suren Baghdasaryan wrote:
>
> > I think it would better to simply change ptrace_stop() to check TIF_MEMDIE
> > along with __fatal_signal_pending() and return in this case.
>
> I think this would not fix the case we are experiencing. In our case
> the tracee is killed from the userspace (TIF_MEMDIE is not set yet),
OK, I misunderstood the problem.
> gets stuck in ptrace_stop() waiting for an ack from the tracer and
> then is picked up by OOM-killer with the abovementioned consequences.
and __task_will_free_mem() returns true if SIGNAL_GROUP_EXIT is set...
Nevermind.
> > Of course, this won't fix all problems.
>
> As I mentioned, I'm not an expert in ptrace, so I'll gladly try any
> better solution if one is proposed.
I do not see any solution, sorry.
ptrace doesn't allow to intercept/nack SIGKILL, but at the same time it
happily allows the killed tracee to sleep in PTRACE_EVENT_EXIT. And even
another SIGKILL/whatever can't wake the tracee up.
This is historical behaviour, I do not see how can we change it. Any
change will break something.
Oleg.