apache / apache/celix

Unlimited Spin of Glibc's Read-write-lock Implementation

Open
#739 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
193
Forks
99
Avg merge
1m
Merged PRs (30d)
1

Description

Last week, I investigated a Read-write-lock implementation issue affecting ALL versions of Glibc since 2.25, which is detailed in the following ML thread: https://sourceware.org/pipermail/libc-alpha/2024-March/155278.html

In summary, a reader of high RT priority that can not acquire its lock can do unlimited spin (eating all available CPUs) while a writer that holds its lock can not stop the reader from spinning because it has no chance to run.

Considering that rwlock is used in the central piece of our framework and glibc is the most extensively used C library, we should pay close attention to the progress of this issue.

**Note that musl does not suffer from this issue, since it only does limited spin (up to 100 times, check the following email for an example). Neither is uclibc affected.**

Event if Glibc addresses this issue quickly, we should warn our users of this issue. If it were ignored, then we may need to implement our own rdlock in the worst case. @pnoltes @xuzhenbao

Bug Report: https://sourceware.org/bugzilla/show_bug.cgi?id=31477

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the linked libc-alpha thread and glibc Bugzilla report 31477 to understand the rwlock behavior and current upstream status. No Celix file, test, or entry point is named; completion would require deciding whether Celix should warn users or implement an alternative rdlock if the upstream issue remains unresolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.