From nobody Mon Jun 20 12:37:23 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 78727873C17; Mon, 20 Jun 2022 12:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LRTgR2yDsz3vYw; Mon, 20 Jun 2022 12:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655728643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBZiZatdTeDsZ3W1pRIuvuEuSMVxnvgPefETHcW0B2k=; b=lZtry1tsUjH3Nprn68XUl+e9FRCEOZouID87Ilj0JP975/vX52qMd38nES/QIwmaWROfN5 +l0l9VGqnX1DjC3ZpiAEVGtT3YVkRFfMIBnAK+dF4Q+LprtsZKi/jj9yFMYJVpZT2x6sB6 8ayEk+BMlpuzeEgsTGfbzYe84pSUhWs20NLjcEhJdthGP2n/yZiVvSQ6WqiZsA8Jze/epQ PEuRZV0b1KmzFlCcB3rJnh5vSe5UJyrOwUmFcv+FWs5hvhgE9yHM/kcAmClcSN//0zsdM3 ArwOLhl/ANYYlC/YLG0YxkC5rSpa4y7SS4ZekUZrn0J6KqHBlHae9ERUjyqTDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 464FD1D718; Mon, 20 Jun 2022 12:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25KCbNRD087511; Mon, 20 Jun 2022 12:37:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25KCbNmr087510; Mon, 20 Jun 2022 12:37:23 GMT (envelope-from git) Date: Mon, 20 Jun 2022 12:37:23 GMT Message-Id: <202206201237.25KCbNmr087510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: e2c59d8dff4b - main - stress2: Fix process handling error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2c59d8dff4b3e57fed56410194c8959647b98d8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655728643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBZiZatdTeDsZ3W1pRIuvuEuSMVxnvgPefETHcW0B2k=; b=XSlkiGIUfbH9uSqFcOC+obs5/aOAdBogb31ffq3tGMTf+bgbIggl530jIOsBv3OihuYUnP cqKBFJRAVP4a6uG6xrEf53XURmGyIXsr+9N3EMCmbf21nEEPHxq4z0bjSL6XezROsjGoVt M69hs1X3JHTGbcAmmI8LPEX9ZMOp/Cf+krRpryqjhYbOKfangmCt19yTG9liLkEGA2AFCe 8mLA/Z1iyg1CMbzwYqOObzurwAqJdnKo9dMrTVvZSshKU56vFMk0A/1fKAYmbr59q00nU6 AFBk8JRJteFy1RlHggqZeM7iQC54IDPfOX/fC0nQ+0XJz24R4gK7u/v3t9XfZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655728643; a=rsa-sha256; cv=none; b=LHcgGEPpuuhfn8dydl2GGDckFY1aTo/59MiL9PEQShpt39UBKsXqNVs3f1nLkCcHeTFQnG 87tfRiC9eBUJWdQQHRqkX1OTlXNbDO35KGQeFeMmqK5hcOAUfkm5K42Xunl4enUpv/CkxT 4IVk8PIKLlRhEFn1s+OnJf1C0+HZl8nIokCmkajQDPyYC7PX1BQEcPNeRR9PGc27JxU3Ey 5ba/sPz2QoARH8PkJ49D7LaPYCvYnrzOj28YufIlKfuhn7Q/QmlA6azzNDNFqutvpIHAZ9 BvkwNVB4qt8KWAABh9ulngIjieILc35UsvQJPImiVywRPIBs7hRNAqY4tbZEUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=e2c59d8dff4b3e57fed56410194c8959647b98d8 commit e2c59d8dff4b3e57fed56410194c8959647b98d8 Author: Peter Holm AuthorDate: 2022-06-20 12:35:59 +0000 Commit: Peter Holm CommitDate: 2022-06-20 12:35:59 +0000 stress2: Fix process handling error --- tools/test/stress2/misc/mlockall6.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/test/stress2/misc/mlockall6.sh b/tools/test/stress2/misc/mlockall6.sh index b83e033736fc..33b20ce3137a 100755 --- a/tools/test/stress2/misc/mlockall6.sh +++ b/tools/test/stress2/misc/mlockall6.sh @@ -140,7 +140,7 @@ test2(void) for (i = 0; i < 100000 && share2[R2] == 0; i++) touch(); /* while child is running */ - if (waitpid(pid, &status, 0) == -1) + if (waitpid(pid, &status, 0) != pid) err(1, "wait"); if (status != 0) @@ -169,7 +169,7 @@ test(void) int main(void) { - pid_t pid; + pid_t pids[PARALLEL]; size_t len; time_t start; int i, s, status; @@ -183,12 +183,13 @@ main(void) s = 0; while (s == 0 && (time(NULL) - start) < RUNTIME) { for (i = 0; i < PARALLEL; i++) { - if ((pid = fork()) == 0) + if ((pids[i] = fork()) == 0) test(); } atomic_add_int(&share[R0], 1); /* Start test() runs */ for (i = 0; i < PARALLEL; i++) { - waitpid(pid, &status, 0); + if (waitpid(pids[i], &status, 0) != pids[i]) + err(1, "wait"); if (status != 0) { fprintf(stderr, "FAIL: status = %d\n", status);