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

Attachment: cygcheck.out
Description: cygcheck.out

Problem reports:
Unsubscribe info:

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