From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27739 invoked from network); 9 Mar 2009 16:02:35 -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.4 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; 9 Mar 2009 16:02:35 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65743 invoked from network); 9 Mar 2009 16:02:30 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Mar 2009 16:02:30 -0000 Received: (qmail 7788 invoked by alias); 9 Mar 2009 16:02:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26704 Received: (qmail 7776 invoked from network); 9 Mar 2009 16:02:25 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 9 Mar 2009 16:02:25 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id E9EDF80307F8 for ; Mon, 9 Mar 2009 17:02:22 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly51d.srv.mailcontrol.com (MailControl) with ESMTP id n29G2GWw013415 for ; Mon, 9 Mar 2009 16:02:17 GMT Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Mar 2009 16:02:16 +0000 Date: Mon, 9 Mar 2009 16:02:15 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: Seg. fault in chpwd hook in a widget Message-ID: <20090309160215.35fc528f@news01> In-Reply-To: <090309084936.ZM27146@torch.brasslantern.com> References: <17095.1236597765@csr.com> <090309084936.ZM27146@torch.brasslantern.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Mar 2009 16:02:16.0480 (UTC) FILETIME=[6AF43200:01C9A0D0] X-Scanned-By: MailControl A_08_51_00 (www.mailcontrol.com) on 10.68.0.161 X-Virus-Scanned: ClamAV 0.92.1/9080/Fri Mar 6 20:13:38 2009 on bifrost X-Virus-Status: Clean On Mon, 09 Mar 2009 08:49:36 -0700 Bart Schaefer wrote: > On Mar 9, 11:22am, Peter Stephenson wrote: > } Subject: PATCH: Seg. fault in chpwd hook in a widget > } > } Just had a look at the Sourforge bug tracker, which normally I don't > } have time to do (please feel free to forward things to the list if you > } notice anything there which appears to be reproducible and hasn't been > } fixed); issue 2338948 is this: > > This was originally on zsh-workers, thread starting at 26089. You even > answered with a patch in 26091, which was applied 2008-11-25 or so says > the ChangeLog, but you followed *that* by saying it might need deeper > inspection. Strange I obviously came to a different conclusion then forgot about it... > I think you're right about lexsave(), although history has never really > been my bit of the code [to the extent that I "have" any bit at all]. I've committed it---I think at the worst it can only be unnecessary sometimes, but virtually all the other interaction with hbegin()/hend() outside the main command loop has this anyway. > So why *hasn't* the history mechanism exited by the time chpwd is > called? Aha; it's not direclty because of "source", it's because he's > calling "cd" from inside a ZLE widget. The hooks are invoked in a > context from which they were never meant to be invoked. The "cd -q" stuff is supposed to allow you to do this (and this is even in use in some of the functions there), but yes, buried "chpwd" etc. calls tend to cause trouble even when they don't trigger shell problems. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070