public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Hang in bash when executing a script [regression between 1.3.12 and 1.3.20]
@ 2003-04-25 22:48 David Bender
  0 siblings, 0 replies; only message in thread
From: David Bender @ 2003-04-25 22:48 UTC (permalink / raw)
  To: cygwin





I work on an open-source test automation framework, STAF, which allows you
to start shell commands.  A user reported that when they try to run a
Cygwin bash shell command through the automation framework, and the script
itself calls into the automation framework, the script hangs.   I
originally was not able to reproduce the user's problem (the script did not
hang for me), but then I realized I was running Cygwin 1.3.12, and the user
was running Cygwin 1.3.20.  I then upgraded my Windows 2000 machine to
Cygwin 1.3.22, ran the exact same test, and the script would always hang.

Here is a script that demonstrates the problem:

#!/usr/bin/bash

export STAF_QUIET_MODE=1
echo "`date`: tests - starting"
STAFResult=`staf local ping ping`
RC=$?
PingResponse=$STAFResult
echo "Ping response = $PingResponse"
exit $RC

If I run this via:

$ bash --login -c c:/temp/test.sh

I get the correct output (and the script does not hang):

Fri Apr 25 15:53:59 CDT 2003: tests - starting
Ping response = PONG

If I run it via the automation framework:

$ staf local process start shell "c:/cygwin/bin/bash --login -c %C" command
c:/temp/test.sh stdout out.txt stderrtostdout returnstdout wait

the script hangs.  If I comment out the "STAFResult=`staf local ping ping`"
line, the script does not hang, but I don't get the PONG output:

Fri Apr 25 16:00:01 CDT 2003: tests - starting
Ping response =

If I change the first line of the original script to:

#!/usr/bin/sh

and run it via the automation framework, it does not hang and I get the
correct output:

Fri Apr 25 16:03:12 CDT 2003: tests - starting
Ping response = PONG

However, the user needs to use the original script (with /usr/bin/bash, not
/usr/bin/sh).

I'm not sure if this is a bug with the Cygwin bash implementation, but
there is certainly different behavior between 1.3.12 and 1.3.20.  I'd
appreciate any suggestions on how to resolve this issue.  The STAF
automation framework can be downloaded from
http://staf.sourceforge.net/getcurrent.php

Here is the Cygwin release:
CYGWIN_NT-5.0 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown Cygwin

Thanks.

David Bender
Internet: bdavid@us.ibm.com


--
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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-25 21:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-25 22:48 Hang in bash when executing a script [regression between 1.3.12 and 1.3.20] David Bender

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).