Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Crash on jobstates since workers/49783 (commit 6a8aa2a)
- X-seq: zsh-workers 49892
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Crash on jobstates since workers/49783 (commit 6a8aa2a)
- Date: Fri, 25 Mar 2022 15:32:14 -0700
- Archived-at: <https://zsh.org/workers/49892>
- List-id: <zsh-workers.zsh.org>
I was fooling around with "zargs" as follows:
run1 () {
print -r $1 $sysparams[pid]
sleep 2
}
runN () {
zargs -n 1 -P $# -- "$@" -- run1
}
zargs -n 5 -- {1..20} -- runN
The nested calls to zargs from runN all die with a SEGV on when running:
wait ${${jobstates[(R)running:*]/#*:/}/%=*/}
Obviously in this case we're counting on the subshell NOT having
access to the parent shell's jobstates, it only wants to know about
its own jobs. I think the pre-49783 was better.
Top of the stack:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000560869c32a10 in pmjobstate (jtab=0x56086ae54130, job=3)
at parameter.c:1353
1353 if (pn->status == SP_RUNNING)
(gdb) where
#0 0x0000560869c32a10 in pmjobstate (jtab=0x56086ae54130, job=3)
at parameter.c:1353
#1 0x0000560869c32f0d in scanpmjobstates (ht=0x56086aec9200,
func=0x560869bd696d <scanparamvals>, flags=561) at parameter.c:1428
#2 0x0000560869ba4939 in scanmatchtable (ht=0x56086aec9200, pprog=0x0,
sorted=0, flags1=0, flags2=16777216,
scanfunc=0x560869bd696d <scanparamvals>, scanflags=561) at hashtable.c:386
#3 0x0000560869ba4c20 in scanhashtable (ht=0x56086aec9200, sorted=0,
flags1=0, flags2=16777216, scanfunc=0x560869bd696d <scanparamvals>,
scanflags=561) at hashtable.c:449
#4 0x0000560869bd6c89 in paramvalarr (ht=0x56086aec9200, flags=561)
at params.c:662
#5 0x0000560869bd6d5a in getvaluearr (v=0x7ffe223f0750) at params.c:680
#6 0x0000560869bd945d in getarg (str=0x7ffe223f0258, inv=0x7ffe223f023c,
v=0x7ffe223f0750, a2=0, w=0x7ffe223f0260, prevcharlen=0x7ffe223f0240,
nextcharlen=0x7ffe223f0244, flags=0) at params.c:1592
#7 0x0000560869bda3bc in getindex (pptr=0x7ffe223f02f8, v=0x7ffe223f0750,
flags=0) at params.c:1902
#8 0x0000560869bdab7e in fetchvalue (v=0x7ffe223f0750, pptr=0x7ffe223f04c8,
bracks=1, flags=0) at params.c:2122
#9 0x0000560869c07b8b in paramsubst (l=0x7ffe223f0a70, n=0x7ffe223f0a90,
str=0x7ffe223f0820, qt=0, pf_flags=64, ret_flags=0x7ffe223f0b14)
at subst.c:2553
#10 0x0000560869c030c8 in stringsubst (list=0x7ffe223f0a70,
node=0x7ffe223f0a90, pf_flags=64, ret_flags=0x7ffe223f0b14, asssub=0)
at subst.c:322
Messages sorted by:
Reverse Date,
Date,
Thread,
Author