From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 1B27F8045D for ; Tue, 27 Oct 2026 15:54:20 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69RFr69g030310; Tue, 27 Oct 2026 18:53:07 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RFr69g030310 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="gpupLiEc" Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69RFqiqp030249 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 27 Oct 2026 18:52:44 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RFqiqp030249 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48e00f3929bso669271f8f.0 for ; Tue, 27 Oct 2026 08:52:44 -0700 (PDT) X-Gm-Message-State: AFq9FYJ7M61FD9rQSkXc0XT9e3GcZD7GyGShe77LCPSuQ1CEcjX+pBjb ZEJAMDPTgQDZOSpIWlDmCoy1glxxFHL/Qy3rsiqJMjHWmMGSrE4ktpLLfvYrHn5T4ESAxxrO0UI Pse+vOWfnHpV0ZmIv3fiKUOoq2iifTULZCk1LVkx2hcNvDHJo79NjVA== X-Gm-Gg: AYBFou0Kr7+OJXTE25xU0kmQ/11ownJTkvzhKQEwDTSorLE2xfsRLn8UIMkWU7S+dr/ lW2lSo+cMYoTHFU506sLEbPwN68keFetcYeeko9nYC6BqmmtM4JbBUaisxEkMfh/wxSQS5nXrk+ wlQKcXjSkhfiR1h3gKnKQ77qxpZuz+6R0As6rXL1ao3kuv89w7rgI1cn0PNLwEuRKbRHa0nFmOW GmyarQQ7wgarBx+t4X9y4uCK432W0sT2r5zvVsIIcdUpmHyX4CSWfsTNlYMT4Befd70EJoaS/ze qQMB5npeVTuRPySAaDNbMVTmB6jsNX26WdYvuBYkFFVyayRjeiBRdZNfirQjErgsjLkX/9Scwu8 Cbz3s34AeAogHi2ahLHeM5jLe X-Received: by 2002:a5d:5e01:0:b0:48e:5d06:8b66 with SMTP id ffacd0b85a97d-48e5d068b99mr131876f8f.19.1793116364176; Tue, 27 Oct 2026 08:52:44 -0700 (PDT) X-Received: by 2002:a5d:5e01:0:b0:48e:5d06:8b66 with SMTP id ffacd0b85a97d-48e5d068b99mr131820f8f.19.1793116363503; Tue, 27 Oct 2026 08:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793116363; cv=none; d=google.com; s=arc-20260327; b=iltec0dGo6nNIgu88/7e0N/g3WdDv/z7pRdH23abx4/y+puKfq4YAJXQjp2NvsPJZl VX2ck0izfzNoEPQIEhFLkBsyIWS5QAtTEwi0u77LSbjb2Nnah+L2JiZPUThdVSDPZj7t sjbKcYYWxvKS+q/s7BuNlwb7D3ga1dLDVkHhFMllNVCmuQP9HmYEaQdjNcprqfoRy22q ZLK96wzCr7RzbqdgH8jadlQ7DuiO+BoZcIKk6Bzl7oYQCWCbuco5+DJtcrCNTzb9uog3 jLLJ/thhG0d/K3LU+kdKQO3DdjEOSCtV7Bs6PQNP2AE8X0e04x3cWXQ1Bm1kK6apXhVG 1Tdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jddLCDs74LlarjMnk+cXwicsAvnmtEVDLB0wPQj2eSc=; fh=WpT6aB7RBAGHZeWZzqAr71yzRFbPTYkPWKsRagLn48Q=; b=gcbc3vpR0DZb4q1zm1CqoTClSSsfvvY9tvIsxvw4vS7cFY1MiSGKSxhWwPQRem98SZ F4xvQdnvEHGmj1S67pitY8Ci4JiWRv0YnvUcBn/nqOhl9b02ficADannTnjkBaD42QMR +W85614+sDviBPYk56ZIZxaV97KTpBktHuIkk9n9tXuL4YjsxDbZILdsjOY5iTu9tJAg GkQ0RRMRC4glnVqxmiulqlMwadaEtdQOpiOWXbf/Th4PENbmQwUSLQJe2p6shX+UDFd9 O+XAbXzTIXuSM94EmIP7bsYnPqjEusDeQEgjhv1FktBGl1SBeeFQE7jn/9xqDKvqD3ta 0veA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=gpupLiEc; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48e3ed12943si20914113f8f.355.2026.10.27.08.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2026 08:52:43 -0700 (PDT) Received-SPF: pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=gpupLiEc; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=jddLCDs74LlarjMnk+cXwicsAvnmtEVDLB0wPQj2eSc=; b=gpupLiEc17c0 xHSvaOBm56lNrEr6gtkuEjEaRtUjMLgq8XdjsAQCP6AUD9PT583mn7wBUd2NnwWR9+WnVFPOzCXf1 Q243BchF9B4YC2ODu57dFWVTbZcvVRFrKKpGz3Sa710sZEzmSPCmiC6iuga5hD1/yFR4Zybxw2BfG s611CMFzwJzmUyk1Q/hD3FGYiFVozdCuvdekvDrR8LVlFpK0npTPZH5fSap7wfG9CfFlS3QP2ATDO GTTdZWHhugNng5jbJmKw3e1OkEjHcEMhUpCJmtbRmUUIxH4NyldeMFs5S7tsu0XOIpYvM5hKfJflk S7T4pGoMYeEyQXKGdRkc9A==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=LekKit-T14) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xLjPu-00GIfe-18; Tue, 27 Oct 2026 16:52:33 +0100 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Tue, 27 Oct 2026 17:51:33 +0200 Message-ID: <20261027155236.1226178-8-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261027155236.1226178-1-eva.kurchatova@virtuozzo.com> References: <20261027155236.1226178-1-eva.kurchatova@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v2 7/7] selftests/futex: fail futex_waitv when the waiter failed X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org The waiter thread records a failed futex_waitv() with ksft_test_result_fail(), while the main thread reports the same subtest as passed and exits with the status it collected, so a waiter that returned the wrong index or an error ended in a pass; and the main thread never waited for the waiter, so its result could land after the verdict. Have the waiter return its status instead, join it after each wake and report one result for the subtest. https://virtuozzo.atlassian.net/browse/VSTOR-134205 Feature: fix selftests Signed-off-by: Eva Kurchatova --- .../selftests/futex/functional/futex_waitv.c | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/futex/functional/futex_waitv.c b/tools/testing/selftests/futex/functional/futex_waitv.c index a94337f677e1..a9de197637ea 100644 --- a/tools/testing/selftests/futex/functional/futex_waitv.c +++ b/tools/testing/selftests/futex/functional/futex_waitv.c @@ -47,16 +47,28 @@ void *waiterfn(void *arg) res = futex_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC); if (res < 0) { - ksft_test_result_fail("futex_waitv returned: %d %s\n", - errno, strerror(errno)); + ksft_print_msg("futex_waitv returned: %d %s\n", + errno, strerror(errno)); + return (void *)1; } else if (res != NR_FUTEXES - 1) { - ksft_test_result_fail("futex_waitv returned: %d, expecting %d\n", - res, NR_FUTEXES - 1); + ksft_print_msg("futex_waitv returned: %d, expecting %d\n", + res, NR_FUTEXES - 1); + return (void *)1; } return NULL; } +static int join_waiter(pthread_t waiter) +{ + void *failed; + + /* A waiter that cannot be joined counts as failed */ + if (pthread_join(waiter, &failed)) + return 1; + return failed != NULL; +} + int main(int argc, char *argv[]) { pthread_t waiter; @@ -104,6 +116,10 @@ int main(int argc, char *argv[]) ksft_test_result_fail("futex_wake private returned: %d %s\n", res ? errno : res, res ? strerror(errno) : ""); + join_waiter(waiter); + ret = RET_FAIL; + } else if (join_waiter(waiter)) { + ksft_test_result_fail("futex_waitv private\n"); ret = RET_FAIL; } else { ksft_test_result_pass("futex_waitv private\n"); @@ -137,6 +153,10 @@ int main(int argc, char *argv[]) ksft_test_result_fail("futex_wake shared returned: %d %s\n", res ? errno : res, res ? strerror(errno) : ""); + join_waiter(waiter); + ret = RET_FAIL; + } else if (join_waiter(waiter)) { + ksft_test_result_fail("futex_waitv shared\n"); ret = RET_FAIL; } else { ksft_test_result_pass("futex_waitv shared\n"); -- 2.56.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel