zsh-workers
 help / color / mirror / code / Atom feed
* Bugreport: completion hanging at ubo<Tab> - endless loop
@ 2011-02-23 10:50 Michael Prokop
  2011-02-23 11:30 ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Prokop @ 2011-02-23 10:50 UTC (permalink / raw)
  To: zsh-workers; +Cc: Sebastien Desreux, 353863

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-24 13:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23 10:50 Bugreport: completion hanging at ubo<Tab> - endless loop Michael Prokop
2011-02-23 11:30 ` Peter Stephenson
2011-02-23 20:03   ` Bart Schaefer
2011-02-24 12:38   ` Peter Stephenson

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).