]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786)
authorFlorian Weimer <fweimer@redhat.com>
Fri, 11 Jul 2025 12:57:50 +0000 (05:57 -0700)
committerCarlos O'Donell <carlos@redhat.com>
Fri, 11 Jul 2025 17:56:56 +0000 (13:56 -0400)
[BZ #25847]

The new initializer and struct layout does not initialize the
__g_signals field in the old struct layout before the change in
commit c36fc50781995e6758cae2b6927839d0157f213c ("nptl: Remove
g_refs from condition variables").  Bring back fields at the end
of struct __pthread_cond_s, so that they are again zero-initialized.

(cherry picked from commit dbc5a50d12eff4cb3f782129029d04b8a76f58e7)

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/nptl/bits/thread-shared-types.h
sysdeps/nptl/pthread.h

index 59f9adc59aff6af86e4a7e88dcb1c08a93e0e918..3fe5d4afc0ecb4caa8077a09a6564ccecefdc5af 100644 (file)
@@ -99,6 +99,8 @@ struct __pthread_cond_s
   unsigned int __g1_orig_size;
   unsigned int __wrefs;
   unsigned int __g_signals[2];
+  unsigned int __unused_initialized_1;
+  unsigned int __unused_initialized_2;
 };
 
 typedef unsigned int __tss_t;
index a43efa20d22b4337ba117c8526bfa60a673217ba..476cd0ed54535d460f8e96626435246567c48cf2 100644 (file)
@@ -152,7 +152,7 @@ enum
 
 
 /* Conditional variable handling.  */
-#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } }
+#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0}, 0, 0 } }
 
 
 /* Cleanup buffers */