Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2014 19:52:36 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r266415 - user/pho/stress2/misc
Message-ID:  <201405181952.s4IJqa7w053354@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Sun May 18 19:52:36 2014
New Revision: 266415
URL: http://svnweb.freebsd.org/changeset/base/266415

Log:
  Test seen stuck in "I" state (idle). Added check for failed fork(2).
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/mlockall3.sh

Modified: user/pho/stress2/misc/mlockall3.sh
==============================================================================
--- user/pho/stress2/misc/mlockall3.sh	Sun May 18 19:28:15 2014	(r266414)
+++ user/pho/stress2/misc/mlockall3.sh	Sun May 18 19:52:36 2014	(r266415)
@@ -123,6 +123,7 @@ int
 main(void)
 {
 	struct passwd *pw;
+	pid_t pid;
 	pthread_t cp[50];
 	int i, j;
 
@@ -146,7 +147,7 @@ main(void)
 
 	alarm(180);
 	for (i = 0; i < 8000; i++) {
-		if (fork() == 0) {
+		if ((pid = fork()) == 0) {
 			arc4random_stir();
 			for (j = 0; j < N; j++)
 				r[j] = arc4random();
@@ -158,6 +159,8 @@ main(void)
 				pthread_join(cp[j], NULL);
 			_exit(0);
 		}
+		if (pid == -1)
+			err(1, "fork()");
 		wait(NULL);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405181952.s4IJqa7w053354>