DragonFly BSD
DragonFly bugs List (threaded) for 2005-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Hang on ctrl+Z after the MPSAFE tsleep/wakeup commit


From: YONETANI Tomokazu <qhwt+dfly@xxxxxxxxxx>
Date: Thu, 1 Dec 2005 22:03:39 +0900

Hello.
After the following commit, stopping a user process with SIGSTOP
does not give control to the shell:
http://leaf.dragonflybsd.org/mailarchive/commits/2005-11/msg00109.html
It only happens with a program which does fork() inside it.  Here's
a simple program to demonstrate this.

$ cat a.c
#include <sys/types.h>
#include <sys/wait.h>
#include <err.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int
main(int ac __unused, char **av)
{
	pid_t pid;
	int rc = -1;

	switch ((pid = fork())) {
	case -1:		/* error */
		err(1, "fork");
		break;
	case 0:			/* child */
		return execvp(av[1], av + 1);
	default:
		wait(&rc);
		break;
	}
	if (rc != 0)
		errx(1, "child returned %d", rc);
	return 0;
}

$ gcc -g -Wall a.c && ./a.out cat
(press ctrl+Z here, and it accepts no other signals until you send
SIGCONT to the child process from another screen)

`ps' command shows that the stuck processes are marked as "TL+"
(meaning that they didn't give up even after having been stopped?).



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]