mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Question regarding /proc/<pid>/fd and pipes
       [not found] <5DRW7-322-1@gated-at.bofh.it>
@ 2006-02-08 14:45 ` Bodo Eggert
  2006-02-09  3:22   ` John Schmerge
  2006-02-09 17:21   ` Jan Engelhardt
  0 siblings, 2 replies; 5+ messages in thread
From: Bodo Eggert @ 2006-02-08 14:45 UTC (permalink / raw)
  To: John Schmerge, linux-kernel

John Schmerge <schmerge@speakeasy.net> wrote:

>   I know that the symlinks in the /proc/<pid>/fd directory point to
> bogus filenames for pipes (i.e. 'pipe:[64682]') and am wondering if
> every process that reads and writes from that pipe will share the same
> bogus symlink name.

yes

>   In essence, I'm wondering if there's any way to list all of the pid's
> of processes using an anonomous pipe.

man find. I don't know a bettre way.
-- 
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question regarding /proc/<pid>/fd and pipes
  2006-02-08 14:45 ` Question regarding /proc/<pid>/fd and pipes Bodo Eggert
@ 2006-02-09  3:22   ` John Schmerge
  2006-02-09  9:02     ` Bodo Eggert
  2006-02-09 17:21   ` Jan Engelhardt
  1 sibling, 1 reply; 5+ messages in thread
From: John Schmerge @ 2006-02-09  3:22 UTC (permalink / raw)
  To: 7eggert; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 1325 bytes --]

Bodo,

Thanks for the answer... I've got one more question: will the symlinks
to the pipe be the same for both the read and write ends in all
processes sharing the pipe?

I've got some sort of funky race condition occurring between the read
from the pipe and the exiting of the process on the write-end of the pipe...
The read-process is supposed to exit after the write-process finishes
(and does in about 1/2 the time), but I think I'm seeing the read-process
blocked by something even after the write-process completes... Both top
and ps give no indication that the read-process is blocked on a read(2).
I've got some digging to do, but I'm thinking that this might actually be
a kernel bug.

Thanks,
John

On Wed, 8 Feb 2006, Bodo Eggert wrote:

> John Schmerge <schmerge@speakeasy.net> wrote:
>
> >   I know that the symlinks in the /proc/<pid>/fd directory point to
> > bogus filenames for pipes (i.e. 'pipe:[64682]') and am wondering if
> > every process that reads and writes from that pipe will share the same
> > bogus symlink name.
>
> yes
>
> >   In essence, I'm wondering if there's any way to list all of the pid's
> > of processes using an anonomous pipe.
>
> man find. I don't know a bettre way.
> --
> Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
> verbreiteten Lügen zu sabotieren.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question regarding /proc/<pid>/fd and pipes
  2006-02-09  3:22   ` John Schmerge
@ 2006-02-09  9:02     ` Bodo Eggert
  0 siblings, 0 replies; 5+ messages in thread
From: Bodo Eggert @ 2006-02-09  9:02 UTC (permalink / raw)
  To: John Schmerge; +Cc: 7eggert, linux-kernel

On Wed, 8 Feb 2006, John Schmerge wrote:

> Thanks for the answer... I've got one more question: will the symlinks
> to the pipe be the same for both the read and write ends in all
> processes sharing the pipe?

It seems like yes. You can find it out by sinply trying it out.

> I've got some sort of funky race condition occurring between the read
> from the pipe and the exiting of the process on the write-end of the pipe...
> The read-process is supposed to exit after the write-process finishes
> (and does in about 1/2 the time), but I think I'm seeing the read-process
> blocked by something even after the write-process completes... Both top
> and ps give no indication that the read-process is blocked on a read(2).
> I've got some digging to do, but I'm thinking that this might actually be
> a kernel bug.

Do you close() the writing end in the process that's supposed to read?
-- 
Top 100 things you don't want the sysadmin to say:
98. What the hell!?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question regarding /proc/<pid>/fd and pipes
  2006-02-08 14:45 ` Question regarding /proc/<pid>/fd and pipes Bodo Eggert
  2006-02-09  3:22   ` John Schmerge
@ 2006-02-09 17:21   ` Jan Engelhardt
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2006-02-09 17:21 UTC (permalink / raw)
  To: 7eggert; +Cc: John Schmerge, linux-kernel

>
>>   I know that the symlinks in the /proc/<pid>/fd directory point to
>> bogus filenames for pipes (i.e. 'pipe:[64682]') and am wondering if
>> every process that reads and writes from that pipe will share the same
>> bogus symlink name.
>

It is not really bogus. And it is not really real at the same time.
This is how it works AFAIU: pipes get created in pipefs (cat 
/proc/filesystems) (as do sockets in sockfs), and their dentry IS named 
"pipe:[46682]". You just can't see it because 1. you are prevented from 
mounting pipefs, 2. there are no readdir/etc. functions for pipefs 
implemented ATM.

>>   In essence, I'm wondering if there's any way to list all of the pid's
>> of processes using an anonomous pipe.
>
Hm. Do you mean list "all pids of procs using an anynymous pipe" or
"list all pids [...]" using an anonymous pipe... :)

AFAICS, the first is not possible; the latter is (a fork-and-exec 
thing) is something different.


Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Question regarding /proc/<pid>/fd and pipes
@ 2006-02-08  7:27 John Schmerge
  0 siblings, 0 replies; 5+ messages in thread
From: John Schmerge @ 2006-02-08  7:27 UTC (permalink / raw)
  To: linux-kernel

Hi all,

  I'm attempting to track down a spooky problem with some code that I've
written (running under the 2.6.11.12 kernel) and am wondering if there's a
way to track (via /proc) both ends of an open pipe that was created with a
pipe(2) system call... It appears that I've got a bunch of spawned
processes stuck in some kind of sleep caused by a read(2) on the
read-end of a pipe and would like to eliminate the possibility that I've
done something truly bone-headed in my code like leaving the write-end
of the pipe open in another process. (I don't think I did, but want to
be sure :).

  I know that the symlinks in the /proc/<pid>/fd directory point to
bogus filenames for pipes (i.e. 'pipe:[64682]') and am wondering if
every process that reads and writes from that pipe will share the same
bogus symlink name.

  In essence, I'm wondering if there's any way to list all of the pid's
of processes using an anonomous pipe.

  Please CC me on any answers.

  Thanks,
  John

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-02-09 17:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5DRW7-322-1@gated-at.bofh.it>
2006-02-08 14:45 ` Question regarding /proc/<pid>/fd and pipes Bodo Eggert
2006-02-09  3:22   ` John Schmerge
2006-02-09  9:02     ` Bodo Eggert
2006-02-09 17:21   ` Jan Engelhardt
2006-02-08  7:27 John Schmerge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®