From: Patryk Jakubowski <patrics@interia.pl>
To: linux-kernel@vger.kernel.org
Subject: Invisible threads in 2.6.9
Date: Tue, 05 Oct 2004 22:59:24 +0200 [thread overview]
Message-ID: <41630B2C.5020709@interia.pl> (raw)
In-Reply-To: <S268296AbUJDTjb/20041004193948Z+2396@vger.kernel.org>
Hi.
I've been experimenting with process/thread accounting in 2.6.9-rc3 (and
2.6.8), and found this strange situation: if the leader thread of a
multi-threaded process terminates, the other threads become
undetectable. After the main thread becomes a zombie, /proc/PID/task
returns ENOENT on open. If you happen to know the TID, you can access
/proc/PID/* directly, but otherwise, there is no way to observe the
remaining threads, as far as I can see. Consider this program, for example:
|
#include
void *run(void *arg)
{
for(;;)
;
}
int main()
{
pthread_t t;
int i;
for (i = 0; i < 10; ++i)
pthread_create(&t, NULL, run, NULL);
pthread_exit(NULL);
}
|
When I run it, the system (predictably) goes to ~100% CPU utilization,
but there seems to be no way to find out who is hogging the CPU with
top(1), ps(1), or anything else. All they can show is the main thread in
zombie state, consuming 0% CPU.
Is this correct behaviour of linux?
Would not this allow user space programs to hide running executions?
This could be an opportunity for spyware to infect the machine and hide
itself perhaps? Hope I'm wrong here!
If this is the bug in kernel (procfs?) I can give you my configuration
and resulting behaviour.
Sorry for my bad english.
----------------------------------------------------------------------
Portal INTERIA.PL zaprasza... >>> http://link.interia.pl/f17cb
next parent reply other threads:[~2004-10-05 20:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <S268296AbUJDTjb/20041004193948Z+2396@vger.kernel.org>
2004-10-05 20:59 ` Patryk Jakubowski [this message]
2004-10-06 3:08 ` Invisible threads in 2.6.9 Nuno Silva
2004-10-06 7:50 ` Michal Schmidt
2004-10-06 10:14 ` Patryk Jakubowski
[not found] ` <20041006110721.GC4380@vana.vc.cvut.cz>
2004-10-06 11:36 ` Patryk Jakubowski
2004-10-06 14:58 ` Chris Friesen
2004-10-07 0:21 Albert Cahalan
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=41630B2C.5020709@interia.pl \
--to=patrics@interia.pl \
--cc=linux-kernel@vger.kernel.org \
/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