* [BUG] Crash related to alias completion in arithmetic construct
@ 2018-09-20 22:47 dana
0 siblings, 0 replies; only message in thread
From: dana @ 2018-09-20 22:47 UTC (permalink / raw)
To: Zsh hackers list
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-20 22:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 22:47 [BUG] Crash related to alias completion in arithmetic construct dana
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).