From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
Marcelo Tosatti <marcelo.tosatti@cyclades.com.br>
Subject: Re: [BUG] 2.4.x RT signal leak with kupdated (and maybe others)
Date: Tue, 30 Sep 2003 19:47:09 +0200 [thread overview]
Message-ID: <1064944028.5634.49.camel@gaston> (raw)
In-Reply-To: <20030930173651.GU17274@velociraptor.random>
> When I wrote the kupdate code, only the real time signals could be
> queued. Now things have changed to carry the siginfo for non-RT too. The
> fact we clear the pending by hand is what allows more than a RT signal
> to be stacked, we shouldn't clear the bitflag unless we dequeue the
> signal too. That's definitely a bug (though a minor one ;)
"Minor" but leads to interesting results in the end when coupled
with something like noflushd that regulary send those signals ;)
Not only we leak them, but we also get nr_queued_signals reaching
nr_max_signals. This has the side effect of making do_notify_parent()
silently fail when a pthread is dead (libpthread use an RT signal).
The end result is that after a few days, a machine running noflushd
and thread intensive apps like evolution and gkrellm will have dozens
(or even hundreds) of zombies as the child threads are never reclaimed
by libpthread "manager" thread since it never gets the signal...
> I sure agree it should be fixed with a dequeue_signal in kupdate.
I'll cook something tomorrow (I'm away from any 2.4 machine tonight).
> BTW, things like this in daemonize don't protect against allocating
> signals (the kernel deamon should flush_signals once in a while in the
> main loop to do that):
>
> /* Block and flush all signals */
> sigfillset(&blocked);
> sigprocmask(SIG_BLOCK, &blocked, NULL);
> flush_signals(current);
>
> But it's not a big problem you shouldn't send signals to daemons
> anyways, only kupdate gives a semantic to signals.
Interesting... though hopefully, I didn't see anybody else causing
such a constant increase of nr_queued_signals so far on this laptop...
Ben.
next prev parent reply other threads:[~2003-09-30 17:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-30 16:27 [BUG] 2.4.x RT signal leak with kupdated (and maybe others) Benjamin Herrenschmidt
2003-09-30 17:36 ` Andrea Arcangeli
2003-09-30 17:47 ` Benjamin Herrenschmidt [this message]
2003-09-30 18:22 ` Andrea Arcangeli
2003-10-01 9:24 ` Benjamin Herrenschmidt
2003-10-01 9:32 ` Nigel Cunningham
2003-10-01 14:45 ` Andrea Arcangeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1064944028.5634.49.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox