lkml.org 
[lkml]   [2004]   [Feb]   [26]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateWed, 25 Feb 2004 22:44:10 -0800
FromAndrew Morton <>
SubjectRe: /proc visibility patch breaks GDB, etc.
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:01    [W:0.193 / U:0.280 seconds]
©2003-2008 Jasper Spaans