aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2025-03-13 06:07:07 +0100
committerFlorian Weimer <fweimer@redhat.com>2025-03-13 07:45:21 +0100
commit98c712855d6606d078aaabaa7ef24b695c3f0349 (patch)
tree0c01081431c3ecd4ea15c333b030a29c2e3e3b6d
parente22c132484ea49be0478e4dcbd108d433d70f64c (diff)
downloadglibc-98c712855d6606d078aaabaa7ef24b695c3f0349.tar.xz
glibc-98c712855d6606d078aaabaa7ef24b695c3f0349.zip
nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786)
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. Reviewed-by: Sam James <sam@gentoo.org> (cherry picked from commit dbc5a50d12eff4cb3f782129029d04b8a76f58e7)
-rw-r--r--NEWS1
-rw-r--r--sysdeps/nptl/bits/thread-shared-types.h2
-rw-r--r--sysdeps/nptl/pthread.h2
3 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 983f8c6404..6b34aa31f8 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ The following bugs were resolved with this release:
[32630] math: math: tanf is not correctly rounded for all rounding
modes
[32781] Linux: Remove attribute access from sched_getattr
+ [32786] nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions
Version 2.41
diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h
index 7c24c0a6be..e614c7f3c9 100644
--- a/sysdeps/nptl/bits/thread-shared-types.h
+++ b/sysdeps/nptl/bits/thread-shared-types.h
@@ -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;
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index 050b4ab8d1..9ad36cabe9 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -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 */