Opened 4 years ago

Last modified 6 weeks ago

#16709 new bug

THR: Test FAILED - conformance/interfaces/pthread_rwlock_rdlock/2-3.test

Reported by: cocobean Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/Development
Keywords: POSIX, pthreads, pthread_rwlock_rdlock Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by cocobean)

pthread_rwlock_rdlock implementation in Haiku R1b5 must pass this OpenPOSIX test for POSIX.1-2008 conformance.

https://github.com/haiku/open_posix_testsuite/blob/from_haiku_trunk/conformance/interfaces/pthread_rwlock_rdlock/2-3.c

Expected result: Test passed Actual result: Test failed. rd_thread blocked on read lock

Tested on: Haiku hrev58305 x86 with Open POSIX Test Suite 1.5.2

Change History (4)

comment:1 by cocobean, 2 years ago

Last edited 2 years ago by cocobean (previous) (diff)

comment:2 by waddlesplash, 4 months ago

This looks intentional. The test creates a rwlock, read-locks it, creates a thread that calls wrlock, and creates another thread that calls rdlock. The last thread blocks because a writer is waiting to acquire the lock. Anything else would let reader threads starve out writer threads.

comment:3 by cocobean, 3 months ago

Using hrev58072 source:

Note old commit: https://github.com/haiku/haiku/commit/298314fe4b1f592c5b2caf3f06a1e8a452329396

Technically, test reads that main thread and writer uses SCHED_FIFO - which isn't implemented yet in Haiku R1B5 hrev58095 and hrev57937+94.

POSIX.1-2024 was updated to clarify this functionality a bit better:

https://pubs.opengroup.org/onlinepubs/9799919799/functions/pthread_rwlock_rdlock.html
Last edited 6 weeks ago by cocobean (previous) (diff)

comment:4 by cocobean, 6 weeks ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.