From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8786 invoked from network); 6 Apr 2000 10:28:59 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Apr 2000 10:28:59 -0000 Received: (qmail 18848 invoked by alias); 6 Apr 2000 10:28:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10537 Received: (qmail 18784 invoked from network); 6 Apr 2000 10:28:42 -0000 From: "Bart Schaefer" Message-Id: <1000406095141.ZM15654@candle.brasslantern.com> Date: Thu, 6 Apr 2000 09:51:41 +0000 In-Reply-To: <200004060818.KAA06319@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: FPATH/autoload still strange in -dev-21" (Apr 6, 10:18am) References: <200004060818.KAA06319@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: FPATH/autoload still strange in -dev-21 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 6, 10:18am, Sven Wischnowsky wrote: } Subject: Re: FPATH/autoload still strange in -dev-21 } } Bart Schaefer wrote: } } > if (autoload -U 2> /dev/null); then } > } > First zsh forks the subshell, and then the subshell forks again } } Bart sent me the strace output and there he also repeated the line } above, but slightly different: } } if (autoload -U 2>& /dev/null); then } } So, Bart, if that is the form you have in .zshenv, this explains the } processes. The second is indeed the form I had at the time I created that strace. Sorry about the confusion; the first time I typed it by hand and the second I cut'n'pasted ... (and it's yet a third way in 10316, because I cut'n'pasted _that_ while in the midst of editing it different ways to try to get zsh to tell me why it was failing ... gaah, sorry). } `2>& /dev/null' makes the shell look at the word after the } redirection. This isn't a number, so the whole thing is treated like } `&>' on file descriptor 2. I noticed that just after I sent the strace to you and deleted the `&', but I didn't resend the strace because I forgot about ... } This makes it treat it as a multio and the } funny chap with the many close()s is the zsh-tee process. ... and because removing the `&' didn't change the visible failure. Nor does removing the entire redirection, for that matter. } This is ugly. `&>' on file descriptor 2 makes no sense at all and if } even Bart is confused, I think we should do something about it. I wasn't confused ... it was an editing error. I originally tried `(autoload -U 2>&-)' which produced an error about an invalid file descriptor, and then I inadvertently changed only the `-'. However: } Make `2>& ' be silently treated like `2> '? I'd vote for that anyway. } > Now, the odd thing is, the subshell calls _exit(0), so you'd think that zsh } > would take the "then" branch of the "if" -- but it doesn't, it takes the } > "else" branch. So there must be two race conditions (?) here -- one in the } > subshell where it loses track of its child, and another where the topmost } > zsh mishandles the exit of that subshell. } } I'm not sure any more if this is really a race condition. I suspect a } memory corruption of some kind, triggered by importing $FPATH from the } environment (which would also explain why I can't reproduce, with } different allocation behaviours and all that). And the memory corruption ... steps on the exit status of the subshell as returned to the parent, somehow? I can't see how that could be ... the subshell is calling _exit(0) but the parent still takes the false branch. Hrm. } And the initial setup of fpath also depends on the site-function dirs } that are automatically added and so on... I do NOT compile with --enable-function-subdirs, if that matters. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com