Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: FreeBSD compatability feature request



Vincent Stemen wrote:
> After replacing /bin/sh with zsh, it was able to fully boot up and
> initialize the system except for one other problem, which appears to be a
> different bug in sh emulation mode.  It hangs when running the nfsd init
> script.  If I <cntl>c out of it, the rest of the system comes up, but
> without NFS.
> 
> I finally isolated the problem.  Below is a small script, called t, that
> reproduces it.
> 
> # cat t
> 
> _find_processes()
> {
>     ps | while read pid command
>     do
>         echo "pid=$pid  $command"
>     done >&2
> 
>     echo "xxx Exited loop xxxxxxxxxxxxxxxxxxxxxxx" >&2
> }
> 
> xxx=$(_find_processes)
> 
> #--- end of script -------

Making a link to sh from zsh and running `sh t' I can get this to happen
on Fedora, but only intermittently.  I think it's the new option I
added, since I can get this to happen with `zsh -f -o notrapsasync', but
not with `zsh -f'.  So it looks like I've introduced a race.

This obviously needs fixing before we can release anything with the
option it it, but is going to take some tracing.  Here is what I've got.

I have two processes running:
pws      18664 14486  0 10:38 pts/2    00:00:00 sh t
pws      18665 18664  0 10:38 pts/2    00:00:00 sh t

(I thought I had another one but it seemed to be hung from a previous
go.)

18664 is waiting for output from the the $(...) to finish.  This is normal.

18665 is waiting for a job to finish in zwaitjob.  Somehow it's
got into a state where it wasn't prepared to handle the SIGCHLD, and
it's therefore missed it.

I'll keep looking.  Any suggestions would be gratefully received.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author