Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Crash on jobstates since workers/49783 (commit 6a8aa2a)
- X-seq: zsh-workers 49900
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Crash on jobstates since workers/49783 (commit 6a8aa2a)
- Date: Mon, 28 Mar 2022 15:49:05 +0100 (BST)
- Archived-at: <https://zsh.org/workers/49900>
- Importance: Medium
- In-reply-to: <1409134730.698961.1648457237653@mail2.virginmedia.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7ZFV8t756mbOa2agfy_RK9WOF9vk+tsRt+Fgy+sd4_+7Q@mail.gmail.com> <CAH+w=7YyuhyAkCyRE9=f-ybLpPzMqfND=y1S=Ai_jS97Sq6J-g@mail.gmail.com> <1409134730.698961.1648457237653@mail2.virginmedia.com>
> On 28 March 2022 at 09:47 Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > On 27 March 2022 at 06:34 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > On Fri, Mar 25, 2022 at 3:32 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > The nested calls to zargs from runN all die with a SEGV on when running:
> > >
> > > wait ${${jobstates[(R)running:*]/#*:/}/%=*/}
> >
> > Minimal reproducer:
> >
> > % sleep 5 &
> > [1] 171363
> > % ( wait ${${jobstates[(R)running:*]/#*:/}/%=*/} )
> > zsh: segmentation fault (core dumped) ( wait
> > ${${jobstates[(R)running:*]/#*:/}/%=*/}; )
> > %
>
> $jobstates was still looking at the process structures which doesn't
> work in the subshell. Previously, it didn't even look at the
> main job state in a subshell. Obviously, the subshell doesn't know
> the up-to-date state anyway, and can't actually manipulate it.
> So probably the best we can do is report the last we knew about the
> job state and ignore the process structures. This probably warrants
> a bit of documentation.
Just thinking the pukka way to do this is actually zero the PN fields
in the saved job structure when we enter the subshell (unless we decide
to preserve them properly, which is more work but should be possible).
There's also a one-line test change unless we do go the extra mile
with the process structures.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author