Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: job control debug



On Wed, 5 Sep 2018 21:07:40 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> This should help debug Rimmerworld pipeline problems.
> +/* Uncomment to debug problems with job control */
> +/*#define DEBUG_JOB_CONTROL*/
> +
> +#ifdef DEBUG_JOB_CONTROL
> +#define ATTACHTTY(pgrp, index) attachtty(pgpr, index)
                                              ^^

Sorry, small typo.

I won't check this in since there seems to be at least one (other)
oddity as you'll see from the loctaion indexes below.

Here's the output of working and non-working cases: nothing glaring
stands out, and indeed there's no key difference between the
attachtty() calls.


Working:

camnpupstephen% echo foo | { sleep 0.01 | more }
attachtty(7233728): pgrp = 10503, mypgrp = 10503
set_gleader(10): 1 = 0
set_gleader(3): 1 = 10511
attachtty(3): pgrp = 10511, mypgrp = 10503
set_gleader(10): 1 = 0
attachtty(7233728): pgrp = 10503, mypgrp = 10503
set_gleader(10): 1 = 0
set_gleader(9): 1 = 10511
set_gleader(10): 2 = 0
set_gleader(10): 1 = 0
set_gleader(10): 2 = 0
set_gleader(9): 2 = 10512
set_gleader(10): 1 = 0
set_gleader(10): 2 = 0
set_gleader(9): 2 = 10512
set_gleader(11): 2 = 0
attachtty(14): pgrp = 10503, mypgrp = 10503
set_gleader(8): 2 = 0
attachtty(8): pgrp = 10503, mypgrp = 10503
set_gleader(8): 1 = 0
attachtty(4): pgrp = 10503, mypgrp = 10503


Non-working:

camnpupstephen% echo foo | { : | more }
attachtty(7233728): pgrp = 10503, mypgrp = 10503
set_gleader(10): 1 = 0
set_gleader(3): 1 = 10514
attachtty(3): pgrp = 10514, mypgrp = 10503
set_gleader(10): 1 = 0
attachtty(7233728): pgrp = 10503, mypgrp = 10503
set_gleader(10): 1 = 0
set_gleader(9): 1 = 10514
set_gleader(10): 2 = 0
set_gleader(10): 1 = 0
set_gleader(10): 2 = 0
set_gleader(9): 2 = 10515
set_gleader(10): 1 = 0
zsh: done                    echo foo | 
zsh: suspended (tty output)  { : | more; }
set_gleader(10): 2 = 0
set_gleader(9): 2 = 10515
set_gleader(11): 2 = 0
attachtty(14): pgrp = 10503, mypgrp = 10503
set_gleader(6): 2 = 10514
attachtty(4): pgrp = 10503, mypgrp = 10503

parent shell = 10503
more = 10516

I can also see another zsh job while this is suspended --- probably a
"superjob" or something like that.


pws



Messages sorted by: Reverse Date, Date, Thread, Author