Page MenuHomeFreeBSD

libthr rtld locks: do not leak URWLOCK_READ_WAITERS into child
ClosedPublic

Authored by kib on May 20 2023, 8:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 12, 10:04 PM
Unknown Object (File)
Tue, Mar 12, 10:04 PM
Unknown Object (File)
Tue, Mar 12, 10:04 PM
Unknown Object (File)
Sat, Mar 9, 2:39 AM
Unknown Object (File)
Fri, Mar 8, 8:27 AM
Unknown Object (File)
Feb 24 2024, 12:42 AM
Unknown Object (File)
Feb 18 2024, 8:28 AM
Unknown Object (File)
Jan 18 2024, 1:19 PM
Subscribers

Details

Summary
Since there is only the current thread in the child, no pending readers
exist.  Clear the bit, since it confuses future attempts to acquire
write ownership of the rtld locks, due to URWLOCK_PREFER_READERS flag.

PR:     271490

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.May 20 2023, 8:28 AM
kib added a reviewer: markj.

To be future-proof, clear all state about pending writers and readers.

It would be nice to turn the test case from PR 271490 into a regression test case, either in the base system or in stress2.

lib/libthr/thread/thr_rtld.c
161

Perhaps use __predict_false here.

This revision is now accepted and ready to land.May 22 2023, 1:32 PM