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

Carlos O'Donell carlos@redhat.com
Wed Dec 4 22:00:20 GMT 2024


This is an updated v6 of the patch to fix Bug 25847 and prevent signals
from being lost for POSIX condition variables.

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(-)

-- 
2.47.0



More information about the Libc-alpha mailing list