From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10950 invoked from network); 10 Jan 2008 10:14:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) 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.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 Jan 2008 10:14:18 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 90803 invoked from network); 10 Jan 2008 10:14:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Jan 2008 10:14:13 -0000 Received: (qmail 2954 invoked by alias); 10 Jan 2008 10:14:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24384 Received: (qmail 2942 invoked from network); 10 Jan 2008 10:14:08 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 10 Jan 2008 10:14:08 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 7E3538058FF2 for ; Thu, 10 Jan 2008 11:14:05 +0100 (CET) Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Thu, 10 Jan 2008 11:14:04 +0100 (CET) Received: from rly02g.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly02g.srv.mailcontrol.com (MailControl) with ESMTP id m0AADoM4007496 for ; Thu, 10 Jan 2008 10:13:51 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly02g.srv.mailcontrol.com (MailControl) id m0AADgZl007355 for zsh-workers@sunsite.dk; Thu, 10 Jan 2008 10:13:42 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly02g-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id m0AA8ugX020321; Thu, 10 Jan 2008 10:13:42 +0000 (GMT) Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Thu, 10 Jan 2008 10:12:57 +0000 Date: Thu, 10 Jan 2008 10:12:56 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Cc: 459896-submitter@bugs.debian.org Subject: Re: Bug#459896: Segfaults in "apt-c(" completion Message-ID: <20080110101256.64828546@news01> In-Reply-To: <20080109205732.GA7844@scowler.net> References: <20080109122004.GA20014@bee.dooz.org> <20080109145147.GA24262@scowler.net> <200801091735.m09HZUf8007116@news01.csr.com> <20080109205732.GA7844@scowler.net> Organization: CSR X-Mailer: Claws Mail 3.2.0 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Jan 2008 10:12:57.0059 (UTC) FILETIME=[5F045B30:01C85371] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.71.1.112 X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 9 Jan 2008 15:57:32 -0500 Clint Adams wrote: > On Wed, Jan 09, 2008 at 05:35:30PM +0000, Peter Stephenson wrote: > > Doesn't happen here, but in any case I suspect this is some quite basic > > problem since the "(" forces the shell to complete all possible commands > > after it. So it's simply searching the entire set of tables for things > > that can occur in command position. It's probably some memory > > allocation thing. > > More info from valgrind: > > ==7792== Invalid read of size 4 > ==7792== at 0x80A1D23: pattryrefs (pattern.c:1873) That means the pattern prog passed down is invalid. The previous stack trace suggests it's come from scanning a hash. It looks to me like there's a pointer to a pattern prog being left flailing in some circumstances... I don't see how this can be the root cause since scanprog isn't tested to see if it's NULL, it's just used based on the SCANPM flags. So they may be set or used wrongly. Index: Src/params.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/params.c,v retrieving revision 1.140 diff -u -r1.140 params.c --- Src/params.c 27 Dec 2007 16:00:55 -0000 1.140 +++ Src/params.c 10 Jan 2008 10:05:59 -0000 @@ -1308,8 +1308,10 @@ SCANPM_KEYMATCH))))) { *inv = (v->flags & VALFLAG_INV) ? 1 : 0; *w = v->end; + scanprog = NULL; return 1; } + scanprog = NULL; } else ta = getarrvalue(v); if (!ta || !*ta) -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070