From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Cc: Kamil Dudka <kdudka@redhat.com>
Subject: SEGV with alias\
Date: Thu, 23 Jul 2015 21:52:50 +0000 [thread overview]
Message-ID: <20150723215250.GG1847@tarsus.local2> (raw)
[CCing reporter of the recent ihungetc() issue]
Typing <l><s><Backslash><Enter><Enter> may segfault if 'ls' is aliased.
The segfault is:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6fe31d5 in _int_malloc (av=0x7ffff72f1e40, bytes=2) at malloc.c:4308
4308 malloc.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6fe31d5 in _int_malloc (av=0x7ffff72f1e40, bytes=2) at malloc.c:4308
#1 0x00007ffff6fe5a70 in *__GI___libc_malloc (bytes=2) at malloc.c:3660
#2 0x00000000004694f3 in zshcalloc (size=2) at mem.c:918
#3 0x000000000045464b in inungetc (c=10) at input.c:442
#4 0x0000000000449a53 in ihungetc (c=10) at hist.c:926
#5 0x000000000044993b in ihungetc (c=92) at hist.c:908
#6 0x0000000000449949 in ihungetc (c=92) at hist.c:908
#7 0x0000000000449949 in ihungetc (c=92) at hist.c:908
#8 0x0000000000449949 in ihungetc (c=92) at hist.c:908
#9 0x0000000000449949 in ihungetc (c=92) at hist.c:908
#10 0x0000000000449949 in ihungetc (c=92) at hist.c:908
Another behaviour is this:
### Short expansion: two warnings
$ zsh -f
% alias ls=:
% ls\
>
Warning: backing up wrong character.
Warning: backing up wrong character.
### Long expansion: infinite loop
% alias ls=:\ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
% ls\
>
Warning: backing up wrong character.
Warning: backing up wrong character.
Warning: backing up wrong character.
...
^C
Warning: backing up wrong c%
haracter.
### The '%' in the next-to-last line is in reverse video.
I'm not completely sure what's the distinction — my 'print
$ZSH_PATCHLEVEL' statements were acting up (!), reporting sometimes
a commit before the ihungetc fix and sometimes after it. So I'm
guessing the segfault is pre-35854 and the warning after it.
Reported by 'thm' on IRC.
Cheers,
Daniel
next reply other threads:[~2015-07-23 21:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 21:52 Daniel Shahaf [this message]
2015-07-23 22:18 ` Bart Schaefer
2015-07-24 2:33 ` Bart Schaefer
2015-07-24 8:53 ` 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=20150723215250.GG1847@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=kdudka@redhat.com \
--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).