This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bash hangs searching the "." PATH for a pipe in a function


I am getting hard bash (64-bit) hangs, where the bash process occupies one full cpu part and Windows Task Manager must be used to stop it; 'kill -KILL' has no effect.

I have reduced it to the following case, where b.sh is in the same directory and just does a 'cat':

  export PATH=/usr/bin:.
  a(){ { echo a; } | b.sh; }
  a

Now bash hangs. The hang disappears if the function is redefined as:

  a(){ :; { echo a; } | (b.sh); }

but comes back for any of

  a(){ :; { echo a; } | b.sh; }
  a(){ { echo a; } | (b.sh); }

The problem appears to come when the '.' directory is searched:
If '.' is replaced by the full $PWD path in PATH, there is no hang.
If b.sh is moved to another directory, and this one is put before '.' in $PATH, there is no hang.
If b.sh is removed so that '.' needs to be searched without a hit, there is hang again.

It seems related to some setting of a network directory:
If I create a new empty directory next to the problematic one using Windows Explorer and call the troubled a() inside, it hangs there too.
Created with cygwin mkdir gives no hang.
Created with Windows Explorer at most other places, including local disk, gives no hang.

The scripts are now getting patched with colons and parentheses here and there to keep them running but we are curious and grateful for a better way!

Kind regards

Christer Lundberg

Attachment: cygcheck.out
Description: cygcheck.out

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]