zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bogus "no such job" (Re: Preliminary release of 3.0.8 - please test)
@ 2000-03-10  9:33 Sven Wischnowsky
  2000-03-10 10:52 ` Geoff Wing
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 2000-03-10  9:33 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> Bart Schaefer wrote:
> 
> ...
> > 
> > I can believe that a race condition might cause "no such job: 3" once,
> > but twice in a row is impossible.  So the only possible answer is that
> > the one and only job has STAT_NOPRINT set but *not* STAT_SUBJOB, which
> > in turn happens only at exec.c:768 and 806 (in 3.0.8; in 3.1.6-dev-19,
> > exec.c:993 and 1031), both in execpline().  See jobs.c:setprevjob(),
> > which is called from setcurjob().
> 
> The one in 1031 isn't interesting here, it only makes the sub-shells
> created for stopped lists not report their jobs (list_pipe_child is
> non-zero only in those sub-shells). Leaves us with the one in 993.
> This is used to make sure that jobs started for commands which are
> not the first one in a pipeline and jobs started from some kind of 
> pipeline nesting (e.g. in a loop in a pipeline) are not shown.
> 
> Given that, your suggestion:
> 
> > Now, it may be that the right solution is to have setprevjob() ignore
> > jobs that have STAT_NOPRINT set, but I wouldn't want that to mask some
> > more serious job-state problem.  If you have any insights, share 'em.
> 
> seems sensible. But... how can such a job survive when the super-job
> of the (main) pipeline is dead? I wished I could find a way to
> reproduce it.

I've played some more yesterday evening/night but still couldn't get
it to happen (with dev-19, that is).

Geoff, do you remember what you did before you got that message? Did
you kill some job/process? What (kind of) commands did you suspend?
Pipes with lists in them, commands that do some kind of signal
handling? (Yes, I'm guessing wildly...)


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: Bogus "no such job" (Re: Preliminary release of 3.0.8 - please test)
@ 2000-03-09 12:01 Sven Wischnowsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2000-03-09 12:01 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Mar 3,  2:55am, Geoff Wing wrote:
> } Subject: Re: Preliminary release of 3.0.8 - please test
> }
> } Bart Schaefer <schaefer@candle.brasslantern.com> typed:
> } :On Feb 29, 10:33am, Geoff Wing wrote:
> } :} Subject: Re: Preliminary release of 3.0.8 - please test
> } :} After some initial usage, got it into a state of:
> } :} % %
> } :} fg: no such job: 3
> } :} % %%
> } :} fg: no such job: 3
> } :} % fg
> } :} fg: no current job
> } :} % jobs
> } :} %
> } :Hrm.  The job handling code is now identical to 3.1.6-dev-19, so if you
> } :can get 3.0.8 into that state theres a problem for 3.1.6 as well.
> } 
> } I'm thinking that getjob() may need a setcurjob() before it checks curjob.
> 
> Since Sven has been incommunicado for a couple of days, I tried to look
> into this myself in more detail.  The only two places where getjob() is
> called are from bin_kill(), and from bin_fg() *after* the setcurjob()
> that you noted.
> 
> I can believe that a race condition might cause "no such job: 3" once,
> but twice in a row is impossible.  So the only possible answer is that
> the one and only job has STAT_NOPRINT set but *not* STAT_SUBJOB, which
> in turn happens only at exec.c:768 and 806 (in 3.0.8; in 3.1.6-dev-19,
> exec.c:993 and 1031), both in execpline().  See jobs.c:setprevjob(),
> which is called from setcurjob().

The one in 1031 isn't interesting here, it only makes the sub-shells
created for stopped lists not report their jobs (list_pipe_child is
non-zero only in those sub-shells). Leaves us with the one in 993.
This is used to make sure that jobs started for commands which are
not the first one in a pipeline and jobs started from some kind of 
pipeline nesting (e.g. in a loop in a pipeline) are not shown.

Given that, your suggestion:

> Now, it may be that the right solution is to have setprevjob() ignore
> jobs that have STAT_NOPRINT set, but I wouldn't want that to mask some
> more serious job-state problem.  If you have any insights, share 'em.

seems sensible. But... how can such a job survive when the super-job
of the (main) pipeline is dead? I wished I could find a way to
reproduce it.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: Preliminary release of 3.0.8 - please test
@ 2000-02-29 10:33 Geoff Wing
  2000-02-29 16:18 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Geoff Wing @ 2000-02-29 10:33 UTC (permalink / raw)
  To: zsh-workers

Geoff Wing <mason@primenet.com.au> typed:
:Bart Schaefer <schaefer@candle.brasslantern.com> typed:
::I realize most people on this list are now using 3.1.6-dev-19, but it'd
::be helpful to me if a few people could grab this and at least report any
::build-time errors.  Several of the changes are to the configure scripts,
::and I have only Linux to test on.
:Builds OK on NetBSD 1.4T (i386).  Haven't done much testing yet.

After some initial usage, got it into a state of:
% %
fg: no such job: 3
% %%
fg: no such job: 3
% fg
fg: no current job
% jobs
%

Will see if I can reproduce.

Regards,
-- 
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874


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

end of thread, other threads:[~2000-03-10 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-10  9:33 Bogus "no such job" (Re: Preliminary release of 3.0.8 - please test) Sven Wischnowsky
2000-03-10 10:52 ` Geoff Wing
  -- strict thread matches above, loose matches on Subject: below --
2000-03-09 12:01 Sven Wischnowsky
2000-02-29 10:33 Preliminary release of 3.0.8 - please test Geoff Wing
2000-02-29 16:18 ` Bart Schaefer
2000-03-03  2:55   ` Geoff Wing
2000-03-08  7:30     ` Bogus "no such job" (Re: Preliminary release of 3.0.8 - please test) 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).