zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: zsh eats 100% CPU with completion in /
Date: Fri, 30 Oct 2009 22:33:54 +0100	[thread overview]
Message-ID: <237967ef0910301433v6b58a1cdo2b31306ba4adda8a@mail.gmail.com> (raw)
In-Reply-To: <237967ef0910301414w7c051308m62c5227f30b74ada@mail.gmail.com>

2009/10/30 Mikael Magnusson <mikachu@gmail.com>:
> 2009/10/30 Frank Terbeck <ft@bewatermyfriend.org>:
>> The subject is not entirely correct.
>>
>> Zsh eats 100% CPU on a colleague's laptop if you do this:
>> % cd /
>> % cd ..
>> % ./<tab>
>>
>> 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 /
>> % ./<tab>
>>
>> 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) <tab> -> produces listing
> %(2) exit
> %(1) cd /
> %(1) cd ..
> %(1) <tab> -> 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


  parent reply	other threads:[~2009-10-30 21:34 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-30 16:10 Frank Terbeck
2009-10-30 21:14 ` Mikael Magnusson
2009-10-30 21:25   ` Mikael Magnusson
2009-10-30 21:33   ` Mikael Magnusson [this message]
2009-10-31 20:00     ` Peter Stephenson
2009-10-31 22:43       ` Mikael Magnusson
2009-10-31 23:00         ` Peter Stephenson
2009-11-01  1:50           ` Mikael Magnusson
2009-11-01 18:31             ` Peter Stephenson
2009-11-01 19:33               ` Bart Schaefer
2009-11-01 21:12               ` Mikael Magnusson
2009-11-01 22:20                 ` Peter Stephenson
2009-11-02  0:57                   ` Mikael Magnusson
2009-11-02  1:26                     ` Mikael Magnusson
2009-11-02 16:38                       ` Peter Stephenson
2009-11-02 20:58                         ` Mikael Magnusson
2009-11-02 21:06                           ` Mikael Magnusson
2009-11-02 21:30                             ` Mikael Magnusson
2009-11-03 10:10                               ` Peter Stephenson
2009-11-03 11:24                                 ` Frank Terbeck
2009-11-02 10:06                     ` Peter Stephenson
2009-10-30 21:29 ` Benjamin R. Haskell
2009-10-30 23:01   ` Frank Terbeck
2009-10-30 23:15     ` Frank Terbeck
     [not found] <mikachu@gmail.com>
2008-02-06 15:02 ` Completion lockup Mikael Magnusson
2008-02-06 15:07   ` Ismail Dönmez
2008-02-09 17:21   ` Peter Stephenson
2008-02-09 18:04     ` Mikael Magnusson
2008-02-09 19:13       ` Peter Stephenson
2008-08-30 12:02 ` Who is sorting my completion results? Mikael Magnusson
2008-08-30 12:16   ` Peter Stephenson
2008-08-30 12:39     ` Mikael Magnusson
     [not found] ` <237967ef0902140622s7389d2c8h5a0c786dcf207422@mail.gmail.com>
     [not found]   ` <200902141801.n1EI1E2l003603@pws-pc.ntlworld.com>
     [not found]     ` <237967ef0902141019t30118690m30116c9413015d96@mail.gmail.com>
     [not found]       ` <090214111316.ZM15188@torch.brasslantern.com>
     [not found]         ` <237967ef0902141141y609b61d3i154546f6f6886c65@mail.gmail.com>
     [not found]           ` <090214133904.ZM15383@torch.brasslantern.com>
     [not found]             ` <20090216094632.30502fe9@news01>
2009-02-16  9:55               ` Problem with fake-files style and cd Mikael Magnusson
2011-05-27  1:25                 ` Mikael Magnusson
2011-05-27  4:41                   ` Bart Schaefer
2011-05-27  4:57                     ` Mikael Magnusson
2011-05-27  5:36                       ` Bart Schaefer
2011-05-27 14:24                         ` Mikael Magnusson
2011-05-27 14:39                           ` Peter Stephenson
2011-05-27 15:06                           ` Bart Schaefer
2011-05-27 15:16                             ` Mikael Magnusson
2011-05-27 15:44                               ` Bart Schaefer
2011-01-06 19:22 ` Infinite loop, can't reproduce with zsh -f Mikael Magnusson
2011-01-06 20:03   ` Peter Stephenson
2014-11-23 21:07 ` PATCH: Fix leaks of desthost in ztcp Mikael Magnusson
2014-11-23 21:53   ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2009-12-04 21:53 Add completion suffix highlighting Mikael Magnusson
2009-12-04 22:00 ` Mikael Magnusson
2009-12-05 19:31 ` Peter Stephenson
2009-12-05 19:36   ` Peter Stephenson
2009-12-05 19:49   ` Mikael Magnusson
2009-12-05 20:11     ` Peter Stephenson
2008-12-16 15:38 PATCH: edit-command-line with spaces in EDITOR Clint Adams
2008-12-16 17:07 ` Mikael Magnusson
2008-12-16 19:22   ` Peter Stephenson
2008-12-16 19:27   ` Mikael Magnusson
2008-12-16 20:51     ` Richard Hartmann
2008-12-16 21:45   ` Clint Adams
2008-12-16 22:31     ` Mikael Magnusson
2008-12-17 12:16       ` Romain Francoise
     [not found]         ` <237967ef0812170448n11bd34f8y2c98b6484c8c0024@mail.gmail.com>
     [not found]           ` <87oczb9d1j.fsf@elegiac.orebokech.com>
2008-12-17 13:17             ` Mikael Magnusson
2008-12-17 14:44         ` Greg Klanderman
2008-12-17  4:04     ` Bart Schaefer
     [not found] <okiddle@yahoo.co.uk>
2008-10-30 21:20 ` another bug: zsh_directory_name Oliver Kiddle
2008-10-30 21:26   ` Mikael Magnusson
2008-10-30 22:13     ` Peter Stephenson
2008-10-30 23:44       ` Vincent Lefevre
2008-10-31  0:14       ` Mikael Magnusson
2008-10-31  9:44       ` Oliver Kiddle
2008-10-31  9:58         ` Peter Stephenson
2008-10-30 22:16   ` Peter Stephenson
2008-10-31 11:10 ` PATCH: bug with hash builtin Oliver Kiddle
2008-10-31 21:07   ` Peter Stephenson
2008-05-04  0:52 Identify "active" region? Bart Schaefer
2008-05-04  7:16 ` Mikael Magnusson
2008-05-04 12:21 ` Peter Stephenson
2008-05-04 12:33   ` Mikael Magnusson
2008-05-04 12:35     ` Mikael Magnusson
2008-05-04 13:28       ` Mikael Magnusson
2008-05-04 18:05         ` Peter Stephenson
2008-05-04 19:10           ` Mikael Magnusson
2008-05-04 16:38       ` Bart Schaefer
2008-05-04 17:52         ` Mikael Magnusson
2008-04-13 16:54 PATCH: (large) initial support for combining characters in ZLE Peter Stephenson
2008-04-13 17:32 ` Bart Schaefer
2008-04-14  9:02   ` Peter Stephenson
2008-04-14 12:00 ` Peter Stephenson
2008-04-14 13:34 ` Mikael Magnusson
2008-04-14 13:54   ` Peter Stephenson
2008-04-15 13:58     ` Mikael Magnusson
2008-04-15 16:46       ` Peter Stephenson
2008-04-16  1:28         ` Mikael Magnusson
2008-04-16  8:47           ` Peter Stephenson
2008-04-17  9:28             ` Stephane Chazelas
2008-09-22 18:16             ` Mikael Magnusson
2008-09-22 18:36               ` Peter Stephenson
2008-09-22 18:39                 ` Mikael Magnusson
2008-04-17 18:33 ` Jun T.
2008-04-18  9:40   ` Peter Stephenson
2008-04-18 15:48     ` Jun T.
2008-04-18 16:05       ` Peter Stephenson
2008-04-19 15:04         ` Jun T.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=237967ef0910301433v6b58a1cdo2b31306ba4adda8a@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).