From owner-freebsd-current Wed Aug 28 19:39:26 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1517237B400 for ; Wed, 28 Aug 2002 19:39:23 -0700 (PDT) Received: from dilbert.robbins.dropbear.id.au (233.b.004.mel.iprimus.net.au [210.50.37.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74F2C43E7B for ; Wed, 28 Aug 2002 19:39:20 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (todtl38qldwd8qph@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.3/8.12.3) with ESMTP id g7T2dHEa078940 for ; Thu, 29 Aug 2002 12:39:17 +1000 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.3/8.12.3/Submit) id g7T2dG7p078939 for current@FreeBSD.ORG; Thu, 29 Aug 2002 12:39:16 +1000 (EST) Date: Thu, 29 Aug 2002 12:39:15 +1000 From: Tim Robbins To: current@FreeBSD.ORG Subject: Signal handling changes Message-ID: <20020829123915.A78090@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It looks like there are still problems with SIGSTOP/SIGCONT signal handling. With a kernel/world from August 24 and using csh or sh (choice of shell is probably not relevant), running "sleep 30" then suspending it with ^Z then continuing it with "fg" causes the "sleep" process to exit as soon as it's continued, instead of sleeping for the remainder of the interval as it does on 4.6.2. Here's a test program that demonstrates what I mean.. the sleep(1) call in the parent process is just to avoid a race and isn't part of the bug. 4.6.2-RELEASE i386 5.0-CURRENT i386 built July 1 5.0-CURRENT alpha built July 19 OpenBSD 2.9 i386 SunOS 5.7 sparc $ ./a.out 30.000000 seconds elapsed 5.0-CURRENT i386 built August 24: $ ./a.out 1.000000 seconds elapsed (wish I had more datapoints for the `broken' case) #include #include #include #include int main(int argc, char *argv[]) { pid_t pid; int status; time_t before, after; time(&before); if ((pid = fork()) == -1) err(1, "fork"); else if (pid == 0) { sleep(30); _exit(0); } sleep(1); kill(pid, SIGSTOP); kill(pid, SIGCONT); while (wait(&status) != pid) ; time(&after); printf("%f seconds elapsed\n", difftime(after, before)); exit(0); } My first idea was that it had something to do with siginterrupt(), but errno == 0 after the sleep(3) returns prematurely. Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message