zsh-workers
 help / color / mirror / code / Atom feed
* Crash on jobstates since workers/49783 (commit 6a8aa2a)
@ 2022-03-25 22:32 Bart Schaefer
  2022-03-27  5:34 ` Bart Schaefer
  0 siblings, 1 reply; 15+ messages in thread
From: Bart Schaefer @ 2022-03-25 22:32 UTC (permalink / raw)
  To: Zsh hackers list

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-03-29 15:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 22:32 Crash on jobstates since workers/49783 (commit 6a8aa2a) Bart Schaefer
2022-03-27  5:34 ` Bart Schaefer
2022-03-28  8:47   ` Peter Stephenson
2022-03-28 14:49     ` Peter Stephenson
2022-03-28 15:09       ` Bart Schaefer
2022-03-28 16:14         ` Peter Stephenson
2022-03-28 16:44           ` Bart Schaefer
2022-03-28 19:52             ` Peter Stephenson
2022-03-29  3:49               ` Bart Schaefer
2022-03-29  9:08                 ` Peter Stephenson
2022-03-29 13:31                   ` Peter Stephenson
2022-03-29 15:39                     ` Bart Schaefer
2022-03-29 15:36                   ` Bart Schaefer
2022-03-29 15:41                     ` Peter Stephenson
2022-03-28 15:13     ` Bart Schaefer

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).