From: Daniel Jacobowitz <dan@debian.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Peter Chubb <peter@chubb.wattle.id.au>,
kingsley@aurema.com, linux-kernel@vger.kernel.org
Subject: Re: /proc visibility patch breaks GDB, etc.
Date: Thu, 26 Feb 2004 11:02:40 -0500 [thread overview]
Message-ID: <20040226160240.GA28873@nevyn.them.org> (raw)
In-Reply-To: <20040225224410.3eb21312.akpm@osdl.org>
On Wed, Feb 25, 2004 at 10:44:10PM -0800, Andrew Morton wrote:
> Peter Chubb <peter@chubb.wattle.id.au> wrote:
> >
> >
> > In fs/proc/base.c:proc_pid_lookup(), the patch
> >
> > read_unlock(&tasklist_lock);
> > if (!task)
> > goto out;
> > + if (!thread_group_leader(task))
> > + goto out_drop_task;
> >
> > inode = proc_pid_make_inode(dir->i_sb, task, PROC_TGID_INO);
> >
> > means that threads other than the thread group leader don't appear in
> > the /proc top-level directory. Programs that are informed via pid of
> > events can no longer find the appropriate process -- for example,
> > using gdb on a multi-threaded process, or profiling using perfmon.
> >
> > The immediate symptom is GDB saying:
> > Could not open /proc/757/status
> > when 757 is a TID not a PID.
>
> What does `ls /proc/757' say? Presumably no such file or directory?
> It's fairly bizare behaviour to be able to open files which don't exist
> according to readdir, which is why we made that change.
>
> The node to tid 757 should appear under its thread group leader's
> directory: /proc/NNN/757. That node should be visible to readdir, and that
> is the node which gdb and perfmon should be looking for.
>
> Of course, we may have burnt our boats with the initial silliness. It's a
> shame that gdb and perfmon went and used it.
GDB has used it since long before any of this happened. LinuxThreads
didn't use thread groups, remember?
There is no way from GDB to figure out which thread is the thread group
leader, either, so I don't know how you propose it find the proc
directory now.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2004-02-26 16:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-26 6:27 /proc visibility patch breaks GDB, etc Peter Chubb
2004-02-26 6:44 ` Andrew Morton
2004-02-26 16:02 ` Daniel Jacobowitz [this message]
2004-02-26 19:39 ` David Mosberger
2004-02-26 20:09 ` Andrew Morton
2004-02-26 21:59 ` Kingsley Cheung
2004-02-26 22:14 ` Peter Chubb
2004-02-26 23:19 ` Andrew Morton
2004-02-26 23:29 ` Kingsley Cheung
2004-02-26 23:48 ` Peter Chubb
2004-02-26 20:10 ` Peter Chubb
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=20040226160240.GA28873@nevyn.them.org \
--to=dan@debian.org \
--cc=akpm@osdl.org \
--cc=kingsley@aurema.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@chubb.wattle.id.au \
/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