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

Lundberg Christer
Wed Feb 17 10:34:00 GMT 2016

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 is in the same directory and just does a 'cat':

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

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

  a(){ :; { echo a; } | (; }

but comes back for any of

  a(){ :; { echo a; } |; }
  a(){ { echo a; } | (; }

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 is moved to another directory, and this one is put before '.' in $PATH, there is no hang.
If 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 445276 bytes
Desc: cygcheck.out
URL: <>
-------------- next part --------------
Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list