From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1324 invoked by alias); 30 Oct 2009 21:34:01 -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: 27320 Received: (qmail 2848 invoked from network); 30 Oct 2009 21:33:58 -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-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.218.210 as permitted sender) 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; bh=yYswwBJ5Y110BhqHA/RZKm8lepDPOG5BvLif6adMgVY=; b=ocFvzHB9Hu97fXkREnEP7GHKLgGTmEHFqk1uOt1l35DMSrMvCV690tYUACOp6wjSkN 89pxmkmX3xFToFBEEzMaMkzx1yN26QyFfyvbiqX5rdIcDTOmyt+AbNEGM5IZoRm7nCPJ ErtLdnAARCLWL1QV88ZRiX9L5Qxio6yPr2k8I= 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; b=C1v3Ou1dQjuXakbuxan5I1gtxc90DGIvYaigNQ0Nz/VSOvWqiJmghKOVORQuVd8DXI 4Fmooadp06jdHQ6JBU+fRcDLF9wqECLwF1fGeFEPDWtE3NvJ0BBaIBrT6HPLEgaSoV5C iMxCWSKKvPnkOh80Sk++qIsThMixRojF3Usvc= MIME-Version: 1.0 In-Reply-To: <237967ef0910301414w7c051308m62c5227f30b74ada@mail.gmail.com> References: <20091030161027.GL3082@fsst.voodoo.lan> <237967ef0910301414w7c051308m62c5227f30b74ada@mail.gmail.com> Date: Fri, 30 Oct 2009 22:33:54 +0100 Message-ID: <237967ef0910301433v6b58a1cdo2b31306ba4adda8a@mail.gmail.com> Subject: Re: zsh eats 100% CPU with completion in / From: Mikael Magnusson To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 2009/10/30 Mikael Magnusson : > 2009/10/30 Frank Terbeck : >> The subject is not entirely correct. >> >> Zsh eats 100% CPU on a colleague's laptop if you do this: >> % cd / >> % cd .. >> % ./ >> >> Happens with the most recent CVS HEAD, too. >> That's on linux (debian stable, actually). >> >> The problem is reproducible on his machine. And it doesn't happen if >> you do this: >> % cd / >> % ./ >> >> The 'cd ..' is required. >> >> I cannot reproduce the problem on my system with exactly the same >> configuration and with exactly the same zsh version. And I am in fact >> using the very same OS (debian stable), too. >> >> As you can imagine, I am quite puzzled and I don't know how to tackle >> this. >> >> Any hints or suggestions are highly welcome. > > I can reproduce this, but not under gdb, and, curiously, not if I > first start another instance of zsh, ie: > %(1) zsh > %(2) cd / > %(2) cd .. > %(2) -> produces listing > %(2) exit > %(1) cd / > %(1) cd .. > %(1) -> hangs > > Here's a backtrace without debug symbols while i rebuild: And here's a real one, and stepping until it seems to repeat. The /* Probably shouldn't happen */ comment looks particularly suspicious. (gdb) bt #0 mb_metacharinit () at utils.c:448 #1 0x080d378c in itype_end (ptr=0x830a100 "", itype=128, once=1) at utils.c:3310 #2 0x6fa39a38 in get_comp_string () at zle_tricky.c:1450 #3 0x6fa372bc in docomplete (lst=4) at zle_tricky.c:659 #4 0x6fa3675f in expandorcomplete (args=0x6fa4cd40) at zle_tricky.c:315 #5 0x6fa36302 in completecall (args=0x6fa4cd40) at zle_tricky.c:208 #6 0x6fa25fcd in execzlefunc () from /usr/local/lib/zsh/4.3.10-dev-1/zsh/zle.so #7 0x6fa261f2 in zlecore () from /usr/local/lib/zsh/4.3.10-dev-1/zsh/zle.so #8 0x6fa267f9 in zleread () from /usr/local/lib/zsh/4.3.10-dev-1/zsh/zle.so #9 0x6fa28867 in zle_main_entry () from /usr/local/lib/zsh/4.3.10-dev-1/zsh/zle.so #10 0x08086cda in zleentry (cmd=1) at init.c:1304 #11 0x08087b93 in inputline () #12 0x08087dc8 in ingetc () #13 0x0807d595 in ihgetc () at hist.c:263 #14 0x08091c26 in zshlex () #15 0x080ab108 in parse_event () at parse.c:451 #16 0x08084209 in loop (toplevel=1, justonce=0) at init.c:132 #17 0x08087053 in zsh_main (argc=1, argv=0x77c043c4) at init.c:1454 #18 0x08055522 in main () (gdb) s 449 } (gdb) itype_end (ptr=0x830a100 "", itype=128, once=1) at utils.c:3311 3311 while (*ptr) { (gdb) 3376 return (char *)ptr; (gdb) 3377 } (gdb) get_comp_string () at zle_tricky.c:1451 1451 nnb = tt + nclen; (gdb) 1452 tt += nclen; (gdb) 1439 for (tt = s; tt < s + zlemetacs_qsub - wb;) { (gdb) 1440 if (*tt == Inbrack) { (gdb) 1445 } else if (i && *tt == Outbrack) { (gdb) 1449 int nclen = MB_METACHARLEN(tt); (gdb) mb_metacharlenconv (s=0x830a100 "", wcp=0x0) at utils.c:4254 4254 if (!isset(MULTIBYTE)) { (gdb) 4270 if (itok(*s)) { (gdb) 4276 return mb_metacharlenconv_r(s, wcp, &mb_shiftstate); (gdb) mb_metacharlenconv_r (s=0x830a100 "", wcp=0x0, mbsp=0x80f0ccc) at utils.c:4205 4205 size_t ret = MB_INVALID; (gdb) 4210 for (ptr = s; *ptr; ) { (gdb) 4229 if (wcp) (gdb) 4232 memset(mbsp, 0, sizeof(*mbsp)); (gdb) 4233 if (ptr > s) { (gdb) 4236 return 0; /* Probably shouldn't happen */ (gdb) 4237 } (gdb) mb_metacharlenconv (s=0x830a100 "", wcp=0x0) at utils.c:4277 4277 } (gdb) get_comp_string () at zle_tricky.c:1450 1450 if (itype_end(tt, IIDENT, 1) == tt) (gdb) itype_end (ptr=0x830a100 "", itype=128, once=1) at utils.c:3308 3308 if (isset(MULTIBYTE) && (gdb) 3310 mb_metacharinit(); (gdb) mb_metacharinit () at utils.c:448 448 memset(&mb_shiftstate, 0, sizeof(mb_shiftstate)); (gdb) 449 } (gdb) itype_end (ptr=0x830a100 "", itype=128, once=1) at utils.c:3311 3311 while (*ptr) { -- Mikael Magnusson