On Wed, 08 Jul 2026 01:31:45 +0200, Thomas Gleixner wrote:

> Do you have /proc/ disabled by chance or is it not accessible for the
> test case?
...
> Seems to correlate with the test case failure: Connection timed out :)

I used the following patch to simulate the situation where the proc file
system is not mounted on the system. The log is very similar to that of
the current problem.

--- a/tools/testing/selftests/futex/include/futex_thread.h
+++ b/tools/testing/selftests/futex/include/futex_thread.h
@@ -62,7 +62,8 @@ static inline int futex_wait_for_thread(struct futex_thread 
*t, struct __test_me
        int res;
 
        snprintf(fname, sizeof(fname), "/proc/%d/wchan", t->tid);
-       fp = fopen(fname, "r");
+       errno = ENOENT;
+       fp = NULL;
        if (!fp) {
                /* If /proc/... is not available, sleep */
                if (errno != ENOENT)

The corresponding logs are as follows:

  TAP version 13
  1..2
  # Starting 2 tests from 1 test cases.
  #  RUN           global.requeue_single ...
  # ../include/futex_thread.h:71:requeue_single:/proc/$PID/wchan not 
accessible, continue with sleep()
  # futex_requeue.c:28:requeue_single:Expected res (-1) == 0 (0)
  # futex_requeue.c:52:requeue_single:Expected futex_cmp_requeue(f1, 0, &f2, 0, 
1, 0) (0) == 1 (1)
  # futex_requeue.c:53:requeue_single:Expected futex_wake(&f2, 1, 0) (0) == 1 
(1)
  # futex_requeue.c:29:requeue_single:waiter failed errno 110: Connection timed 
out
  # requeue_single: Test failed
  #          FAIL  global.requeue_single
  not ok 1 global.requeue_single
  #  RUN           global.requeue_multiple ...
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection 
timed out
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not 
accessible, continue with sleep()
  # futex_requeue.c:80:requeue_multiple:Expected futex_cmp_requeue(f1, 0, &f2, 
3, 7, 0) (0) == 10 (10)
  # futex_requeue.c:81:requeue_multiple:Expected futex_wake(&f2, INT_MAX, 0) 
(0) == 7 (7)
  # requeue_multiple: Test failed
  #          FAIL  global.requeue_multiple
  not ok 2 global.requeue_multiple
  # FAILED: 0 / 2 tests passed.
  # Totals: pass:0 fail:2 xfail:0 xpass:0 skip:0 error:0

I suggested adding a parameter for the waiting time to the 
futex_wait_for_thread function.
In this way, when the proc file system is not mounted on the system, the old 
solution
can still be used.

Thanks.


Reply via email to