zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Will Day <willday@rom.oit.gatech.edu>,
	zsh workers mailing list <zsh-workers@sunsite.auc.dk>
Subject: Re: prob: fg not sending CONT to 'make' children
Date: Sun, 29 Aug 1999 18:42:15 +0000	[thread overview]
Message-ID: <990829184215.ZM4413@candle.brasslantern.com> (raw)
In-Reply-To: <19990829033516.A27751@rom.oit.gatech.edu>

On Aug 29,  3:35am, Will Day wrote:
} Subject: prob: fg not sending CONT to 'make' children
}
} I ran into the following problem under 3.1.6 while doing a recompile; after
} stopping (ctrl-Z) the make process, doing an 'fg' would not continue the
} make process.  Looking at the process tree, the make itself is continued,
} but its child process is still stopped.

There seems to be something wrong in signals.c:killjb().

} Another datapoint is that I generally use a shell function to run make; if
} I _don't_ use the function, it works properly.

I'm able to reproduce this in both 3.0.6 and 3.1.6-pws-1 on my linux box,
using exactly this function:

} 	% gm() {gmake $*}

I was able to continue the make by running `ps' to get the gmake process
ID (in my case it was 2888) and then running

    kill -CONT -2888 && fg

Note the negated PID, which turns the kill() into a killpg().  So gmake is
a process group leader, though whether it did that itself or zsh did it,
I'm not entirely sure; but I tend to "blame" zsh because 3.0.5 and 3.1.5
do not have the same problem.

I think this must be a case where process group management was updated
elsewhere but the change was not reflected in killjb().  The following
patch resumes the make properly in this particular example, but I'm not
sure it isn't an over-use of killpg() -- Sven, can you comment?

Index: Src/signals.c
===================================================================
@@ -591,7 +591,7 @@
         if (jn->stat & STAT_SUPERJOB) {
             if (sig == SIGCONT) {
                 for (pn = jobtab[jn->other].procs; pn; pn = pn->next)
-                    kill(pn->pid, sig);
+                    killpg(pn->pid, sig);
  
                 for (pn = jn->procs; pn->next; pn = pn->next)
                     err = kill(pn->pid, sig);

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1999-08-29 18:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-29  7:35 Will Day
1999-08-29 18:42 ` Bart Schaefer [this message]
1999-08-30  8:21 Sven Wischnowsky
1999-08-30 14:43 ` Bart Schaefer
1999-08-31 11:25 Sven Wischnowsky
1999-08-31 16:40 ` Bart Schaefer
1999-09-01  8:08 Sven Wischnowsky
1999-09-01 16:46 ` Bart Schaefer
1999-09-01 12:11 Sven Wischnowsky

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=990829184215.ZM4413@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=willday@rom.oit.gatech.edu \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).