Think about Loose Coupling | |
PerlMonks |
Re^2: How to find all open STDERR and STDOUT dups?by almut (Canon) |
on Mar 31, 2009 at 20:56 UTC ( [id://754533]=note: print w/replies, xml ) | Need Help?? |
It's not necessarily the file descriptor number that matters, but rather the OS-internal info (data structure) it refers to. If you dup(2), (">&" in Perl), you get another file descriptor (new number) holding the same info. Consider the following simple sample CGI, which hangs (for essentially the same reason that you've described):
The output you get is something like
As you can see in the NODE column, the unclosed (dup'ed) FD 3 in the child (the second lsof output) is the same node (i.e. 429306453) as FD 2 (stderr) in the parent. This is why Apache is still waiting, despite FD 1/2 already having been closed.
In Section
Seekers of Perl Wisdom
|
|