X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org X-Disclaimed: 45854 To: cygwin AT cygwin DOT com Subject: sh.exe hangs when invoked from make without a terminal MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Stephen Bennett Date: Fri, 21 Dec 2007 15:38:28 +0000 Content-Type: text/plain; charset="US-ASCII" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com test.pl: ---- $childpid=fork; die "failed to fork" if (!defined $childpid); if (! $childpid) { close STDIN; close STDOUT; close STDERR; exec "make -f test.mk &>test.out"; } ---- test.mk: ---- var=$(shell echo foobar | cat) default: @echo "$(var)" ---- Running "make -f test.mk" from a terminal works as expected -- "foobar" is echoed. Running test.pl, however, causes the sh.exe process to hang apparently indefinitely -- the first time I observed this was in an overnight cronjob, and `sh -c "echo xml4csrc2_2_0 |tr 'a-z' 'A-Z'"` had been running for approximately 11 hours. The trigger appears to be the combination of make, the pipeline appearing in the shell command, and not being attached to a terminal. If I remove any of these factors (by removing the '| cat', changing 'make -f test.mk' into 'sh -c "echo foo | cat"', or running "make -f test.mk" from a terminal), the problem does not manifest itself and everything behaves as expected. I've so far managed to reproduce the problem on three different machines with versions 3.1.17 and 3.2.25 of bash, and versions 1.5.24-2 and 1.5.25-7 of the cygwin DLL. Any suggestions? Accelrys Limited (http://www.accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316 -- 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/