zsh-workers
 help / color / mirror / code / Atom feed
From: Michael Prokop <news@michael-prokop.at>
To: zsh-workers@zsh.org
Cc: Sebastien Desreux <seb@H-K.fr>, 353863@bugs.debian.org
Subject: Bugreport: completion hanging at ubo<Tab> - endless loop
Date: Wed, 23 Feb 2011 11:50:18 +0100	[thread overview]
Message-ID: <2011-02-23T11-33-06@devnull.michael-prokop.at> (raw)

[-- Attachment #1: Type: text/plain, Size: 2603 bytes --]

Hi,

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<tab>

Then the zsh process is hanging in an endless loop, eating CPU.

I've just stepped down the problem in gdb, it seems to be hanging in
this code forever (I've extracted the relevant parts that
repeat-and-repeat-again out of my gdb session, hope this helps):

,---- [ gdb session - the relevant parts / the endless loop ]
| get_comp_string (lst=4) at ../../../Src/Zle/zle_tricky.c:1487
|                             nnb = tt + nclen;
|                             nnb = tt + nclen;
|                 for (tt = s; tt < s + zlemetacs_qsub - wb;) {
|                     if (*tt == Inbrack) {
|                     } else if (i && *tt == Outbrack) {
|                         int nclen = MB_METACHARLEN(tt);
| mb_metacharlenconv (s=0x23aaf32 "", wcp=0x0) at ../../Src/utils.c:4439
|             if (!isset(MULTIBYTE)) {
|             if (itok(*s)) {
|             return mb_metacharlenconv_r(s, wcp, &mb_shiftstate);
| mb_metacharlenconv_r (s=0x23aaf32 "", wcp=0x0, mbsp=0x6b1f30) at ../../Src/utils.c:4389
|         {
|                 ret = mbrtowc(&wc, &inchar, 1, mbsp);
|         {
|             for (ptr = s; *ptr; ) {
|             if (wcp)
|             if (ptr > s) {
|             memset(mbsp, 0, sizeof(*mbsp));
|             if (ptr > s) {
|         }
| get_comp_string (lst=4) at ../../../Src/Zle/zle_tricky.c:1486
|                         if (itype_end(tt, IIDENT, 1) == tt)
|                         int nclen = MB_METACHARLEN(tt);
|                         if (itype_end(tt, IIDENT, 1) == tt)
| itype_end (ptr=0x23aaf32 "", itype=128, once=1) at ../../Src/utils.c:3491
|         {
|             if (isset(MULTIBYTE) &&
|                 (itype != IIDENT || !isset(POSIXIDENTIFIERS))) {
|                 mb_metacharinit();
| mb_metacharinit () at ../../Src/utils.c:449
|             memset(&mb_shiftstate, 0, sizeof(mb_shiftstate));
| mb_metacharinit () at ../../Src/utils.c:450
|         }
| itype_end (ptr=0x23aaf32 "", itype=128, once=1) at ../../Src/utils.c:3498
|                     int len = mb_metacharlenconv(ptr, &wc);
|                 while (*ptr) {
|         }
`----

regards,
-mika-
-- 
http://michael-prokop.at/  || http://adminzen.org/
http://grml-solutions.com/ || http://grml.org/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

             reply	other threads:[~2011-02-23 10:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 10:50 Michael Prokop [this message]
2011-02-23 11:30 ` Peter Stephenson
2011-02-23 20:03   ` Bart Schaefer
2011-02-24 12:38   ` Peter Stephenson

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=2011-02-23T11-33-06@devnull.michael-prokop.at \
    --to=news@michael-prokop.at \
    --cc=353863@bugs.debian.org \
    --cc=seb@H-K.fr \
    --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).