Mail Archives: cygwin/2007/03/06/16:43:48
Tried just redirecting output to a file, and the behavior is exactly the same. This did tell me something interesting though ... the 'Bad file descriptor' error was in fact written to the log *before* the hung process (gawk) was killed:
/bin/sh: cannot duplicate fd 31 to fd 0: Bad file descriptor
Exactly the same as before. So this is a clue after all. Anyone know that this error actually means? Has anyone seen this before? I'm not sure if I've stumped the list, need to provide more info, or if this is some commonly known problem that I just didn't find any info about when I googled. Maybe it's time I actually started grepping through cygwin source?
Any advice appreciated.
-----Original Message-----
From: Schuff, Scott
Sent: Tuesday, March 06, 2007 1:05 PM
To: 'cygwin AT cygwin DOT com'
Subject: RE: Getting 'Bad file descriptor' error with 1.5.24-2
Okay, after a little investigation, I have a little more info. First, I think the 'Bad File Descriptor' errors are actually due to the hung process (sed, gawk, etc) being killed. It's hard to tell because the parent process doesn't flush its output buffer until after that, but I think it's probably from the parent process using an invalid process or pipe handle when the child is killed. So it's likely more symptom than cause.
I've also discovered that the cygwin hangs only seem to happen often when the make is issued under perl. If I issue the exact same make from a bash prompt, it generally succeeds. I'm using the perl construct:
open(CHILDOUT,"$cmd 2>&1 |");
while (<CHILDOUT>) {
{
print $fp ">>$_";
}
to read the output of the make line by line, process it, and log it. This script has worked with a much older (circa 2002/2003) version of the cygwin tools. Has anyone else seen any problems like this? I tried both perl 5.6.1 and 5.8.8 and they both behave exactly the same way with the latest and previous version of the cygwin tools. For now I guess I'll just try piping the output to a file and reading the whole thing after make exits. Does anyone have any suggestions for futher debugging these hangs?
Thanks for any help!
-Scott
-----Original Message-----
From: Schuff, Scott
Sent: Thursday, March 01, 2007 3:54 PM
To: 'cygwin AT cygwin DOT com'
Subject: Getting 'Bad file descriptor' error with 1.5.24-2
Hi all -
I'm running a build of a fairly large/complex software project with Make, and at random points the whole thing will hang just after printing the error:
/bin/sh: cannot duplicate fd 31 to fd 0: Bad file descriptor
Sometimes the leaf process is sed, sometimes gawk, sometimes sh, but in all cases they are buried under a half dozen 'make's, and 'sh's.
Does anyone have a suggestion on how to debug this? Is there any setting I can change in windows or Cygwin to avoid it? I have tried some things like increasing desktop heap, etc, but still see the problem.
Thanks in advance for any help.
-Scott
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -