On 09/08/2024 11:03, Bruno Haible wrote:
Pádraig Brady wrote:
FYI coreutils CI started failing with this on cfarm13.cfarm.net (debian 11.9) 
with:

FAIL: test-pthread-rwlock-waitqueue
===================================
test-pthread-rwlock-waitqueue.c:234: assertion 'startswith (do_test ("RRRRR"), " R1 
R2 R3 R4 R5")' failed
FAIL test-pthread-rwlock-waitqueue (exit status: 134)

I can't reproduce it on that machine, even in 100 runs. Probably the machine
was under load while your CI was running.

Let me avoid the (optimistic) 5 ms interval. This makes the test run for a
longer time, but that is less of a problem than a failing test.

It failed again the same way with the latest gnulib.
Note the test is run with `make -j24 check` from crontab.

The failure is intermittent from crontab,
and I couldn't repro manually.

I did however notice different output depending on
whether the test was run in the foreground or background
(which might explain why crontab may be a trigger here).

If I run the test in the foreground with 
./gnulib-tests/test-pthread-rwlock-waitqueue
I don't see any of the "... => ..." lines output.
Though I do see those when running in the background like:
./gnulib-tests/test-pthread-rwlock-waitqueue >out.bg 2>&1 &
Note there is still varying output depending on the background run,
so I've attached output from two runs in the background.

cheers,
Pádraig

glibc/Linux PREFER_READER
    WRR => W1 R2 R3
    WRW => W1 R2 W3
    WWR => W1 R3 W2
    WWW => W1 W2 W3
    WRRR => W1 R2 R3 R4
    WRRW => W1 R2 R3 W4
    WRWR => W1 R2 R4 W3
    WRWW => W1 R2 W3 W4
    WWRR => W1 R3 R4 W2
    WWRW => W1 R3 W2 W4
    WWWR => W1 R4 W2 W3
    WWWW => W1 W2 W3 W4
    WRRRR => W1 R4 R2 R3 R5
    WRRRW => R2 W1 R3 R4 W5
    WRRWR => W1 R3 R5 R2 W4
    WRRWW => W1 R3 R2 W4 W5
    WRWRR => W1 R2 R4 R5 W3
    WRWRW => W1 R2 R4 W3 W5
    WRWWR => W1 R2 R5 W3 W4
    WRWWW => W1 R2 W3 W4 W5
    WWRRR => W1 R3 R4 R5 W2
    WWRRW => W1 R3 R4 W2 W5
    WWRWR => W1 R3 R5 W2 W4
    WWRWW => W1 R3 W2 W4 W5
    WWWRR => W1 R4 R5 W2 W3
    WWWRW => W1 R4 W2 W3 W5
    WWWWR => W1 R5 W2 W3 W4
    WWWWW => W1 W2 W3 W4 W5
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    ???
  This implementation does not globally prefer readers, only when releasing
  a reader lock.
  This implementation does not prefer writers.
glibc/Linux PREFER_WRITER
    RWR => R1 R3 W2
    RWW => R1 W2 W3
    RWRR => W2 R1 R3 R4
    RWRW => R1 R3 W2 W4
    RWWR => R1 R4 W2 W3
    RWWW => R1 W2 W3 W4
    RWRRR => R1 R3 R4 R5 W2
    RWRRW => R1 R3 R4 W2 W5
    RWRWR => R1 R3 R5 W2 W4
    RWRWW => R1 R3 W2 W4 W5
    RWWRR => R1 R4 R5 W2 W3
    RWWRW => R1 R4 W2 W3 W5
    RWWWR => R1 R5 W2 W3 W4
    RWWWW => R1 W2 W3 W4 W5
  When releasing the last reader lock:
    ???
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not prefer readers.
  This implementation does not globally prefer writers, only when releasing
  a writer lock.
glibc/Linux PREFER_WRITER_NONRECURSIVE
  When releasing the last reader lock:
    The first of the enqueued lock attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not prefer readers.
  This implementation always prefers writers.
glibc/Linux DEFAULT
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for reading, one of
    them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  This implementation always prefers readers.
  This implementation does not prefer writers.
Default
  When releasing the last reader lock:
    The first of the enqueued lock attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not prefer readers.
  This implementation always prefers writers.
glibc/Linux PREFER_READER
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for reading, one of
    them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  This implementation always prefers readers.
  This implementation does not prefer writers.
glibc/Linux PREFER_WRITER
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not globally prefer readers, only when releasing
  a reader lock.
  This implementation does not globally prefer writers, only when releasing
  a writer lock.
glibc/Linux PREFER_WRITER_NONRECURSIVE
  When releasing the last reader lock:
    The first of the enqueued lock attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not prefer readers.
  This implementation always prefers writers.
glibc/Linux DEFAULT
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for reading, one of
    them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  This implementation always prefers readers.
  This implementation does not prefer writers.
Default
    WRR => W1 R2 R3
    WRRR => W1 R2 R3 R4
    WRRRR => R2 W1 R4 R5 R3
  When releasing the last reader lock:
    The first of the enqueued lock attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, ???
  This implementation does not prefer readers.
  This implementation always prefers writers.
glibc/Linux PREFER_READER
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for reading, one of
    them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  This implementation always prefers readers.
  This implementation does not prefer writers.
glibc/Linux PREFER_WRITER
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not globally prefer readers, only when releasing
  a reader lock.
  This implementation does not globally prefer writers, only when releasing
  a writer lock.
glibc/Linux PREFER_WRITER_NONRECURSIVE
  When releasing the last reader lock:
    The first of the enqueued lock attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not prefer readers.
  This implementation always prefers writers.
glibc/Linux DEFAULT
  When releasing the last reader lock:
    If at least one of the enqueued lock attempts is for reading, the
    first one of them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for reading, one of
    them is granted.
    Otherwise, the first of the waiting write attempts is granted.
  This implementation always prefers readers.
  This implementation does not prefer writers.
Default
  When releasing the last reader lock:
    The first of the enqueued lock attempts is granted.
  When releasing a writer lock:
    If at least one of the enqueued lock attempts is for writing, the
    first one of them is granted.
    Otherwise, one of the waiting read attempts is granted.
  This implementation does not prefer readers.
  This implementation always prefers writers.

Reply via email to