Re: Signal handling changes

2002-08-29 Thread David Taylor

On Thu, 29 Aug 2002, Tim Robbins wrote:

 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.

I'm seeing the same behaviour on, erm, surprisingly enough a kernel/world
from August 24:

FreeBSD gattaca.yadt.co.uk 5.0-CURRENT FreeBSD 5.0-CURRENT #0:
Sat Aug 24 02:25:26 BST 2002
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GATTACA i386

However, at least that shows it isn't any local setup issue, I guess.

-- 
David Taylor
[EMAIL PROTECTED]
The future just ain't what it used to be

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Signal handling changes

2002-08-28 Thread Tim Robbins

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.00 seconds elapsed


5.0-CURRENT i386 built August 24:

$ ./a.out
1.00 seconds elapsed

(wish I had more datapoints for the `broken' case)


#include err.h
#include signal.h
#include time.h
#include unistd.h

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 [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message