Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: BUG: doinsert() in NextStep/OpenStep 4.2



On Oct 21, 10:31am, Brian Boonstra wrote:
} Subject: BUG: doinsert() in NextStep/OpenStep 4.2
}
} I typed "ls", got a listing, and then zsh hung.
} 
} First, I rebuilt with debugging symbols:
} 
}   % CC=/bin/cc ./configure --enable-zsh-debug
} 
} then I ran zsh.
} 
} 	In another window, I opened gdb, and attached.

So did you attach after zsh was hung (as in your first example)?  Or did
you attach first and then try to get zsh to hang?  And did it hang, or
did you get a crash of some kind?  I can't be sure from your gdb trace.

BTW, here's an update of my "gdbterm" script / autoloaded function,
which is specifically meant for running gdb on interactive programs like
shells and editors:

------
#! /bin/sh
xterm -title GDBterm -e sh -c 'exec xterm -e gdb --tty=`tty` '"$*"
------

} (gdb) p Meta
} No symbol "Meta" in current context.
} (gdb) p cs
} No symbol "cs" in current context.

"Meta" and "cs" are #define'd.  "Meta" is always 0x83, but "cs" expands
to "zshcs" everywhere except in the spot where "zshcs" is defined.  This
is a hack to get around some system libraries (curses?) that also define
a symbol "cs".

} Breakpoint 1, doinsert (str=0xbfffeea8 "l") at zle_misc.c:54
} 54                  line[cs++] = *s == Meta ? *++s ^ 32 : *s;
} (gdb) l
} 49              spaceinline(m * len);
} 50          else if(cs + m * len > ll)
} 51              spaceinline(cs + m * len - ll);
} 52          while(m--)
} 53              for(s = str; *s; s++)
} 54                  line[cs++] = *s == Meta ? *++s ^ 32 : *s;
} 55          if(neg)
} 56              cs += zmult * len;
} 57      }
} 58
} (gdb) p s
} $2 = 0xbfffeea8 "l"
} (gdb) p m
} $5 = 0

And if you continue from this point, what happens?

Since m == 0 and s[1] == 0 it looks as if it should exit the loop.  I
guess we need to see the value of "zshcs" (aka "cs") to see if it is -1
or some other bad index into line[].

} 3.0.x does not compile

Not even 3.0.7?  What's the failure, again?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author