From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16857 invoked from network); 23 Mar 2009 11:46:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Mar 2009 11:46:27 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 1276 invoked from network); 23 Mar 2009 11:46:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Mar 2009 11:46:21 -0000 Received: (qmail 27434 invoked by alias); 23 Mar 2009 11:46:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26768 Received: (qmail 27422 invoked from network); 23 Mar 2009 11:46:16 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 23 Mar 2009 11:46:16 -0000 Received: from mail-fx0-f171.google.com (mail-fx0-f171.google.com [209.85.220.171]) by bifrost.dotsrc.org (Postfix) with ESMTP id C2CB780590EB for ; Mon, 23 Mar 2009 12:46:11 +0100 (CET) Received: by fxm19 with SMTP id 19so1640768fxm.45 for ; Mon, 23 Mar 2009 04:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=PS9cbIqc76fNlDyBLoADCcIj7s2TDig8a+sr/dPDrII=; b=go2KrlwzKauo+Ppc2Mwi3ea6tZOOBoUmFXxlOB+Ultl3rXzNF3Sd6N2Jo/Y0szwjAn z5kUQ5dtNB+9nTUHq3W+Q4JcKccJdJRcp9111WLgy9mEMTk3M5VU2r/ea+G0gRwlktvs LMi4W5RPJhVSSj1a974S+lWDBjl8PoeTMz9Rw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=N16rDCykAk3+ioeQo6J89qW9RgL6atWbGAxDSZaAjJkIq2hc3UursDuJufQw7/G3gT 3WNv6camroPn4D654pbm174NRg9kSbqpmZ+X5LsOSvB4xE5brSAVfNhkKVkvhv+1oCpj xNK9NI9Nry2AotxREeQOVGBDkMd3wbbJfqYHA= MIME-Version: 1.0 Received: by 10.204.63.143 with SMTP id b15mr2488841bki.8.1237808770935; Mon, 23 Mar 2009 04:46:10 -0700 (PDT) In-Reply-To: <20090323104928.0c59c30f@news01> References: <237967ef0903201412h2a7b99c9ya5101509a3972313@mail.gmail.com> <20090320224856.73dae001@pws-pc> <237967ef0903201615x72769fe4va86273c3fa07cb2e@mail.gmail.com> <20090322125410.66a9d294@pws-pc> <237967ef0903221605h11983bb4v4eda8d2a1c41a1c9@mail.gmail.com> <20090323104928.0c59c30f@news01> Date: Mon, 23 Mar 2009 12:46:10 +0100 Message-ID: <237967ef0903230446u6810c06cs511fddcc21fd2a8a@mail.gmail.com> Subject: Re: cd -s symlink hangs (sometimes?) From: Mikael Magnusson To: zsh-workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/9151/Mon Mar 23 06:23:57 2009 on bifrost X-Virus-Status: Clean 2009/3/23 Peter Stephenson : > On Mon, 23 Mar 2009 00:05:10 +0100 > Mikael Magnusson wrote: >> I just noticed (ls -l /proc/$$/fd) that with this last commit, zsh now keeps >> all my old directories open, even when I don't use -s or anything special. > > Lucky you noticed. I started noticing I couldn't unmount my ipod and memory cards, it took a few tries until I made the connection with the change in zsh though. Trying the patch now and it does stop the leak... but you didn't think this adventure was over yet, did you? zsh -f % chmod -x . % cd -s /nonexisting cd: no such file or directory: /nonexisting % ls ls: write error: Bad file descriptor Oops, stdout is closed now. I can only get it to happen with -s and the unexecutable dir though, so it's not really worse than the loop :). I looked at the code, and while I don't really have any idea what's going on, the only place that closes d->dirfd without checking close_dir seems to be restoredir()? I don't know if that is the guilty party though. -- Mikael Magnusson