Module Name: src Committed By: riastradh Date: Sat Jan 18 06:22:56 UTC 2025
Modified Files: src/tests/lib/libc/sys: t_futex_ops.c Log Message: tests/lib/libc/sys/t_futex_ops: Fix FUTEX_CMP_REQUEUE return values. The return value is the number of waiters woken _or requeued_, not just the number of waiters woken: FUTEX_CMP_REQUEUE Returns the total number of waiters that were woken up or requeued to the futex for the futex word at uaddr2. If this value is greater than val, then the difference is the number of waiters requeued to the futex for the futex word at uaddr2. https://man7.org/linux/man-pages/man2/futex.2.html PR kern/56828: futex calls in Linux emulation sometimes hang To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_futex_ops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/sys/t_futex_ops.c diff -u src/tests/lib/libc/sys/t_futex_ops.c:1.6 src/tests/lib/libc/sys/t_futex_ops.c:1.7 --- src/tests/lib/libc/sys/t_futex_ops.c:1.6 Sat Jan 18 06:22:35 2025 +++ src/tests/lib/libc/sys/t_futex_ops.c Sat Jan 18 06:22:56 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: t_futex_ops.c,v 1.6 2025/01/18 06:22:35 riastradh Exp $ */ +/* $NetBSD: t_futex_ops.c,v 1.7 2025/01/18 06:22:56 riastradh Exp $ */ /*- * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include <sys/cdefs.h> __COPYRIGHT("@(#) Copyright (c) 2019, 2020\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_futex_ops.c,v 1.6 2025/01/18 06:22:35 riastradh Exp $"); +__RCSID("$NetBSD: t_futex_ops.c,v 1.7 2025/01/18 06:22:56 riastradh Exp $"); #include <sys/fcntl.h> #include <sys/mman.h> @@ -846,8 +846,11 @@ do_futex_requeue_test(int flags, int op) */ /* Wake one waiter on 1, move one waiter to 0. */ - ATF_REQUIRE(__futex(&futex_word1, op | flags, - 1, NULL, &futex_word, 1, good_val3) == 1); + atf_tc_expect_fail("PR kern/56828:" + " futex calls in Linux emulation sometimes hang"); + ATF_CHECK(__futex(&futex_word1, op | flags, + 1, NULL, &futex_word, 1, good_val3) == 2); + atf_tc_expect_pass(); /* * FUTEX 0: 1 LWP