From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18059 invoked by alias); 24 Feb 2011 13:28:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28799 Received: (qmail 4696 invoked from network); 24 Feb 2011 13:27:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Thu, 24 Feb 2011 12:38:47 +0000 From: Peter Stephenson To: CC: <353863@bugs.debian.org> Subject: Re: Bugreport: completion hanging at ubo - endless loop Message-ID: <20110224123847.1ec9a904@pwslap01u.europe.root.pri> In-Reply-To: <20110223113004.6e99ffa9@pws-pc.ntlworld.com> References: <2011-02-23T11-33-06@devnull.michael-prokop.at> <20110223113004.6e99ffa9@pws-pc.ntlworld.com> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.11.49] X-Scanned-By: MailControl A_10_80_00 (www.mailcontrol.com) on 10.71.1.138 On Wed, 23 Feb 2011 11:30:04 +0000 Peter Stephenson wrote: > On Wed, 23 Feb 2011 11:50:18 +0100 > Michael Prokop wrote: > > in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=353863 > > Sebastien Desreux reported a bug about zsh with its > > completion system in a specific situation. > > > > To trigger the bug (at least 4.3.10 and 4.3.11 in Debian are > > known to be affected by this bug): > > > > zsh -f > > autoload -Uz compinit; compinit; alias ubox=ls > > ubo > > > > Then the zsh process is hanging in an endless loop, eating CPU. > > I think the answer might be never to expand aliases when the "x" would > be added to the command word. That might be easier said than done. Looks like this is my fault. There's code to stop lexical processing when we've got to the cursor position, which means the alias never gets expanded, but when I upgraded the interface I missed the fact that it was doing a test of lexflags against 1 and now needs to look for the bit LEXFLAGS_ZLE. Index: Src/lex.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/lex.c,v retrieving revision 1.64 diff -p -u -r1.64 lex.c --- Src/lex.c 21 Feb 2011 11:32:47 -0000 1.64 +++ Src/lex.c 24 Feb 2011 12:36:41 -0000 @@ -1825,7 +1825,7 @@ exalias(void) int zp = lexflags; gotword(); - if (zp == 1 && !lexflags) { + if ((zp & LEXFLAGS_ZLE) && !lexflags) { if (zshlextext == copy) zshlextext = tokstr; return 0; -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom