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 8AEFE80474 for ; Tue, 27 Oct 2026 17:36:36 +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 69RHZQrx031850; Tue, 27 Oct 2026 20:35:27 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RHZQrx031850 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="b6hJnBPC" Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69RHZ46c031786 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 27 Oct 2026 20:35:04 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RHZ46c031786 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48dff112181so65858f8f.3 for ; Tue, 27 Oct 2026 10:35:04 -0700 (PDT) X-Gm-Message-State: AFq9FYKiJGoWwP2JujJJ0r4T/LP36wcuG60JIdqJKhSrzVAM9tZANG92 zjAmSArGJbXARs0FAiNrff/WeYKiPpAl1hZENBCwfqMcMnrmSRqjikcgK7MuK0znvLzCchGnssh kYszcI5hsaH2xiIJm5I3Ti3I6MtSawVEyuA/XvuA286YuYxEwlDfGpQ== X-Gm-Gg: AYBFou3F5KtNjalqvfeVUD2qthMuASarR3aHMFW+3F/zYzd8P20Oqr2DAv9q1M2HTJt WQNU4GhfaagPac4wwovTZjBMt++Bugm6WheYe+YgVIVMuuuoVBzwcaLexGzQXIM4cuB/seapmmN CnRkV/9IuZQIcrC3qVZkWEItcAKWQtkXqSzKoqDayPA3nYUx+HE5hKE9OO8Eu0f98TyPxLrkzJj IyDDenJ2uVyj6twr2fnLmuABFDJUSA0k9p5VGZHR5PbLaHRjKlsuWfBjtFrRvm7CkvQEf+fBB6f zBxWzAnZ63cxlcbid4IUD4GN4VCBmyMY/2CNeVieGbAkgxxdtpHJ2I3+GCsWl7oDW88vWVcoc+v 6gD1+sh8sVgIJHMqwJ5gWxbfy X-Received: by 2002:a05:6000:4006:b0:48d:ff71:dd9d with SMTP id ffacd0b85a97d-48e5d59972fmr280589f8f.23.1793122504084; Tue, 27 Oct 2026 10:35:04 -0700 (PDT) X-Received: by 2002:a05:6000:4006:b0:48d:ff71:dd9d with SMTP id ffacd0b85a97d-48e5d59972fmr280540f8f.23.1793122503643; Tue, 27 Oct 2026 10:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793122503; cv=none; d=google.com; s=arc-20260327; b=rtvEbBP9sN4dSVEMOgHLWJHO+btCamqZzIl9C6QOeNgxl3nEqIVBOUiJPKVjy3+3mx qKHWQoIro/KVkcL1RBxwOxeCtrjpjey91wdeB0pVJVs5V2G4zWwsPBoY8u8FBHJYMY2b koFIftG5oUgGIYY1rVg+7ZndJVeeL3BjTzxAEi8IRqKUhG+CZRJ0GaHg1Wdredrw3+yp JP3GVi8amyhYiuWluPNAZSPaCEv7na5afGWp/B12s60G8bX4/CLE14HNNVkXfqAfC8UX qQ2Ol28SqnuxVVGnXJP/rDyXQnrTE4bBLIt9YJaLlnPWuucc4r+xdLl0mH9GbwHc5UMa 0cLQ== 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=pPCTN2PDmqRftDQDRmeAOGQ7Dz4R20vlKVodqkfaWsE/0BALMfxjMrcmxK696VQQpj FTZY3YWIkKF0tWMMnyqR9A6XAAXptAS9J6b34IBgt67gilWoS/k9i1zOLVqYN/Z+1LBz TGsyz0ERLyOCA9f2BRqlKkRxZIHW4kygJadBozvA4oACwg9RuaaKO8fNES5bk2gqOMsl U1PToYMAuPzcuDAyGjZASLWE78g55y/x/T/W0FFIn2JKwauqR807u4A/oYHw9x4JvVUp SoHu2GlIJSjD+bn2ZJ4ewaihVvQyOcqKeJIeHXmWSz+JN/zX5mhNPZ4rqvFaMwzTk1KJ k2dg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=b6hJnBPC; 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-48e3ed30f33si20468035f8f.488.2026.10.27.10.35.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2026 10:35:03 -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=b6hJnBPC; 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=b6hJnBPCPhVt W2KEVg74QHwLQLiQotDLeASWnZol8DZmUAeZCb8SnkIR0/CW3Cbrp4V041cHFLElkmmzK4Aq5rZsA 7t5eInCxlUYKCeFSwKDliTGlJFCJGjiWHOk5EiSbR+Dbe+56RHbNEPxSMPOrp8D4nJDuya1WvqXTj A3yscY9XSn11UPvvh4zu4H9Uixmrn+B6+l/DqXCfAb/RLlkqOJQhep7soRzeXVcpRN1ftcYu6qpm2 m/rYyrO0/i/gSkona6xhVuftJS/w4H9+A07gxUZCP/buEf4M2Kfo2IwSZo+xlGpFidKJyaSeidXCw 6jpkDwNCpxquwdyJXrOKOw==; 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 1xLl0w-000mai-1F; Tue, 27 Oct 2026 18:34:53 +0100 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Tue, 27 Oct 2026 19:34:23 +0200 Message-ID: <20261027173457.1261044-8-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261027173457.1261044-1-eva.kurchatova@virtuozzo.com> References: <20261027173457.1261044-1-eva.kurchatova@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v3 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