Re: [GIT PULL] Please pull proc and exec work for 5.7-rc1
From: Linus Torvalds
Date: Thu Apr 09 2020 - 16:04:57 EST
On Thu, Apr 9, 2020 at 12:57 PM Bernd Edlinger
<bernd.edlinger@xxxxxxxxxx> wrote:
>
> The use case where this may happen with strace
> when you call strace with lots of -p <pid> arguments,
> and one of them is a bomb. strace stuck.
Yeah, so from a convenience angle I do agree that it would be nicer to
just not count dead threads.
You can test that by just moving the
/* Don't bother with already dead threads */
if (t->exit_state)
continue;
test in zap_other_threads() to above the
count++;
line instead.
NOTE! That is *NOT* the correct true fix. I'm just suggesting that you
try if it fixes that particular test-case (I did not try it myself -
because .. lazy)
If Oleg agrees that we could take the approach that we can share a
signal struct with dead threads, we'd also need to change the
accounting to do that notify_count not when the signal struct is
unlinked, but when exit_state is first set.
I'm not convinced that's the right solution, but I do agree that it's
annoying how easily strace can get stuck, since one of the main uses
for strace is for debugging nasty situations.
Linus