This is the mail archive of the
mailing list for the Cygwin project.
Re: zsh hangs with "command not found" (Peter A. Castro?)
On Sun, 12 Sep 2004, Thorsten Kampe wrote:
I see you are still fighting with this problem.
Thanks for the traces. Unfortinately, they don't provide much beyond
what was previously documented for this problem. I don't think it has to
do with process creation. If that were the case, every command or script
invocation would have a 10 second delay before it actually ran.
However, we have seen problems in the past having to do with process
signaling (SIGCHLD for example) and read blocking on pipes between a
parent & child. Supposedly those have been resolved, but perhaps they've
I still can't reproduce it, however.
You might be able to see if it's the parent shell or child shell which
is "hanging". When the hang occurs, in another window, do a 'ps' and see
how many shell processes are running. Do the 'ps' several times rapidly
during this exercise to ensure you get an accurate time picture of
events. If the child comes up and quickly disappears, yet the parent is
still in the "hung" state, then it's likely the signaling problem again
(or an interaction between read blocking a signaling). Or, perhaps you
see a long delay before the child even appears, which might indicate the
parent is getting stuck on a resource...possibly directory lookup.
I presume strace still causes the problem to go away? If so, it's more
indication of a timing bug.
> * Thorsten Kampe (2004-09-12 16:59 +0200)
> > This is a follow-up to the thread "zsh 4.1.1-3 on W2000 hangs with
> > command not found" from March 2004.
> > Facts:
> > Cygwin 1.5.12s(0.116/4/2) 20040907 00:06:12
> > zsh 4.2.0
> > Windows XP SP2
> > Problem:
> > zsh "hangs" about ten seconds when I try to execute a nonexistant
> > command (bash in comparison returns immediately).
> > Even unsetting all environment variables inherited from Windows and
> > deleting my .zshrc didn't make any difference.
> > Changes to march:
> > Specifying an absolute path ('/bin/foobar') and unsetting 'correct'
> > and 'correctall' make no difference anymore.
> > * Now I tried to analyze my problem with "File Monitor" from
> > SysInternals. I captured two filtered sessions: one with zsh executing
> > "foozsh" and one with bash executing "foobash" (both attached).
> > Things I noticed:
> > bash queries 88 items while zsh queries 123. This shouldn't explain
> > the ten second difference.
> > zsh spawns a new instance/process of zsh (pid 224) on line 29! Until
> > this line the query results show up with no delay in "File Monitor".
> > The next 98 lines show up with the ten second delay.
> > So either the starting of a new zsh instance/process is so terribly
> > slow or the new zsh process searches (for whatever reason) much much
> > slower than the first one.
> I've examined the output further: it's in fact the creation of a new
> process that takes the time. Compare these two snippets (one with
> difference time and one with absolute clock time):
> 27 0.00002486 zsh.exe:3496 FASTIO_QUERY_OPEN C:\foozsh.exe.lnk FILE NOT FOUND Attributes: Error
> 28 0.00002403 zsh.exe:3496 FASTIO_QUERY_OPEN C:\foozsh.lnk FILE NOT FOUND Attributes: Error
> 29 0.00010951 zsh.exe:224 FASTIO_QUERY_OPEN C:\cygwin\usr\local\bin\foozsh.exe FILE NOT FOUND Attributes: Error
> 30 0.00002486 zsh.exe:224 FASTIO_QUERY_OPEN C:\cygwin\usr\local\bin\foozsh FILE NOT FOUND Attributes: Error
> 31 0.00002570 zsh.exe:224 FASTIO_QUERY_OPEN C:\cygwin\usr\local\bin\foozsh.exe.lnk FILE NOT FOUND Attributes: Error
> 23 17:24:38 zsh.exe:2360 QUERY INFORMATION C:\cygwin\home\thorsten\whereever.exe.lnk FILE NOT FOUND Attributes: Error
> 24 17:24:38 zsh.exe:2360 QUERY INFORMATION C:\cygwin\home\thorsten\whereever.lnk FILE NOT FOUND Attributes: Error
> 25 17:24:49 zsh.exe:2360 QUERY INFORMATION C:\whereever FILE NOT FOUND Attributes: Error
> 26 17:24:49 zsh.exe:2360 QUERY INFORMATION C:\whereever.exe FILE NOT FOUND Attributes: Error
> 27 17:24:49 zsh.exe:2360 QUERY INFORMATION C:\whereever.exe.lnk FILE NOT FOUND Attributes: Error
> 28 17:24:49 zsh.exe:2360 QUERY INFORMATION C:\whereever.lnk FILE NOT FOUND Attributes: Error
> 29 17:24:49 zsh.exe:2764 QUERY INFORMATION C:\cygwin\usr\local\bin\whereever.exe FILE NOT FOUND Attributes: Error
> 30 17:24:49 zsh.exe:2764 QUERY INFORMATION C:\cygwin\usr\local\bin\whereever FILE NOT FOUND Attributes: Error
> Interestingly File Monitor shows the delay always between line 28 and
> 29 when set to differential time (which is exactly the creation of a
> new process) and between line 24 and 25 when set to "clock time"
> (maybe a bug?)
Peter A. Castro <email@example.com> or <Peter.Castro@oracle.com>
"Cats are just autistic Dogs" -- Dr. Tony Attwood
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html