zsh-workers
 help / color / mirror / code / Atom feed
* compctl bug with beta17 on Linux
@ 1996-05-08  9:44 Hrvoje Niksic
  1996-05-08 23:51 ` Thorsten Meinecke
  1996-05-09  0:05 ` Zoltan Hidvegi
  0 siblings, 2 replies; 5+ messages in thread
From: Hrvoje Niksic @ 1996-05-08  9:44 UTC (permalink / raw)
  To: zsh-workers

Hi!

I've found a serious bug that causes zsh-2.6beta17 (but also beta14 and
probably lots of others) to dump core on Linux box with uname -a output:
Linux gnjilux.cc.fer.hr 1.3.98 #1 Wed May 8 03:52:40 MET DST 1996 i486


In some cases zsh coredumps when programmable completion is set, like in:
compctl -g '*(D-/)' cd

and
cd /home/p[TAB]

where the file/dir beginning with 'p' doesn't exist, it coredumps. It fails
always on this one, but in other cases it doesn't (like cd /tmp/x[TAB] when
there's no 'x' in /tmp). The problem repeats in some other cases, like in
cd /proc/<something>[TAB], which should mean that the problem is not at
Linux's side. The problem disappears if cd is not compctl-ed.

gdb shows that the shell fails in zle_tricky.c, in the second call of
get_ccompctl, where the cmdstr contains garbage (instead of "cd"), and
causes declaration char *cmd = dupstring(cmdstr) to coredump in strcpy.

Further analysis shows that cmdstr (or at least the contents of the memory
it points to) gets garbled when newlinklist() is called in zle_tricky, line
2174,
fmatches = newlinklist()

The contents cmdstr points to is garbled in alloc, which might show the bug
in allocation routines.

Zsh allocation routines were not used.



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

end of thread, other threads:[~1996-05-09 21:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-08  9:44 compctl bug with beta17 on Linux Hrvoje Niksic
1996-05-08 23:51 ` Thorsten Meinecke
1996-05-09  0:05 ` Zoltan Hidvegi
1996-05-09 14:15   ` Thorsten Meinecke
1996-05-09 21:01     ` Zoltan Hidvegi

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