zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: bug in zsh wait builtin - rhbz#1150541
Date: Sun, 26 Oct 2014 00:17:17 +0100	[thread overview]
Message-ID: <20141026001717.4d4e3f5a@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20141026000448.12fa03fd@pws-pc.ntlworld.com>

On Sun, 26 Oct 2014 00:04:48 +0100
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> I'm now wondering whether we need
> 
> 	if (!jn || (!(jn->stat & (STAT_CURSH|STAT_BUILTIN)) &&
> 		    jn - jobtab != thisjob))
> 	    addbgstatus(pid, (int)lastval2);
> 
> i.e. if there's *no* job we should remember the PID because we don't
> have enough information to say we don't need to remember it.  That's
> probably safe --- we've already had a succesful return value from wait
> or one of its relatives so it's a child of the shell --- but there might
> be cases where it's inefficient.  I suppose I ought to check what
> happens when job control is off.

It's typically OK with job control off, there is a job at that point...

I found the places where this (!jn) triggers by adding error output in
this case and running the test suite...

./A02alias.ztst: starting.
This test hangs the shell when it fails...
*** /tmp/zsh.ztst.err.4092	Sun Oct 26 00:10:01 2014
--- /tmp/zsh.ztst.terr.4092	Sun Oct 26 00:10:01 2014
***************
*** 0 ****
--- 1 ----
+ pid 4118 with no job
Test ./A02alias.ztst failed: error output differs from expected as shown above for:
  print -u $ZTST_fd 'This test hangs the shell when it fails...'
  alias cat='LC_ALL=C cat'
  cat <(echo foo | cat)

So happens with <(....).

./C04funcdef.ztst: starting.
*** /tmp/zsh.ztst.err.12383	Sun Oct 26 00:10:30 2014
--- /tmp/zsh.ztst.terr.12383	Sun Oct 26 00:10:30 2014
***************
*** 0 ****
--- 1 ----
+ pid 12454 with no job
Test ./C04funcdef.ztst failed: error output differs from expected as shown above for:
  () (cat $1 $2) <(print process expanded) =(print expanded to file)
Was testing: Process substitution with anonymous functions

And =(...), not surprisingly.

./D03procsubst.ztst: starting.
*** /tmp/zsh.ztst.err.12707	Sun Oct 26 00:10:31 2014
--- /tmp/zsh.ztst.terr.12707	Sun Oct 26 00:10:31 2014
***************
*** 0 ****
--- 1,2 ----
+ pid 12713 with no job
+ pid 12714 with no job
Test ./D03procsubst.ztst failed: error output differs from expected as shown above for:
  paste <(cut -f1 FILE1) <(cut -f3 FILE2)
Was testing: <(...) substitution

And again.

./V08zpty.ztst: starting.
*** /tmp/zsh.ztst.err.15038	Sun Oct 26 00:10:44 2014
--- /tmp/zsh.ztst.terr.15038	Sun Oct 26 00:10:44 2014
***************
*** 0 ****
--- 1 ----
+ pid 15042 with no job
Test ./V08zpty.ztst failed: error output differs from expected as shown above for:
  zpty cat cat
  zpty -w cat a line of text
  var=
  zpty -r cat var && print -r -- ${var%%$'\r\n'}
  zpty -d cat
Was testing: zpty with a process that does not set up the terminal: internal write

So happens with processes forked by zpty.  I get messages in the
completion tests but no errors which I guess are also zpty.

So it looks like these cases aren't relevant and we can ignore the case
of no job and still pick up all the cases we do need.

pws


  reply	other threads:[~2014-10-25 23:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  7:53 Tim Speetjens
2014-10-21 20:02 ` Peter Stephenson
2014-10-22  6:55   ` Bart Schaefer
     [not found]     ` <CAO7vJOjrb=N3xuTJVSb7U8mdXtexYp8nN4YaoknfUb3fofU2zg@mail.gmail.com>
2014-10-22 15:48       ` Bart Schaefer
2014-10-22 18:32     ` Chet Ramey
2014-10-23  8:32     ` Peter Stephenson
2014-10-24  4:50       ` Bart Schaefer
2014-10-24  8:04         ` Tim Speetjens
2014-10-25 19:08         ` Peter Stephenson
2014-10-25 21:54           ` Bart Schaefer
2014-10-25 22:28           ` Bart Schaefer
2014-10-25 22:32             ` Bart Schaefer
2014-10-25 23:04               ` Peter Stephenson
2014-10-25 23:17                 ` Peter Stephenson [this message]
2014-10-26 19:01                   ` Peter Stephenson
2014-10-26 20:41                     ` Bart Schaefer
2014-10-26 21:22                       ` Peter Stephenson

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20141026001717.4d4e3f5a@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

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