I have been using Cygwin commands from my Windows CMD prompt for several months without problems. Within the past few days, every time I call a Cygwin command (ls for example), the command takes several seconds to "load" before it actually runs. If I try the same command from within a bash prompt, it runs ("loads") immediately.
The Cygwin FAQ mentions that network drives in PATH may cause problems, so I've tried some permutations of my PATH variable and network connectivity. Below, "full PATH" means my original path setting; "short PATH" means the path with only the Cygwin bin directory. Times are reported through the time command.
Timing results for ls
Connected to network:
- Run
lswithinbash: 0.124 s - Run
lswithin CMD (fullPATH): 41.29 s - Run
lswithin CMD (shortPATH): 38.56 s
Disconnected from network:
- Run
lswithinbash: 0.125 s - Run
lswithin CMD (fullPATH): 0.17 s - Run
lswithin CMD (shortPATH): 0.19 s
Results for cygcheck
I ran cygcheck -s and noticed:
Warning: There are multiple cygwin1.dlls on your path
although this may be due to running cygcheck from within Cygwin's bin directory. I completely uninstalled and reinstalled Cygwin and still see the same issue.
Results from netstat
I ran netstat -a -n before executing Cygwin's ls and after execution (while it is stalled). I did this several times and found one line from each run that appeared consistently during the delay:
UDP 127.0.0.1:55030 *:*
The port number changed from test to test.
strace results
I ran Cygwin's strace on the ls command. Most of the delay is spent in calls such as:
11685 886560 [main] ls 10020 pwdgrp::fetch_account_from_windows: line: <xxxx>
and
12684 899244 [main] ls 10020 cyg_ldap::fetch_ad_account: No entry for (objectSid=\00\00\00\00) in xxxx DC=xxxx,DC=xxxx,DC=xxxx