zsh-workers
 help / color / mirror / code / Atom feed
From: Hrvoje Niksic <hniksic@gnjilux.cc.fer.hr>
To: zsh-workers@math.gatech.edu
Subject: compctl bug with beta17 on Linux
Date: Wed, 8 May 1996 11:44:30 +0200 (MET DST)	[thread overview]
Message-ID: <199605080944.LAA04529@gnjilux.cc.fer.hr> (raw)

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.



             reply	other threads:[~1996-05-08 10:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-08  9:44 Hrvoje Niksic [this message]
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

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=199605080944.LAA04529@gnjilux.cc.fer.hr \
    --to=hniksic@gnjilux.cc.fer.hr \
    --cc=zsh-workers@math.gatech.edu \
    /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).