[PATCH v6 0/9] Patch to fix glibc condition variable bug (Bug 25847)

Carlos O'Donell carlos@redhat.com
Fri Jan 17 18:21:07 GMT 2025


On 12/4/24 5:00 PM, Carlos O'Donell wrote:
> This is an updated v6 of the patch to fix Bug 25847 and prevent signals
> from being lost for POSIX condition variables.

Andreas,

I've tested this broadly on x86_64, i686, ppc64le, s390x, and aarch64.

I've had downstream users test this too and it resolved their issues.

I've also resolved how we will backport this to the release branches without causing
an upgrade regression for distributions doing in-place upgrades.

Shall we push this as part of closing out "desirable" for the release?

(next up will be reviewing final AArch64 GCS status)

> The changes have been tested downstream in pre-production deployments.
> Testing has been carried out on x86_64, i686, ppc64le, aarch64 and
> s390x. The changes have been developed by Frank Barrus, and Malte
> Skarupke, and reviewed by Carlos O'Donell.
> 
> There are two follow-on fixes that will be posted independent of these
> changes to handle signal overflow, and sequence overflow. Both issues
> are very unlikely to occur in production, but we should fix them from
> a first principles perspective.
> 
> I will be committing these changes shortly since they are best solution
> to the problem at hand with POSIX condition variables. The changes make
> the code significantly simpler by making signals sequence relative.
> 
> Frank Barrus (1):
>   pthreads NPTL: lost wakeup fix 2
> 
> Malte Skarupke (8):
>   nptl: Update comments and indentation for new condvar implementation
>   nptl: Remove unnecessary catch-all-wake in condvar group switch
>   nptl: Remove unnecessary quadruple check in pthread_cond_wait
>   nptl: Remove g_refs from condition variables
>   nptl: Use a single loop in pthread_cond_wait instaed of a nested loop
>   nptl: Fix indentation
>   nptl: rename __condvar_quiesce_and_switch_g1
>   nptl: Use all of g1_start and g_signals
> 
>  nptl/pthread_cond_broadcast.c           |   8 +-
>  nptl/pthread_cond_common.c              | 109 ++--------
>  nptl/pthread_cond_signal.c              |  19 +-
>  nptl/pthread_cond_wait.c                | 278 +++++-------------------
>  nptl/tst-cond22.c                       |  12 +-
>  sysdeps/nptl/bits/thread-shared-types.h |   3 +-
>  sysdeps/nptl/pthread.h                  |   2 +-
>  7 files changed, 99 insertions(+), 332 deletions(-)
> 


-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list