help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Crash on jobstates since workers/49783 (commit 6a8aa2a)
Date: Fri, 25 Mar 2022 15:32:14 -0700	[thread overview]
Message-ID: <CAH+w=7ZFV8t756mbOa2agfy_RK9WOF9vk+tsRt+Fgy+sd4_+7Q@mail.gmail.com> (raw)

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

             reply	other threads:[~2022-03-25 22:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 22:32 Bart Schaefer [this message]
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

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7ZFV8t756mbOa2agfy_RK9WOF9vk+tsRt+Fgy+sd4_+7Q@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \


* 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


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