Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[BUG] Crash related to alias completion in arithmetic construct
- X-seq: zsh-workers 43508
- From: dana <dana@xxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [BUG] Crash related to alias completion in arithmetic construct
- Date: Thu, 20 Sep 2018 17:47:47 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=ft0pmvs6qyVJEETyB+7UXX+AF/+ce7nnbSFFtC0VQys=; b=NN+9RMNWCQmjHFBOkGO/rmbqSQbzQqLX1iX0YsHF/Mlf5fWWqoVbYFXoeMC9hpMXso DV37CU2/BYg5TgTlHqEsijjStmYQ1yxKnOkp2zAPRAKYuYzyoCwvg4ZttZWB2ypGTJAY 55IN92/5zdycSGvPkjgIdk6QH9YUdaPJkJpBL9cLhddb1cUodCXHpC2dtKHRH+PWPlvT zkEnW/q9i75GXcTq5wc/DyQgNpRLt/++3BgNMROBZwg4/N94cxHYxJxlvdacCm8MJFqf hLKzA/Cu+vIerKCHqQws5MV1iNVYXR4QwiKulg59x4KzOliLdP39jkNrpFHLybrJgzwj /4KQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
A co-worker was trying to perform a calculation using a bunch of nested command
substitutions within an arithmetic construct and he reported to me that the
shell segfaulted on him. He waited a day or two to tell me about it, and i guess
his history was lost, so i'm still trying to piece together what he was actually
doing, but i think i found possibly two issues.
If i can narrow down the original problem he was having i'll send another
report, but here's one that i encountered by accident during troubleshooting:
# OK
% echo $(( $(foo)^D
# OK
% alias foo=:
% echo $(( $(foo)^D
# Crash
% alias foo=': -x'
% echo $(( $(foo)^D
zsh: segmentation fault
I replicated this on 5.4.2 (Linux) and master (macOS). The ^D here is trying to
list completion possibilities, so you need the requisite set-up for that.
Back-trace from 5.4.2:
#0 hrealloc (p=0x562a558d31c0 " \205\210foo: Й\231U*V", old=8, new=new@entry=16) at ../../Src/mem.c:726
h = <optimized out>
ph = <optimized out>
#1 0x0000562a54b2b663 in zshlex_raw_add (c=c@entry=32) at ../../Src/lex.c:1937
newbsiz = 16
#2 0x0000562a54b20f5a in ingetc () at ../../Src/input.c:232
lastc = 32
#3 0x0000562a54b29069 in gettokstr (c=c@entry=58, sub=sub@entry=0) at ../../Src/lex.c:1380
act = <optimized out>
e = <optimized out>
inbl = <optimized out>
bct = <optimized out>
pct = 0
brct = 0
seen_brct = 0
fdpar = 0
intpos = 1
in_brace_param = 0
inquote = <optimized out>
unmatched = 0
peek = STRING
#4 0x0000562a54b2a9e4 in gettok () at ../../Src/lex.c:908
c = 58
d = <optimized out>
peekfd = -1
peek = <optimized out>
c = <optimized out>
d = <optimized out>
peekfd = <optimized out>
peek = <optimized out>
e = <optimized out>
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author