* [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc
@ 2020-03-13 19:48 Adhemerval Zanella
2020-03-13 19:48 ` [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread Adhemerval Zanella
` (4 more replies)
0 siblings, 5 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-03-13 19:48 UTC (permalink / raw)
To: libc-alpha
Changes from previous version:
- Added a new libc.so version for pthread_sigmask.
- Move ia64 changes to its own patch.
--
This is part of the libpthread removal project:
<https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>
A new symbol version is added on libc to force loading failure
instead of lazy binding one for newly binaries with old loaders.
Checked with a build against all affected ABIs.
---
nptl/Makefile | 3 ++-
nptl/Versions | 4 ++++
nptl/libpthread-compat.c | 6 ++++++
nptl/pthreadP.h | 2 ++
nptl/pthread_sigmask.c | 10 +++++++---
sysdeps/unix/sysv/linux/aarch64/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/aarch64/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/alpha/Makefile | 6 +++---
sysdeps/unix/sysv/linux/alpha/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/alpha/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/arm/be/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/arm/le/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/csky/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/csky/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/hppa/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/i386/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/i386/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/ia64/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/ia64/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist | 2 ++
.../unix/sysv/linux/m68k/coldfire/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/microblaze/be/libc.abilist | 2 ++
.../unix/sysv/linux/microblaze/be/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/microblaze/le/libc.abilist | 2 ++
.../unix/sysv/linux/microblaze/le/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/nios2/libpthread.abilist | 1 -
.../unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist | 2 ++
.../sysv/linux/powerpc/powerpc32/libpthread.abilist | 1 -
.../unix/sysv/linux/powerpc/powerpc64/be/libc.abilist | 2 ++
.../sysv/linux/powerpc/powerpc64/be/libpthread.abilist | 1 -
.../unix/sysv/linux/powerpc/powerpc64/le/libc.abilist | 2 ++
.../sysv/linux/powerpc/powerpc64/le/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist | 2 ++
.../unix/sysv/linux/s390/s390-32/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 2 ++
.../unix/sysv/linux/s390/s390-64/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/sh/be/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/sh/le/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist | 2 ++
.../unix/sysv/linux/sparc/sparc32/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist | 2 ++
.../unix/sysv/linux/sparc/sparc64/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist | 1 -
sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 2 ++
sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist | 1 -
62 files changed, 82 insertions(+), 34 deletions(-)
diff --git a/nptl/Makefile b/nptl/Makefile
index e554a3898d..4816fa254e 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -59,6 +59,7 @@ routines = \
pthread_getschedparam \
pthread_self \
pthread_setschedparam \
+ pthread_sigmask \
register-atfork \
shared-only-routines = forward
@@ -123,7 +124,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \
pthread_barrierattr_setpshared \
pthread_key_create pthread_key_delete \
pthread_getspecific pthread_setspecific \
- pthread_sigmask pthread_kill pthread_sigqueue \
+ pthread_kill pthread_sigqueue \
pthread_cancel pthread_testcancel \
pthread_setcancelstate pthread_setcanceltype \
pthread_once \
diff --git a/nptl/Versions b/nptl/Versions
index 543dddc4ee..f7140277f5 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -16,6 +16,7 @@ libc {
pthread_mutex_lock; pthread_mutex_unlock;
pthread_self;
pthread_setcancelstate; pthread_setcanceltype;
+ pthread_sigmask;
}
GLIBC_2.1 {
pthread_attr_init;
@@ -32,6 +33,9 @@ libc {
GLIBC_2.28 {
thrd_current; thrd_equal; thrd_sleep; thrd_yield;
}
+ GLIBC_2.32 {
+ pthread_sigmask;
+ }
GLIBC_PRIVATE {
__libc_alloca_cutoff;
# Internal libc interface to libpthread
diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
index 512b4c77c8..92c981c2d2 100644
--- a/nptl/libpthread-compat.c
+++ b/nptl/libpthread-compat.c
@@ -36,6 +36,12 @@ __libpthread_version_placeholder (void)
version or later, the placeholder symbol is not needed because
there are plenty of other symbols which populate those later
versions. */
+
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1))
+compat_symbol_unique (libpthread,
+ __libpthread_version_placeholder, GLIBC_2_0);
+#endif
+
#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2))
compat_symbol_unique (libpthread,
__libpthread_version_placeholder, GLIBC_2_1_2);
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 06fb0d74c5..edec8d0501 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -482,6 +482,8 @@ extern void __pthread_testcancel (void);
extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
const struct timespec *, bool)
attribute_hidden;
+extern int __pthread_sigmask (int how, const sigset_t *newmask,
+ sigset_t *oldmask);
#if IS_IN (libpthread)
diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
index c7860e02a5..0e326d610c 100644
--- a/nptl/pthread_sigmask.c
+++ b/nptl/pthread_sigmask.c
@@ -16,14 +16,13 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <signal.h>
#include <pthreadP.h>
#include <sysdep.h>
-
+#include <shlib-compat.h>
int
-pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
+__pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
{
sigset_t local_newmask;
@@ -47,3 +46,8 @@ pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
? INTERNAL_SYSCALL_ERRNO (result)
: 0);
}
+versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32);
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
+strong_alias (__pthread_sigmask, __pthread_sigmask_2);
+compat_symbol (libc, __pthread_sigmask_2, pthread_sigmask, GLIBC_2_0);
+#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index a4c31932cb..41bb214bb9 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -1447,6 +1447,7 @@ GLIBC_2.17 pthread_self F
GLIBC_2.17 pthread_setcancelstate F
GLIBC_2.17 pthread_setcanceltype F
GLIBC_2.17 pthread_setschedparam F
+GLIBC_2.17 pthread_sigmask F
GLIBC_2.17 ptrace F
GLIBC_2.17 ptsname F
GLIBC_2.17 ptsname_r F
@@ -2145,3 +2146,4 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
index d65beba958..48b368acb1 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
@@ -156,7 +156,6 @@ GLIBC_2.17 pthread_setconcurrency F
GLIBC_2.17 pthread_setname_np F
GLIBC_2.17 pthread_setschedprio F
GLIBC_2.17 pthread_setspecific F
-GLIBC_2.17 pthread_sigmask F
GLIBC_2.17 pthread_sigqueue F
GLIBC_2.17 pthread_spin_destroy F
GLIBC_2.17 pthread_spin_init F
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 2e132e474b..92484bbe65 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -31,9 +31,9 @@ libm-routines += multc3 divtc3
endif # math
ifeq ($(subdir),nptl)
-# pull in __syscall_error routine, __sigprocmask, sigaction stubs.
-libpthread-routines += sysdep sigprocmask rt_sigaction
-libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction
+# pull in __syscall_error routine, sigaction stubs.
+libpthread-routines += sysdep rt_sigaction
+libpthread-shared-only-routines += sysdep rt_sigaction
endif
ifeq ($(subdir),conform)
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index e7f2174ac2..6430af207f 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -891,6 +891,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2225,6 +2226,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
index ffd443422d..cfffc5f529 100644
--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index b152c0e24a..f4ea1756d5 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -133,6 +133,7 @@ GLIBC_2.30 twalk_r F
GLIBC_2.31 msgctl F
GLIBC_2.31 semctl F
GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
@@ -1517,6 +1518,7 @@ GLIBC_2.4 pthread_self F
GLIBC_2.4 pthread_setcancelstate F
GLIBC_2.4 pthread_setcanceltype F
GLIBC_2.4 pthread_setschedparam F
+GLIBC_2.4 pthread_sigmask F
GLIBC_2.4 ptrace F
GLIBC_2.4 ptsname F
GLIBC_2.4 ptsname_r F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
index 129c64b0a7..050e799de8 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
@@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F
GLIBC_2.4 pthread_setconcurrency F
GLIBC_2.4 pthread_setschedprio F
GLIBC_2.4 pthread_setspecific F
-GLIBC_2.4 pthread_sigmask F
GLIBC_2.4 pthread_spin_destroy F
GLIBC_2.4 pthread_spin_init F
GLIBC_2.4 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 9371927927..f1456b26b2 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -130,6 +130,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
@@ -1514,6 +1515,7 @@ GLIBC_2.4 pthread_self F
GLIBC_2.4 pthread_setcancelstate F
GLIBC_2.4 pthread_setcanceltype F
GLIBC_2.4 pthread_setschedparam F
+GLIBC_2.4 pthread_sigmask F
GLIBC_2.4 ptrace F
GLIBC_2.4 ptsname F
GLIBC_2.4 ptsname_r F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
index 129c64b0a7..050e799de8 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
@@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F
GLIBC_2.4 pthread_setconcurrency F
GLIBC_2.4 pthread_setschedprio F
GLIBC_2.4 pthread_setspecific F
-GLIBC_2.4 pthread_sigmask F
GLIBC_2.4 pthread_spin_destroy F
GLIBC_2.4 pthread_spin_init F
GLIBC_2.4 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 9b3cee65bb..c54aed2f8e 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -1435,6 +1435,7 @@ GLIBC_2.29 pthread_self F
GLIBC_2.29 pthread_setcancelstate F
GLIBC_2.29 pthread_setcanceltype F
GLIBC_2.29 pthread_setschedparam F
+GLIBC_2.29 pthread_sigmask F
GLIBC_2.29 ptrace F
GLIBC_2.29 ptsname F
GLIBC_2.29 ptsname_r F
@@ -2089,3 +2090,4 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
index 8b72528819..977905a839 100644
--- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -166,7 +166,6 @@ GLIBC_2.29 pthread_setconcurrency F
GLIBC_2.29 pthread_setname_np F
GLIBC_2.29 pthread_setschedprio F
GLIBC_2.29 pthread_setspecific F
-GLIBC_2.29 pthread_sigmask F
GLIBC_2.29 pthread_sigqueue F
GLIBC_2.29 pthread_spin_destroy F
GLIBC_2.29 pthread_spin_init F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index df6d96fbae..87373f755b 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -1274,6 +1274,7 @@ GLIBC_2.2 pthread_self F
GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setschedparam F
+GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 ptrace F
GLIBC_2.2 ptsname F
GLIBC_2.2 ptsname_r F
@@ -2046,6 +2047,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index 84fa775d95..558d3f0dfd 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setconcurrency F
GLIBC_2.2 pthread_setspecific F
-GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 pthread_spin_destroy F
GLIBC_2.2 pthread_spin_init F
GLIBC_2.2 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index fcb625b6bf..1bd2e02f79 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -868,6 +868,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2212,6 +2213,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index 4727bd5d43..f13fdce3a8 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index cb556c5998..07e51d46bf 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -1295,6 +1295,7 @@ GLIBC_2.2 pthread_self F
GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setschedparam F
+GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 ptrace F
GLIBC_2.2 ptsname F
GLIBC_2.2 ptsname_r F
@@ -2078,6 +2079,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
index 3d947a66aa..0c96fc3ccb 100644
--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
@@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setconcurrency F
GLIBC_2.2 pthread_setspecific F
-GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 pthread_spin_destroy F
GLIBC_2.2 pthread_spin_init F
GLIBC_2.2 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 5e3cdea246..42ea4c24bf 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -134,6 +134,7 @@ GLIBC_2.30 twalk_r F
GLIBC_2.31 msgctl F
GLIBC_2.31 semctl F
GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0x98
GLIBC_2.4 _IO_2_1_stdin_ D 0x98
@@ -1497,6 +1498,7 @@ GLIBC_2.4 pthread_self F
GLIBC_2.4 pthread_setcancelstate F
GLIBC_2.4 pthread_setcanceltype F
GLIBC_2.4 pthread_setschedparam F
+GLIBC_2.4 pthread_sigmask F
GLIBC_2.4 ptrace F
GLIBC_2.4 ptsname F
GLIBC_2.4 ptsname_r F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index 129c64b0a7..050e799de8 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F
GLIBC_2.4 pthread_setconcurrency F
GLIBC_2.4 pthread_setschedprio F
GLIBC_2.4 pthread_setspecific F
-GLIBC_2.4 pthread_sigmask F
GLIBC_2.4 pthread_spin_destroy F
GLIBC_2.4 pthread_spin_init F
GLIBC_2.4 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index ea5e7a41af..e9358fb092 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -867,6 +867,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2158,6 +2159,7 @@ GLIBC_2.30 twalk_r F
GLIBC_2.31 msgctl F
GLIBC_2.31 semctl F
GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index 4727bd5d43..f13fdce3a8 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index ac55b0acd7..2cefe739c0 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -1450,6 +1450,7 @@ GLIBC_2.18 pthread_self F
GLIBC_2.18 pthread_setcancelstate F
GLIBC_2.18 pthread_setcanceltype F
GLIBC_2.18 pthread_setschedparam F
+GLIBC_2.18 pthread_sigmask F
GLIBC_2.18 ptrace F
GLIBC_2.18 ptsname F
GLIBC_2.18 ptsname_r F
@@ -2140,3 +2141,4 @@ GLIBC_2.30 twalk_r F
GLIBC_2.31 msgctl F
GLIBC_2.31 semctl F
GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
index 78885c05cf..87bd3ad30e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
@@ -158,7 +158,6 @@ GLIBC_2.18 pthread_setconcurrency F
GLIBC_2.18 pthread_setname_np F
GLIBC_2.18 pthread_setschedprio F
GLIBC_2.18 pthread_setspecific F
-GLIBC_2.18 pthread_sigmask F
GLIBC_2.18 pthread_sigqueue F
GLIBC_2.18 pthread_spin_destroy F
GLIBC_2.18 pthread_spin_init F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index f7ced487f7..3474ef1490 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -1450,6 +1450,7 @@ GLIBC_2.18 pthread_self F
GLIBC_2.18 pthread_setcancelstate F
GLIBC_2.18 pthread_setcanceltype F
GLIBC_2.18 pthread_setschedparam F
+GLIBC_2.18 pthread_sigmask F
GLIBC_2.18 ptrace F
GLIBC_2.18 ptsname F
GLIBC_2.18 ptsname_r F
@@ -2137,3 +2138,4 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
index 78885c05cf..87bd3ad30e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
@@ -158,7 +158,6 @@ GLIBC_2.18 pthread_setconcurrency F
GLIBC_2.18 pthread_setname_np F
GLIBC_2.18 pthread_setschedprio F
GLIBC_2.18 pthread_setspecific F
-GLIBC_2.18 pthread_sigmask F
GLIBC_2.18 pthread_sigqueue F
GLIBC_2.18 pthread_spin_destroy F
GLIBC_2.18 pthread_spin_init F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 06c2e64edd..a6f99a7369 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2129,6 +2130,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index 62f7a3f349..474ed999b3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index bdfd073b86..48222af11c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2127,6 +2128,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
index 62f7a3f349..474ed999b3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 3d61d4974a..99965cfb0f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2135,6 +2136,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 675acca5db..2c8bafc669 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -862,6 +862,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2129,6 +2130,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 7fec0c9670..52cf72052c 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -1492,6 +1492,7 @@ GLIBC_2.21 pthread_self F
GLIBC_2.21 pthread_setcancelstate F
GLIBC_2.21 pthread_setcanceltype F
GLIBC_2.21 pthread_setschedparam F
+GLIBC_2.21 pthread_sigmask F
GLIBC_2.21 ptrace F
GLIBC_2.21 ptsname F
GLIBC_2.21 ptsname_r F
@@ -2178,3 +2179,4 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index 45ebcf5a6c..fb9c4a178a 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -158,7 +158,6 @@ GLIBC_2.21 pthread_setconcurrency F
GLIBC_2.21 pthread_setname_np F
GLIBC_2.21 pthread_setschedprio F
GLIBC_2.21 pthread_setspecific F
-GLIBC_2.21 pthread_sigmask F
GLIBC_2.21 pthread_sigqueue F
GLIBC_2.21 pthread_spin_destroy F
GLIBC_2.21 pthread_spin_init F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 1e8ff6f83e..2ca5bbccf3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -875,6 +875,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2185,6 +2186,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index 2f4ed55693..65a9ef573e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 0c86217fc6..82d77b7e48 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -1380,6 +1380,7 @@ GLIBC_2.3 pthread_self F
GLIBC_2.3 pthread_setcancelstate F
GLIBC_2.3 pthread_setcanceltype F
GLIBC_2.3 pthread_setschedparam F
+GLIBC_2.3 pthread_sigmask F
GLIBC_2.3 ptrace F
GLIBC_2.3 ptsname F
GLIBC_2.3 ptsname_r F
@@ -2048,6 +2049,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
index f4d34b1c47..fe5bf9fd47 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
@@ -157,7 +157,6 @@ GLIBC_2.3 pthread_setcancelstate F
GLIBC_2.3 pthread_setcanceltype F
GLIBC_2.3 pthread_setconcurrency F
GLIBC_2.3 pthread_setspecific F
-GLIBC_2.3 pthread_sigmask F
GLIBC_2.3 pthread_spin_destroy F
GLIBC_2.3 pthread_spin_init F
GLIBC_2.3 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 2229a1dcc0..2b6a76d9c2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -1536,6 +1536,7 @@ GLIBC_2.17 pthread_self F
GLIBC_2.17 pthread_setcancelstate F
GLIBC_2.17 pthread_setcanceltype F
GLIBC_2.17 pthread_setschedparam F
+GLIBC_2.17 pthread_sigmask F
GLIBC_2.17 ptrace F
GLIBC_2.17 ptsname F
GLIBC_2.17 ptsname_r F
@@ -2247,3 +2248,4 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
index d65beba958..48b368acb1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
@@ -156,7 +156,6 @@ GLIBC_2.17 pthread_setconcurrency F
GLIBC_2.17 pthread_setname_np F
GLIBC_2.17 pthread_setschedprio F
GLIBC_2.17 pthread_setspecific F
-GLIBC_2.17 pthread_sigmask F
GLIBC_2.17 pthread_sigqueue F
GLIBC_2.17 pthread_spin_destroy F
GLIBC_2.17 pthread_spin_init F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 31010e6cf7..234d34929a 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -1438,6 +1438,7 @@ GLIBC_2.27 pthread_self F
GLIBC_2.27 pthread_setcancelstate F
GLIBC_2.27 pthread_setcanceltype F
GLIBC_2.27 pthread_setschedparam F
+GLIBC_2.27 pthread_sigmask F
GLIBC_2.27 ptrace F
GLIBC_2.27 ptsname F
GLIBC_2.27 ptsname_r F
@@ -2107,3 +2108,4 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
index 5610e51e10..44e3719991 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
@@ -155,7 +155,6 @@ GLIBC_2.27 pthread_setconcurrency F
GLIBC_2.27 pthread_setname_np F
GLIBC_2.27 pthread_setschedprio F
GLIBC_2.27 pthread_setspecific F
-GLIBC_2.27 pthread_sigmask F
GLIBC_2.27 pthread_sigqueue F
GLIBC_2.27 pthread_spin_destroy F
GLIBC_2.27 pthread_spin_init F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 4feca641b0..1f06cce028 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -866,6 +866,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2183,6 +2184,7 @@ GLIBC_2.30 twalk_r F
GLIBC_2.31 msgctl F
GLIBC_2.31 semctl F
GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index 80ad434007..0b2913ba2b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index efe588a072..26c2ce32e5 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -1292,6 +1292,7 @@ GLIBC_2.2 pthread_self F
GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setschedparam F
+GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 ptrace F
GLIBC_2.2 ptsname F
GLIBC_2.2 ptsname_r F
@@ -2084,6 +2085,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
index daef2b5cd5..8c71cdc48d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
@@ -138,7 +138,6 @@ GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setconcurrency F
GLIBC_2.2 pthread_setspecific F
-GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 pthread_spin_destroy F
GLIBC_2.2 pthread_spin_init F
GLIBC_2.2 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 6bfc2b7439..7ad2e920c3 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -1278,6 +1278,7 @@ GLIBC_2.2 pthread_self F
GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setschedparam F
+GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 ptrace F
GLIBC_2.2 ptsname F
GLIBC_2.2 ptsname_r F
@@ -2053,6 +2054,7 @@ GLIBC_2.30 twalk_r F
GLIBC_2.31 msgctl F
GLIBC_2.31 semctl F
GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
index 84fa775d95..558d3f0dfd 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
@@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setconcurrency F
GLIBC_2.2 pthread_setspecific F
-GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 pthread_spin_destroy F
GLIBC_2.2 pthread_spin_init F
GLIBC_2.2 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 4b057bf4a2..d2611bf0a5 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -1278,6 +1278,7 @@ GLIBC_2.2 pthread_self F
GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setschedparam F
+GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 ptrace F
GLIBC_2.2 ptsname F
GLIBC_2.2 ptsname_r F
@@ -2050,6 +2051,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
index 84fa775d95..558d3f0dfd 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
@@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setconcurrency F
GLIBC_2.2 pthread_setspecific F
-GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 pthread_spin_destroy F
GLIBC_2.2 pthread_spin_init F
GLIBC_2.2 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 49cd597fd6..18a528f0e9 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -869,6 +869,7 @@ GLIBC_2.0 pthread_self F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setschedparam F
+GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 ptrace F
GLIBC_2.0 putc F
GLIBC_2.0 putc_unlocked F
@@ -2174,6 +2175,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index ffd443422d..cfffc5f529 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
GLIBC_2.0 pthread_setcancelstate F
GLIBC_2.0 pthread_setcanceltype F
GLIBC_2.0 pthread_setspecific F
-GLIBC_2.0 pthread_sigmask F
GLIBC_2.0 pthread_testcancel F
GLIBC_2.0 raise F
GLIBC_2.0 read F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 95e68e0ba1..a1d48b0f3c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -1321,6 +1321,7 @@ GLIBC_2.2 pthread_self F
GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setschedparam F
+GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 ptrace F
GLIBC_2.2 ptsname F
GLIBC_2.2 ptsname_r F
@@ -2101,6 +2102,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
index 3d947a66aa..0c96fc3ccb 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
@@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
GLIBC_2.2 pthread_setcanceltype F
GLIBC_2.2 pthread_setconcurrency F
GLIBC_2.2 pthread_setspecific F
-GLIBC_2.2 pthread_sigmask F
GLIBC_2.2 pthread_spin_destroy F
GLIBC_2.2 pthread_spin_init F
GLIBC_2.2 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 1f2dbd1451..6418ace78a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -1288,6 +1288,7 @@ GLIBC_2.2.5 pthread_self F
GLIBC_2.2.5 pthread_setcancelstate F
GLIBC_2.2.5 pthread_setcanceltype F
GLIBC_2.2.5 pthread_setschedparam F
+GLIBC_2.2.5 pthread_sigmask F
GLIBC_2.2.5 ptrace F
GLIBC_2.2.5 ptsname F
GLIBC_2.2.5 ptsname_r F
@@ -2059,6 +2060,7 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
index a6bc9f4a55..2888c3150b 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
@@ -137,7 +137,6 @@ GLIBC_2.2.5 pthread_setcancelstate F
GLIBC_2.2.5 pthread_setcanceltype F
GLIBC_2.2.5 pthread_setconcurrency F
GLIBC_2.2.5 pthread_setspecific F
-GLIBC_2.2.5 pthread_sigmask F
GLIBC_2.2.5 pthread_spin_destroy F
GLIBC_2.2.5 pthread_spin_init F
GLIBC_2.2.5 pthread_spin_lock F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 59da85a5d8..edb9f2f004 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -1455,6 +1455,7 @@ GLIBC_2.16 pthread_self F
GLIBC_2.16 pthread_setcancelstate F
GLIBC_2.16 pthread_setcanceltype F
GLIBC_2.16 pthread_setschedparam F
+GLIBC_2.16 pthread_sigmask F
GLIBC_2.16 ptrace F
GLIBC_2.16 ptsname F
GLIBC_2.16 ptsname_r F
@@ -2158,3 +2159,4 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
index 17f6ec438f..5ac72e4515 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
@@ -156,7 +156,6 @@ GLIBC_2.16 pthread_setconcurrency F
GLIBC_2.16 pthread_setname_np F
GLIBC_2.16 pthread_setschedprio F
GLIBC_2.16 pthread_setspecific F
-GLIBC_2.16 pthread_sigmask F
GLIBC_2.16 pthread_sigqueue F
GLIBC_2.16 pthread_spin_destroy F
GLIBC_2.16 pthread_spin_init F
--
2.17.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread
2020-03-13 19:48 [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
@ 2020-03-13 19:48 ` Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 11:56 ` Florian Weimer
2020-03-13 19:48 ` [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask Adhemerval Zanella
` (3 subsequent siblings)
4 siblings, 2 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-03-13 19:48 UTC (permalink / raw)
To: libc-alpha
It is required because __libc_unwind_longjmp (used on thread
cancellation) calls __sigprocmask. Replace with a direct call.
The sigblock was never exported and thus unused.
Checked on cross build for ia64-linux-gnu.
---
sysdeps/ia64/nptl/Makefile | 4 ++--
sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile
index b7d87c37c8..d34cb27699 100644
--- a/sysdeps/ia64/nptl/Makefile
+++ b/sysdeps/ia64/nptl/Makefile
@@ -20,6 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
endif
ifeq ($(subdir),nptl)
-libpthread-routines += sysdep sigblock sigprocmask
-libpthread-shared-only-routines += sysdep sigblock sigprocmask
+libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
endif
diff --git a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
index 93d1d66dd0..d9ed942963 100644
--- a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
+++ b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
@@ -34,8 +34,7 @@ __libc_unwind_longjmp (sigjmp_buf env, int val)
if (env[0].__mask_was_saved)
/* Restore the saved signal mask. */
- (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
- (sigset_t *) NULL);
+ __libc_signal_restore_set (&env[0].__saved_mask);
/* Call the machine-dependent function to restore machine state. */
__sigstack_longjmp (env[0].__jmpbuf, val ?: 1);
--
2.17.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask
2020-03-13 19:48 [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
2020-03-13 19:48 ` [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread Adhemerval Zanella
@ 2020-03-13 19:48 ` Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 12:01 ` Florian Weimer
2020-03-13 19:48 ` [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657) Adhemerval Zanella
` (2 subsequent siblings)
4 siblings, 2 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-03-13 19:48 UTC (permalink / raw)
To: libc-alpha
With pthread_sigmask on libc.so, it allows consolidate both
implementations.
Checked on x86_64-linux-gnu.
---
nptl/pthreadP.h | 1 +
nptl/pthread_sigmask.c | 2 ++
sysdeps/unix/sysv/linux/sigprocmask.c | 20 +++++---------------
3 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index edec8d0501..c6d8fc69be 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -484,6 +484,7 @@ extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
attribute_hidden;
extern int __pthread_sigmask (int how, const sigset_t *newmask,
sigset_t *oldmask);
+libc_hidden_proto (__pthread_sigmask)
#if IS_IN (libpthread)
diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
index 0e326d610c..c6c6e83c08 100644
--- a/nptl/pthread_sigmask.c
+++ b/nptl/pthread_sigmask.c
@@ -46,6 +46,8 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
? INTERNAL_SYSCALL_ERRNO (result)
: 0);
}
+libc_hidden_def (__pthread_sigmask)
+
versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32);
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
strong_alias (__pthread_sigmask, __pthread_sigmask_2);
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index eb9e4d5e83..6ed0ab1e6a 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -22,21 +22,11 @@
int
__sigprocmask (int how, const sigset_t *set, sigset_t *oset)
{
- sigset_t local_newmask;
-
- /* The only thing we have to make sure here is that SIGCANCEL and
- SIGSETXID are not blocked. */
- if (set != NULL
- && __glibc_unlikely (__sigismember (set, SIGCANCEL)
- || __glibc_unlikely (__sigismember (set, SIGSETXID))))
- {
- local_newmask = *set;
- __sigdelset (&local_newmask, SIGCANCEL);
- __sigdelset (&local_newmask, SIGSETXID);
- set = &local_newmask;
- }
-
- return INLINE_SYSCALL_CALL (rt_sigprocmask, how, set, oset, _NSIG / 8);
+ int result = __pthread_sigmask (how, set, oset);
+ if (result == 0)
+ return 0;
+ __set_errno (result);
+ return result;
}
libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)
--
2.17.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-03-13 19:48 [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
2020-03-13 19:48 ` [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread Adhemerval Zanella
2020-03-13 19:48 ` [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask Adhemerval Zanella
@ 2020-03-13 19:48 ` Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 12:53 ` Florian Weimer
2020-04-17 13:25 ` [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
2020-04-21 11:50 ` Florian Weimer
4 siblings, 2 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-03-13 19:48 UTC (permalink / raw)
To: libc-alpha
The upper bits of the sigset_t s not fully initialized in the signal
mask calls that return information from kernel (sigprocmask,
sigpending, and pthread_sigmask), since the exported sigset_t size
(1024 bits) is larger than Linux support one (64 or 128 bits).
It might make sigisemptyset/sigorset/sigandset fail if the mask
is filled prior the call.
This patch changes the internal signal function to handle up to
supported Linux signal number (_NSIG), the remaining bits are
untouched.
Checked on x86_64-linux-gnu and i686-linux-gnu.
---
nptl/Makefile | 2 +-
nptl/pthread_sigmask.c | 7 +-
nptl/tst-signal8.c | 62 ++++++++++++
signal/Makefile | 1 +
signal/sigsetops.c | 12 +--
signal/tst-sigisemptyset.c | 95 ++++++++++++++++++
sysdeps/unix/sysv/linux/sigpending.c | 6 +-
sysdeps/unix/sysv/linux/sigsetops.h | 143 +++++++++++++--------------
8 files changed, 236 insertions(+), 92 deletions(-)
create mode 100644 nptl/tst-signal8.c
create mode 100644 signal/tst-sigisemptyset.c
diff --git a/nptl/Makefile b/nptl/Makefile
index 4816fa254e..33fa03807e 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -293,7 +293,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \
tst-flock1 tst-flock2 \
tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
- tst-signal6 \
+ tst-signal6 tst-signal8 \
tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \
tst-exit1 tst-exit2 tst-exit3 \
tst-stdio1 tst-stdio2 \
diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
index c6c6e83c08..d266d296c5 100644
--- a/nptl/pthread_sigmask.c
+++ b/nptl/pthread_sigmask.c
@@ -29,12 +29,11 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
/* The only thing we have to make sure here is that SIGCANCEL and
SIGSETXID is not blocked. */
if (newmask != NULL
- && (__builtin_expect (__sigismember (newmask, SIGCANCEL), 0)
- || __builtin_expect (__sigismember (newmask, SIGSETXID), 0)))
+ && (__glibc_unlikely (__sigismember (newmask, SIGCANCEL))
+ || __glibc_unlikely (__sigismember (newmask, SIGSETXID))))
{
local_newmask = *newmask;
- __sigdelset (&local_newmask, SIGCANCEL);
- __sigdelset (&local_newmask, SIGSETXID);
+ __clear_internal_signals (&local_newmask);
newmask = &local_newmask;
}
diff --git a/nptl/tst-signal8.c b/nptl/tst-signal8.c
new file mode 100644
index 0000000000..9da7e5ef07
--- /dev/null
+++ b/nptl/tst-signal8.c
@@ -0,0 +1,62 @@
+/* Tests for sigisemptyset and pthread_sigmask.
+ Copyright (C) 2020 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <signal.h>
+
+#include <support/check.h>
+#include <support/xthread.h>
+
+static void *
+tf (void *arg)
+{
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ TEST_COMPARE (pthread_sigmask (SIG_BLOCK, 0, &set), 0);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ {
+ sigset_t set;
+ sigfillset (&set);
+ TEST_COMPARE (pthread_sigmask (SIG_BLOCK, 0, &set), 0);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ return NULL;
+}
+
+static int
+do_test (void)
+{
+ /* Ensure current SIG_BLOCK mask empty. */
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0);
+ }
+
+ {
+ pthread_t thr = xpthread_create (NULL, tf, NULL);
+ xpthread_join (thr);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/signal/Makefile b/signal/Makefile
index 37de438bba..f3c19e2992 100644
--- a/signal/Makefile
+++ b/signal/Makefile
@@ -49,6 +49,7 @@ tests := tst-signal tst-sigset tst-sigsimple tst-raise tst-sigset2 \
tst-sigwait-eintr tst-sigaction \
tst-minsigstksz-1 tst-minsigstksz-2 tst-minsigstksz-3 \
tst-minsigstksz-3a tst-minsigstksz-4 \
+ tst-sigisemptyset
include ../Rules
diff --git a/signal/sigsetops.c b/signal/sigsetops.c
index eb89e6780e..1165377876 100644
--- a/signal/sigsetops.c
+++ b/signal/sigsetops.c
@@ -26,28 +26,28 @@
int
attribute_compat_text_section
-(__sigismember) (const __sigset_t *set, int sig)
+__sigismember_compat (const __sigset_t *set, int sig)
{
return __sigismember (set, sig);
}
-compat_symbol (libc, __sigismember, __sigismember, GLIBC_2_0);
+compat_symbol (libc, __sigismember_compat, __sigismember, GLIBC_2_0);
int
attribute_compat_text_section
-(__sigaddset) (__sigset_t *set, int sig)
+__sigaddset_compat (__sigset_t *set, int sig)
{
__sigaddset (set, sig);
return 0;
}
-compat_symbol (libc, __sigaddset, __sigaddset, GLIBC_2_0);
+compat_symbol (libc, __sigaddset_compat, __sigaddset, GLIBC_2_0);
int
attribute_compat_text_section
-(__sigdelset) (__sigset_t *set, int sig)
+__sigdelset_compat (__sigset_t *set, int sig)
{
__sigdelset (set, sig);
return 0;
}
-compat_symbol (libc, __sigdelset, __sigdelset, GLIBC_2_0);
+compat_symbol (libc, __sigdelset_compat, __sigdelset, GLIBC_2_0);
#endif
diff --git a/signal/tst-sigisemptyset.c b/signal/tst-sigisemptyset.c
new file mode 100644
index 0000000000..9ed95496f2
--- /dev/null
+++ b/signal/tst-sigisemptyset.c
@@ -0,0 +1,95 @@
+/* Tests for sigisemptyset/sigorset/sigandset.
+ Copyright (C) 2020 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <signal.h>
+
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ {
+ sigset_t set;
+ sigfillset (&set);
+ TEST_COMPARE (sigisemptyset (&set), 0);
+ }
+
+ {
+ sigset_t setfill, setempty, set;
+ sigfillset (&setfill);
+ sigemptyset (&setempty);
+
+ sigorset (&set, &setfill, &setempty);
+ TEST_COMPARE (sigisemptyset (&set), 0);
+
+ sigandset (&set, &setfill, &setempty);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ /* Ensure current SIG_BLOCK mask empty. */
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0);
+ }
+
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ TEST_COMPARE (sigprocmask (SIG_BLOCK, 0, &set), 0);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ {
+ sigset_t set;
+ sigfillset (&set);
+ TEST_COMPARE (sigprocmask (SIG_BLOCK, 0, &set), 0);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ /* Block all signals. */
+ {
+ sigset_t set;
+ sigfillset (&set);
+ TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0);
+ }
+
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ TEST_COMPARE (sigpending (&set), 0);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ {
+ sigset_t set;
+ sigfillset (&set);
+ TEST_COMPARE (sigpending (&set), 0);
+ TEST_COMPARE (sigisemptyset (&set), 1);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c
index f6bedb5182..458a3cf99e 100644
--- a/sysdeps/unix/sysv/linux/sigpending.c
+++ b/sysdeps/unix/sysv/linux/sigpending.c
@@ -15,13 +15,9 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <signal.h>
-#include <unistd.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
-
+#include <sigsetops.h>
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
diff --git a/sysdeps/unix/sysv/linux/sigsetops.h b/sysdeps/unix/sysv/linux/sigsetops.h
index cb97c98b10..f6ca34c842 100644
--- a/sysdeps/unix/sysv/linux/sigsetops.h
+++ b/sysdeps/unix/sysv/linux/sigsetops.h
@@ -28,81 +28,72 @@
/* Return the word index for SIG. */
# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
-# define __sigemptyset(set) \
- (__extension__ ({ \
- int __cnt = _SIGSET_NWORDS; \
- sigset_t *__set = (set); \
- while (--__cnt >= 0) \
- __set->__val[__cnt] = 0; \
- (void)0; \
- }))
-
-# define __sigfillset(set) \
- (__extension__ ({ \
- int __cnt = _SIGSET_NWORDS; \
- sigset_t *__set = (set); \
- while (--__cnt >= 0) \
- __set->__val[__cnt] = ~0UL; \
- (void)0; \
- }))
-
-# define __sigisemptyset(set) \
- (__extension__ ({ \
- int __cnt = _SIGSET_NWORDS; \
- const sigset_t *__set = (set); \
- int __ret = __set->__val[--__cnt]; \
- while (!__ret && --__cnt >= 0) \
- __ret = __set->__val[__cnt]; \
- __ret == 0; \
- }))
-
-# define __sigandset(dest, left, right) \
- (__extension__ ({ \
- int __cnt = _SIGSET_NWORDS; \
- sigset_t *__dest = (dest); \
- const sigset_t *__left = (left); \
- const sigset_t *__right = (right); \
- while (--__cnt >= 0) \
- __dest->__val[__cnt] = (__left->__val[__cnt] \
- & __right->__val[__cnt]); \
- (void)0; \
- }))
-
-# define __sigorset(dest, left, right) \
- (__extension__ ({ \
- int __cnt = _SIGSET_NWORDS; \
- sigset_t *__dest = (dest); \
- const sigset_t *__left = (left); \
- const sigset_t *__right = (right); \
- while (--__cnt >= 0) \
- __dest->__val[__cnt] = (__left->__val[__cnt] \
- | __right->__val[__cnt]); \
- (void)0; \
- }))
-
-/* These macros needn't check for a bogus signal number;
- error checking is done in the non-__ versions. */
-# define __sigismember(set, sig) \
- (__extension__ ({ \
- unsigned long int __mask = __sigmask (sig); \
- unsigned long int __word = __sigword (sig); \
- (set)->__val[__word] & __mask ? 1 : 0; \
- }))
-
-# define __sigaddset(set, sig) \
- (__extension__ ({ \
- unsigned long int __mask = __sigmask (sig); \
- unsigned long int __word = __sigword (sig); \
- (set)->__val[__word] |= __mask; \
- (void)0; \
- }))
-
-# define __sigdelset(set, sig) \
- (__extension__ ({ \
- unsigned long int __mask = __sigmask (sig); \
- unsigned long int __word = __sigword (sig); \
- (set)->__val[__word] &= ~__mask; \
- (void)0; \
- }))
+# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
+
+static inline void
+__sigemptyset (sigset_t *set)
+{
+ int cnt = __NSIG_WORDS;
+ while (--cnt >= 0)
+ set->__val[cnt] = 0;
+}
+
+static inline void
+__sigfillset (sigset_t *set)
+{
+ int cnt = __NSIG_WORDS;
+ while (--cnt >= 0)
+ set->__val[cnt] = ~0UL;
+}
+
+static inline int
+__sigisemptyset (const sigset_t *set)
+{
+ int cnt = __NSIG_WORDS;
+ int ret = set->__val[--cnt];
+ while (ret == 0 && --cnt >= 0)
+ ret = set->__val[cnt];
+ return ret == 0;
+}
+
+static inline void
+__sigandset (sigset_t *dest, const sigset_t *left, const sigset_t *right)
+{
+ int cnt = __NSIG_WORDS;
+ while (--cnt >= 0)
+ dest->__val[cnt] = left->__val[cnt] & right->__val[cnt];
+}
+
+static inline void
+__sigorset (sigset_t *dest, const sigset_t *left, const sigset_t *right)
+{
+ int cnt = __NSIG_WORDS;
+ while (--cnt >= 0)
+ dest->__val[cnt] = left->__val[cnt] | right->__val[cnt];
+}
+
+static inline int
+__sigismember (const sigset_t *set, int sig)
+{
+ unsigned long int mask = __sigmask (sig);
+ unsigned long int word = __sigword (sig);
+ return set->__val[word] & mask ? 1 : 0;
+}
+
+static inline void
+__sigaddset (sigset_t *set, int sig)
+{
+ unsigned long int mask = __sigmask (sig);
+ unsigned long int word = __sigword (sig);
+ set->__val[word] |= mask;
+}
+
+static inline void
+__sigdelset (sigset_t *set, int sig)
+{
+ unsigned long int mask = __sigmask (sig);
+ unsigned long int word = __sigword (sig);
+ set->__val[word] &= ~mask;
+}
#endif /* bits/sigsetops.h */
--
2.17.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc
2020-03-13 19:48 [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
` (2 preceding siblings ...)
2020-03-13 19:48 ` [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657) Adhemerval Zanella
@ 2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 11:50 ` Florian Weimer
4 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-17 13:25 UTC (permalink / raw)
To: libc-alpha
Ping.
On 13/03/2020 16:48, Adhemerval Zanella wrote:
> Changes from previous version:
>
> - Added a new libc.so version for pthread_sigmask.
> - Move ia64 changes to its own patch.
>
> --
>
> This is part of the libpthread removal project:
>
> <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>
>
> A new symbol version is added on libc to force loading failure
> instead of lazy binding one for newly binaries with old loaders.
>
> Checked with a build against all affected ABIs.
> ---
> nptl/Makefile | 3 ++-
> nptl/Versions | 4 ++++
> nptl/libpthread-compat.c | 6 ++++++
> nptl/pthreadP.h | 2 ++
> nptl/pthread_sigmask.c | 10 +++++++---
> sysdeps/unix/sysv/linux/aarch64/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/aarch64/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/alpha/Makefile | 6 +++---
> sysdeps/unix/sysv/linux/alpha/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/alpha/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/arm/be/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/arm/le/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/csky/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/csky/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/hppa/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/i386/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/i386/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/ia64/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/ia64/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist | 2 ++
> .../unix/sysv/linux/m68k/coldfire/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/microblaze/be/libc.abilist | 2 ++
> .../unix/sysv/linux/microblaze/be/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/microblaze/le/libc.abilist | 2 ++
> .../unix/sysv/linux/microblaze/le/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/nios2/libpthread.abilist | 1 -
> .../unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist | 2 ++
> .../sysv/linux/powerpc/powerpc32/libpthread.abilist | 1 -
> .../unix/sysv/linux/powerpc/powerpc64/be/libc.abilist | 2 ++
> .../sysv/linux/powerpc/powerpc64/be/libpthread.abilist | 1 -
> .../unix/sysv/linux/powerpc/powerpc64/le/libc.abilist | 2 ++
> .../sysv/linux/powerpc/powerpc64/le/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist | 2 ++
> .../unix/sysv/linux/s390/s390-32/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 2 ++
> .../unix/sysv/linux/s390/s390-64/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/sh/be/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/sh/le/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist | 2 ++
> .../unix/sysv/linux/sparc/sparc32/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist | 2 ++
> .../unix/sysv/linux/sparc/sparc64/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist | 1 -
> sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 2 ++
> sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist | 1 -
> 62 files changed, 82 insertions(+), 34 deletions(-)
>
> diff --git a/nptl/Makefile b/nptl/Makefile
> index e554a3898d..4816fa254e 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -59,6 +59,7 @@ routines = \
> pthread_getschedparam \
> pthread_self \
> pthread_setschedparam \
> + pthread_sigmask \
> register-atfork \
>
> shared-only-routines = forward
> @@ -123,7 +124,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \
> pthread_barrierattr_setpshared \
> pthread_key_create pthread_key_delete \
> pthread_getspecific pthread_setspecific \
> - pthread_sigmask pthread_kill pthread_sigqueue \
> + pthread_kill pthread_sigqueue \
> pthread_cancel pthread_testcancel \
> pthread_setcancelstate pthread_setcanceltype \
> pthread_once \
> diff --git a/nptl/Versions b/nptl/Versions
> index 543dddc4ee..f7140277f5 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -16,6 +16,7 @@ libc {
> pthread_mutex_lock; pthread_mutex_unlock;
> pthread_self;
> pthread_setcancelstate; pthread_setcanceltype;
> + pthread_sigmask;
> }
> GLIBC_2.1 {
> pthread_attr_init;
> @@ -32,6 +33,9 @@ libc {
> GLIBC_2.28 {
> thrd_current; thrd_equal; thrd_sleep; thrd_yield;
> }
> + GLIBC_2.32 {
> + pthread_sigmask;
> + }
> GLIBC_PRIVATE {
> __libc_alloca_cutoff;
> # Internal libc interface to libpthread
> diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
> index 512b4c77c8..92c981c2d2 100644
> --- a/nptl/libpthread-compat.c
> +++ b/nptl/libpthread-compat.c
> @@ -36,6 +36,12 @@ __libpthread_version_placeholder (void)
> version or later, the placeholder symbol is not needed because
> there are plenty of other symbols which populate those later
> versions. */
> +
> +#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1))
> +compat_symbol_unique (libpthread,
> + __libpthread_version_placeholder, GLIBC_2_0);
> +#endif
> +
> #if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2))
> compat_symbol_unique (libpthread,
> __libpthread_version_placeholder, GLIBC_2_1_2);
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index 06fb0d74c5..edec8d0501 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -482,6 +482,8 @@ extern void __pthread_testcancel (void);
> extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
> const struct timespec *, bool)
> attribute_hidden;
> +extern int __pthread_sigmask (int how, const sigset_t *newmask,
> + sigset_t *oldmask);
>
>
> #if IS_IN (libpthread)
> diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
> index c7860e02a5..0e326d610c 100644
> --- a/nptl/pthread_sigmask.c
> +++ b/nptl/pthread_sigmask.c
> @@ -16,14 +16,13 @@
> License along with the GNU C Library; if not, see
> <https://www.gnu.org/licenses/>. */
>
> -#include <errno.h>
> #include <signal.h>
> #include <pthreadP.h>
> #include <sysdep.h>
> -
> +#include <shlib-compat.h>
>
> int
> -pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
> +__pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
> {
> sigset_t local_newmask;
>
> @@ -47,3 +46,8 @@ pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
> ? INTERNAL_SYSCALL_ERRNO (result)
> : 0);
> }
> +versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32);
> +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
> +strong_alias (__pthread_sigmask, __pthread_sigmask_2);
> +compat_symbol (libc, __pthread_sigmask_2, pthread_sigmask, GLIBC_2_0);
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index a4c31932cb..41bb214bb9 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -1447,6 +1447,7 @@ GLIBC_2.17 pthread_self F
> GLIBC_2.17 pthread_setcancelstate F
> GLIBC_2.17 pthread_setcanceltype F
> GLIBC_2.17 pthread_setschedparam F
> +GLIBC_2.17 pthread_sigmask F
> GLIBC_2.17 ptrace F
> GLIBC_2.17 ptsname F
> GLIBC_2.17 ptsname_r F
> @@ -2145,3 +2146,4 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> index d65beba958..48b368acb1 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> @@ -156,7 +156,6 @@ GLIBC_2.17 pthread_setconcurrency F
> GLIBC_2.17 pthread_setname_np F
> GLIBC_2.17 pthread_setschedprio F
> GLIBC_2.17 pthread_setspecific F
> -GLIBC_2.17 pthread_sigmask F
> GLIBC_2.17 pthread_sigqueue F
> GLIBC_2.17 pthread_spin_destroy F
> GLIBC_2.17 pthread_spin_init F
> diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
> index 2e132e474b..92484bbe65 100644
> --- a/sysdeps/unix/sysv/linux/alpha/Makefile
> +++ b/sysdeps/unix/sysv/linux/alpha/Makefile
> @@ -31,9 +31,9 @@ libm-routines += multc3 divtc3
> endif # math
>
> ifeq ($(subdir),nptl)
> -# pull in __syscall_error routine, __sigprocmask, sigaction stubs.
> -libpthread-routines += sysdep sigprocmask rt_sigaction
> -libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction
> +# pull in __syscall_error routine, sigaction stubs.
> +libpthread-routines += sysdep rt_sigaction
> +libpthread-shared-only-routines += sysdep rt_sigaction
> endif
>
> ifeq ($(subdir),conform)
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index e7f2174ac2..6430af207f 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -891,6 +891,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2225,6 +2226,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _IO_fprintf F
> GLIBC_2.4 _IO_printf F
> GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> index ffd443422d..cfffc5f529 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index b152c0e24a..f4ea1756d5 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -133,6 +133,7 @@ GLIBC_2.30 twalk_r F
> GLIBC_2.31 msgctl F
> GLIBC_2.31 semctl F
> GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _Exit F
> GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> @@ -1517,6 +1518,7 @@ GLIBC_2.4 pthread_self F
> GLIBC_2.4 pthread_setcancelstate F
> GLIBC_2.4 pthread_setcanceltype F
> GLIBC_2.4 pthread_setschedparam F
> +GLIBC_2.4 pthread_sigmask F
> GLIBC_2.4 ptrace F
> GLIBC_2.4 ptsname F
> GLIBC_2.4 ptsname_r F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> index 129c64b0a7..050e799de8 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> @@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F
> GLIBC_2.4 pthread_setconcurrency F
> GLIBC_2.4 pthread_setschedprio F
> GLIBC_2.4 pthread_setspecific F
> -GLIBC_2.4 pthread_sigmask F
> GLIBC_2.4 pthread_spin_destroy F
> GLIBC_2.4 pthread_spin_init F
> GLIBC_2.4 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 9371927927..f1456b26b2 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -130,6 +130,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _Exit F
> GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
> @@ -1514,6 +1515,7 @@ GLIBC_2.4 pthread_self F
> GLIBC_2.4 pthread_setcancelstate F
> GLIBC_2.4 pthread_setcanceltype F
> GLIBC_2.4 pthread_setschedparam F
> +GLIBC_2.4 pthread_sigmask F
> GLIBC_2.4 ptrace F
> GLIBC_2.4 ptsname F
> GLIBC_2.4 ptsname_r F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> index 129c64b0a7..050e799de8 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> @@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F
> GLIBC_2.4 pthread_setconcurrency F
> GLIBC_2.4 pthread_setschedprio F
> GLIBC_2.4 pthread_setspecific F
> -GLIBC_2.4 pthread_sigmask F
> GLIBC_2.4 pthread_spin_destroy F
> GLIBC_2.4 pthread_spin_init F
> GLIBC_2.4 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index 9b3cee65bb..c54aed2f8e 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -1435,6 +1435,7 @@ GLIBC_2.29 pthread_self F
> GLIBC_2.29 pthread_setcancelstate F
> GLIBC_2.29 pthread_setcanceltype F
> GLIBC_2.29 pthread_setschedparam F
> +GLIBC_2.29 pthread_sigmask F
> GLIBC_2.29 ptrace F
> GLIBC_2.29 ptsname F
> GLIBC_2.29 ptsname_r F
> @@ -2089,3 +2090,4 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> index 8b72528819..977905a839 100644
> --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> @@ -166,7 +166,6 @@ GLIBC_2.29 pthread_setconcurrency F
> GLIBC_2.29 pthread_setname_np F
> GLIBC_2.29 pthread_setschedprio F
> GLIBC_2.29 pthread_setspecific F
> -GLIBC_2.29 pthread_sigmask F
> GLIBC_2.29 pthread_sigqueue F
> GLIBC_2.29 pthread_spin_destroy F
> GLIBC_2.29 pthread_spin_init F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index df6d96fbae..87373f755b 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -1274,6 +1274,7 @@ GLIBC_2.2 pthread_self F
> GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setschedparam F
> +GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 ptrace F
> GLIBC_2.2 ptsname F
> GLIBC_2.2 ptsname_r F
> @@ -2046,6 +2047,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> index 84fa775d95..558d3f0dfd 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setconcurrency F
> GLIBC_2.2 pthread_setspecific F
> -GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 pthread_spin_destroy F
> GLIBC_2.2 pthread_spin_init F
> GLIBC_2.2 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index fcb625b6bf..1bd2e02f79 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -868,6 +868,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2212,6 +2213,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> index 4727bd5d43..f13fdce3a8 100644
> --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index cb556c5998..07e51d46bf 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -1295,6 +1295,7 @@ GLIBC_2.2 pthread_self F
> GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setschedparam F
> +GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 ptrace F
> GLIBC_2.2 ptsname F
> GLIBC_2.2 ptsname_r F
> @@ -2078,6 +2079,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> index 3d947a66aa..0c96fc3ccb 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setconcurrency F
> GLIBC_2.2 pthread_setspecific F
> -GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 pthread_spin_destroy F
> GLIBC_2.2 pthread_spin_init F
> GLIBC_2.2 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index 5e3cdea246..42ea4c24bf 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -134,6 +134,7 @@ GLIBC_2.30 twalk_r F
> GLIBC_2.31 msgctl F
> GLIBC_2.31 semctl F
> GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _Exit F
> GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> GLIBC_2.4 _IO_2_1_stdin_ D 0x98
> @@ -1497,6 +1498,7 @@ GLIBC_2.4 pthread_self F
> GLIBC_2.4 pthread_setcancelstate F
> GLIBC_2.4 pthread_setcanceltype F
> GLIBC_2.4 pthread_setschedparam F
> +GLIBC_2.4 pthread_sigmask F
> GLIBC_2.4 ptrace F
> GLIBC_2.4 ptsname F
> GLIBC_2.4 ptsname_r F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> index 129c64b0a7..050e799de8 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> @@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F
> GLIBC_2.4 pthread_setconcurrency F
> GLIBC_2.4 pthread_setschedprio F
> GLIBC_2.4 pthread_setspecific F
> -GLIBC_2.4 pthread_sigmask F
> GLIBC_2.4 pthread_spin_destroy F
> GLIBC_2.4 pthread_spin_init F
> GLIBC_2.4 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index ea5e7a41af..e9358fb092 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -867,6 +867,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2158,6 +2159,7 @@ GLIBC_2.30 twalk_r F
> GLIBC_2.31 msgctl F
> GLIBC_2.31 semctl F
> GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> index 4727bd5d43..f13fdce3a8 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index ac55b0acd7..2cefe739c0 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -1450,6 +1450,7 @@ GLIBC_2.18 pthread_self F
> GLIBC_2.18 pthread_setcancelstate F
> GLIBC_2.18 pthread_setcanceltype F
> GLIBC_2.18 pthread_setschedparam F
> +GLIBC_2.18 pthread_sigmask F
> GLIBC_2.18 ptrace F
> GLIBC_2.18 ptsname F
> GLIBC_2.18 ptsname_r F
> @@ -2140,3 +2141,4 @@ GLIBC_2.30 twalk_r F
> GLIBC_2.31 msgctl F
> GLIBC_2.31 semctl F
> GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> index 78885c05cf..87bd3ad30e 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> @@ -158,7 +158,6 @@ GLIBC_2.18 pthread_setconcurrency F
> GLIBC_2.18 pthread_setname_np F
> GLIBC_2.18 pthread_setschedprio F
> GLIBC_2.18 pthread_setspecific F
> -GLIBC_2.18 pthread_sigmask F
> GLIBC_2.18 pthread_sigqueue F
> GLIBC_2.18 pthread_spin_destroy F
> GLIBC_2.18 pthread_spin_init F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index f7ced487f7..3474ef1490 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -1450,6 +1450,7 @@ GLIBC_2.18 pthread_self F
> GLIBC_2.18 pthread_setcancelstate F
> GLIBC_2.18 pthread_setcanceltype F
> GLIBC_2.18 pthread_setschedparam F
> +GLIBC_2.18 pthread_sigmask F
> GLIBC_2.18 ptrace F
> GLIBC_2.18 ptsname F
> GLIBC_2.18 ptsname_r F
> @@ -2137,3 +2138,4 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> index 78885c05cf..87bd3ad30e 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> @@ -158,7 +158,6 @@ GLIBC_2.18 pthread_setconcurrency F
> GLIBC_2.18 pthread_setname_np F
> GLIBC_2.18 pthread_setschedprio F
> GLIBC_2.18 pthread_setspecific F
> -GLIBC_2.18 pthread_sigmask F
> GLIBC_2.18 pthread_sigqueue F
> GLIBC_2.18 pthread_spin_destroy F
> GLIBC_2.18 pthread_spin_init F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 06c2e64edd..a6f99a7369 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2129,6 +2130,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> index 62f7a3f349..474ed999b3 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index bdfd073b86..48222af11c 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2127,6 +2128,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> index 62f7a3f349..474ed999b3 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 3d61d4974a..99965cfb0f 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2135,6 +2136,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index 675acca5db..2c8bafc669 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -862,6 +862,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2129,6 +2130,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index 7fec0c9670..52cf72052c 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -1492,6 +1492,7 @@ GLIBC_2.21 pthread_self F
> GLIBC_2.21 pthread_setcancelstate F
> GLIBC_2.21 pthread_setcanceltype F
> GLIBC_2.21 pthread_setschedparam F
> +GLIBC_2.21 pthread_sigmask F
> GLIBC_2.21 ptrace F
> GLIBC_2.21 ptsname F
> GLIBC_2.21 ptsname_r F
> @@ -2178,3 +2179,4 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> index 45ebcf5a6c..fb9c4a178a 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> @@ -158,7 +158,6 @@ GLIBC_2.21 pthread_setconcurrency F
> GLIBC_2.21 pthread_setname_np F
> GLIBC_2.21 pthread_setschedprio F
> GLIBC_2.21 pthread_setspecific F
> -GLIBC_2.21 pthread_sigmask F
> GLIBC_2.21 pthread_sigqueue F
> GLIBC_2.21 pthread_spin_destroy F
> GLIBC_2.21 pthread_spin_init F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 1e8ff6f83e..2ca5bbccf3 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -875,6 +875,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2185,6 +2186,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _IO_fprintf F
> GLIBC_2.4 _IO_printf F
> GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> index 2f4ed55693..65a9ef573e 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index 0c86217fc6..82d77b7e48 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -1380,6 +1380,7 @@ GLIBC_2.3 pthread_self F
> GLIBC_2.3 pthread_setcancelstate F
> GLIBC_2.3 pthread_setcanceltype F
> GLIBC_2.3 pthread_setschedparam F
> +GLIBC_2.3 pthread_sigmask F
> GLIBC_2.3 ptrace F
> GLIBC_2.3 ptsname F
> GLIBC_2.3 ptsname_r F
> @@ -2048,6 +2049,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _IO_fprintf F
> GLIBC_2.4 _IO_printf F
> GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> index f4d34b1c47..fe5bf9fd47 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> @@ -157,7 +157,6 @@ GLIBC_2.3 pthread_setcancelstate F
> GLIBC_2.3 pthread_setcanceltype F
> GLIBC_2.3 pthread_setconcurrency F
> GLIBC_2.3 pthread_setspecific F
> -GLIBC_2.3 pthread_sigmask F
> GLIBC_2.3 pthread_spin_destroy F
> GLIBC_2.3 pthread_spin_init F
> GLIBC_2.3 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index 2229a1dcc0..2b6a76d9c2 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -1536,6 +1536,7 @@ GLIBC_2.17 pthread_self F
> GLIBC_2.17 pthread_setcancelstate F
> GLIBC_2.17 pthread_setcanceltype F
> GLIBC_2.17 pthread_setschedparam F
> +GLIBC_2.17 pthread_sigmask F
> GLIBC_2.17 ptrace F
> GLIBC_2.17 ptsname F
> GLIBC_2.17 ptsname_r F
> @@ -2247,3 +2248,4 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> index d65beba958..48b368acb1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> @@ -156,7 +156,6 @@ GLIBC_2.17 pthread_setconcurrency F
> GLIBC_2.17 pthread_setname_np F
> GLIBC_2.17 pthread_setschedprio F
> GLIBC_2.17 pthread_setspecific F
> -GLIBC_2.17 pthread_sigmask F
> GLIBC_2.17 pthread_sigqueue F
> GLIBC_2.17 pthread_spin_destroy F
> GLIBC_2.17 pthread_spin_init F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 31010e6cf7..234d34929a 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -1438,6 +1438,7 @@ GLIBC_2.27 pthread_self F
> GLIBC_2.27 pthread_setcancelstate F
> GLIBC_2.27 pthread_setcanceltype F
> GLIBC_2.27 pthread_setschedparam F
> +GLIBC_2.27 pthread_sigmask F
> GLIBC_2.27 ptrace F
> GLIBC_2.27 ptsname F
> GLIBC_2.27 ptsname_r F
> @@ -2107,3 +2108,4 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> index 5610e51e10..44e3719991 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> @@ -155,7 +155,6 @@ GLIBC_2.27 pthread_setconcurrency F
> GLIBC_2.27 pthread_setname_np F
> GLIBC_2.27 pthread_setschedprio F
> GLIBC_2.27 pthread_setspecific F
> -GLIBC_2.27 pthread_sigmask F
> GLIBC_2.27 pthread_sigqueue F
> GLIBC_2.27 pthread_spin_destroy F
> GLIBC_2.27 pthread_spin_init F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 4feca641b0..1f06cce028 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -866,6 +866,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2183,6 +2184,7 @@ GLIBC_2.30 twalk_r F
> GLIBC_2.31 msgctl F
> GLIBC_2.31 semctl F
> GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _IO_fprintf F
> GLIBC_2.4 _IO_printf F
> GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> index 80ad434007..0b2913ba2b 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index efe588a072..26c2ce32e5 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -1292,6 +1292,7 @@ GLIBC_2.2 pthread_self F
> GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setschedparam F
> +GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 ptrace F
> GLIBC_2.2 ptsname F
> GLIBC_2.2 ptsname_r F
> @@ -2084,6 +2085,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _IO_fprintf F
> GLIBC_2.4 _IO_printf F
> GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> index daef2b5cd5..8c71cdc48d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> @@ -138,7 +138,6 @@ GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setconcurrency F
> GLIBC_2.2 pthread_setspecific F
> -GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 pthread_spin_destroy F
> GLIBC_2.2 pthread_spin_init F
> GLIBC_2.2 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index 6bfc2b7439..7ad2e920c3 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -1278,6 +1278,7 @@ GLIBC_2.2 pthread_self F
> GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setschedparam F
> +GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 ptrace F
> GLIBC_2.2 ptsname F
> GLIBC_2.2 ptsname_r F
> @@ -2053,6 +2054,7 @@ GLIBC_2.30 twalk_r F
> GLIBC_2.31 msgctl F
> GLIBC_2.31 semctl F
> GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> index 84fa775d95..558d3f0dfd 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setconcurrency F
> GLIBC_2.2 pthread_setspecific F
> -GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 pthread_spin_destroy F
> GLIBC_2.2 pthread_spin_init F
> GLIBC_2.2 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index 4b057bf4a2..d2611bf0a5 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -1278,6 +1278,7 @@ GLIBC_2.2 pthread_self F
> GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setschedparam F
> +GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 ptrace F
> GLIBC_2.2 ptsname F
> GLIBC_2.2 ptsname_r F
> @@ -2050,6 +2051,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> index 84fa775d95..558d3f0dfd 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setconcurrency F
> GLIBC_2.2 pthread_setspecific F
> -GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 pthread_spin_destroy F
> GLIBC_2.2 pthread_spin_init F
> GLIBC_2.2 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index 49cd597fd6..18a528f0e9 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -869,6 +869,7 @@ GLIBC_2.0 pthread_self F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setschedparam F
> +GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 ptrace F
> GLIBC_2.0 putc F
> GLIBC_2.0 putc_unlocked F
> @@ -2174,6 +2175,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 _IO_fprintf F
> GLIBC_2.4 _IO_printf F
> GLIBC_2.4 _IO_sprintf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> index ffd443422d..cfffc5f529 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F
> GLIBC_2.0 pthread_setcancelstate F
> GLIBC_2.0 pthread_setcanceltype F
> GLIBC_2.0 pthread_setspecific F
> -GLIBC_2.0 pthread_sigmask F
> GLIBC_2.0 pthread_testcancel F
> GLIBC_2.0 raise F
> GLIBC_2.0 read F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 95e68e0ba1..a1d48b0f3c 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -1321,6 +1321,7 @@ GLIBC_2.2 pthread_self F
> GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setschedparam F
> +GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 ptrace F
> GLIBC_2.2 ptsname F
> GLIBC_2.2 ptsname_r F
> @@ -2101,6 +2102,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> index 3d947a66aa..0c96fc3ccb 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F
> GLIBC_2.2 pthread_setcanceltype F
> GLIBC_2.2 pthread_setconcurrency F
> GLIBC_2.2 pthread_setspecific F
> -GLIBC_2.2 pthread_sigmask F
> GLIBC_2.2 pthread_spin_destroy F
> GLIBC_2.2 pthread_spin_init F
> GLIBC_2.2 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 1f2dbd1451..6418ace78a 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -1288,6 +1288,7 @@ GLIBC_2.2.5 pthread_self F
> GLIBC_2.2.5 pthread_setcancelstate F
> GLIBC_2.2.5 pthread_setcanceltype F
> GLIBC_2.2.5 pthread_setschedparam F
> +GLIBC_2.2.5 pthread_sigmask F
> GLIBC_2.2.5 ptrace F
> GLIBC_2.2.5 ptsname F
> GLIBC_2.2.5 ptsname_r F
> @@ -2059,6 +2060,7 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> GLIBC_2.4 __confstr_chk F
> GLIBC_2.4 __fgets_chk F
> GLIBC_2.4 __fgets_unlocked_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> index a6bc9f4a55..2888c3150b 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> @@ -137,7 +137,6 @@ GLIBC_2.2.5 pthread_setcancelstate F
> GLIBC_2.2.5 pthread_setcanceltype F
> GLIBC_2.2.5 pthread_setconcurrency F
> GLIBC_2.2.5 pthread_setspecific F
> -GLIBC_2.2.5 pthread_sigmask F
> GLIBC_2.2.5 pthread_spin_destroy F
> GLIBC_2.2.5 pthread_spin_init F
> GLIBC_2.2.5 pthread_spin_lock F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index 59da85a5d8..edb9f2f004 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -1455,6 +1455,7 @@ GLIBC_2.16 pthread_self F
> GLIBC_2.16 pthread_setcancelstate F
> GLIBC_2.16 pthread_setcanceltype F
> GLIBC_2.16 pthread_setschedparam F
> +GLIBC_2.16 pthread_sigmask F
> GLIBC_2.16 ptrace F
> GLIBC_2.16 ptsname F
> GLIBC_2.16 ptsname_r F
> @@ -2158,3 +2159,4 @@ GLIBC_2.30 getdents64 F
> GLIBC_2.30 gettid F
> GLIBC_2.30 tgkill F
> GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> index 17f6ec438f..5ac72e4515 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> @@ -156,7 +156,6 @@ GLIBC_2.16 pthread_setconcurrency F
> GLIBC_2.16 pthread_setname_np F
> GLIBC_2.16 pthread_setschedprio F
> GLIBC_2.16 pthread_setspecific F
> -GLIBC_2.16 pthread_sigmask F
> GLIBC_2.16 pthread_sigqueue F
> GLIBC_2.16 pthread_spin_destroy F
> GLIBC_2.16 pthread_spin_init F
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread
2020-03-13 19:48 ` [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread Adhemerval Zanella
@ 2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 11:56 ` Florian Weimer
1 sibling, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-17 13:25 UTC (permalink / raw)
To: libc-alpha
Ping.
On 13/03/2020 16:48, Adhemerval Zanella wrote:
> It is required because __libc_unwind_longjmp (used on thread
> cancellation) calls __sigprocmask. Replace with a direct call.
>
> The sigblock was never exported and thus unused.
>
> Checked on cross build for ia64-linux-gnu.
> ---
> sysdeps/ia64/nptl/Makefile | 4 ++--
> sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c | 3 +--
> 2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile
> index b7d87c37c8..d34cb27699 100644
> --- a/sysdeps/ia64/nptl/Makefile
> +++ b/sysdeps/ia64/nptl/Makefile
> @@ -20,6 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
> endif
>
> ifeq ($(subdir),nptl)
> -libpthread-routines += sysdep sigblock sigprocmask
> -libpthread-shared-only-routines += sysdep sigblock sigprocmask
> +libpthread-routines += sysdep
> +libpthread-shared-only-routines += sysdep
> endif
> diff --git a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
> index 93d1d66dd0..d9ed942963 100644
> --- a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
> +++ b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
> @@ -34,8 +34,7 @@ __libc_unwind_longjmp (sigjmp_buf env, int val)
>
> if (env[0].__mask_was_saved)
> /* Restore the saved signal mask. */
> - (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
> - (sigset_t *) NULL);
> + __libc_signal_restore_set (&env[0].__saved_mask);
>
> /* Call the machine-dependent function to restore machine state. */
> __sigstack_longjmp (env[0].__jmpbuf, val ?: 1);
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask
2020-03-13 19:48 ` [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask Adhemerval Zanella
@ 2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 12:01 ` Florian Weimer
1 sibling, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-17 13:25 UTC (permalink / raw)
To: libc-alpha
Ping.
On 13/03/2020 16:48, Adhemerval Zanella wrote:
> With pthread_sigmask on libc.so, it allows consolidate both
> implementations.
>
> Checked on x86_64-linux-gnu.
> ---
> nptl/pthreadP.h | 1 +
> nptl/pthread_sigmask.c | 2 ++
> sysdeps/unix/sysv/linux/sigprocmask.c | 20 +++++---------------
> 3 files changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index edec8d0501..c6d8fc69be 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -484,6 +484,7 @@ extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
> attribute_hidden;
> extern int __pthread_sigmask (int how, const sigset_t *newmask,
> sigset_t *oldmask);
> +libc_hidden_proto (__pthread_sigmask)
>
>
> #if IS_IN (libpthread)
> diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
> index 0e326d610c..c6c6e83c08 100644
> --- a/nptl/pthread_sigmask.c
> +++ b/nptl/pthread_sigmask.c
> @@ -46,6 +46,8 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
> ? INTERNAL_SYSCALL_ERRNO (result)
> : 0);
> }
> +libc_hidden_def (__pthread_sigmask)
> +
> versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32);
> #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
> strong_alias (__pthread_sigmask, __pthread_sigmask_2);
> diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
> index eb9e4d5e83..6ed0ab1e6a 100644
> --- a/sysdeps/unix/sysv/linux/sigprocmask.c
> +++ b/sysdeps/unix/sysv/linux/sigprocmask.c
> @@ -22,21 +22,11 @@
> int
> __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
> {
> - sigset_t local_newmask;
> -
> - /* The only thing we have to make sure here is that SIGCANCEL and
> - SIGSETXID are not blocked. */
> - if (set != NULL
> - && __glibc_unlikely (__sigismember (set, SIGCANCEL)
> - || __glibc_unlikely (__sigismember (set, SIGSETXID))))
> - {
> - local_newmask = *set;
> - __sigdelset (&local_newmask, SIGCANCEL);
> - __sigdelset (&local_newmask, SIGSETXID);
> - set = &local_newmask;
> - }
> -
> - return INLINE_SYSCALL_CALL (rt_sigprocmask, how, set, oset, _NSIG / 8);
> + int result = __pthread_sigmask (how, set, oset);
> + if (result == 0)
> + return 0;
> + __set_errno (result);
> + return result;
> }
> libc_hidden_def (__sigprocmask)
> weak_alias (__sigprocmask, sigprocmask)
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-03-13 19:48 ` [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657) Adhemerval Zanella
@ 2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 12:53 ` Florian Weimer
1 sibling, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-17 13:25 UTC (permalink / raw)
To: libc-alpha
Ping.
On 13/03/2020 16:48, Adhemerval Zanella wrote:
> The upper bits of the sigset_t s not fully initialized in the signal
> mask calls that return information from kernel (sigprocmask,
> sigpending, and pthread_sigmask), since the exported sigset_t size
> (1024 bits) is larger than Linux support one (64 or 128 bits).
> It might make sigisemptyset/sigorset/sigandset fail if the mask
> is filled prior the call.
>
> This patch changes the internal signal function to handle up to
> supported Linux signal number (_NSIG), the remaining bits are
> untouched.
>
> Checked on x86_64-linux-gnu and i686-linux-gnu.
> ---
> nptl/Makefile | 2 +-
> nptl/pthread_sigmask.c | 7 +-
> nptl/tst-signal8.c | 62 ++++++++++++
> signal/Makefile | 1 +
> signal/sigsetops.c | 12 +--
> signal/tst-sigisemptyset.c | 95 ++++++++++++++++++
> sysdeps/unix/sysv/linux/sigpending.c | 6 +-
> sysdeps/unix/sysv/linux/sigsetops.h | 143 +++++++++++++--------------
> 8 files changed, 236 insertions(+), 92 deletions(-)
> create mode 100644 nptl/tst-signal8.c
> create mode 100644 signal/tst-sigisemptyset.c
>
> diff --git a/nptl/Makefile b/nptl/Makefile
> index 4816fa254e..33fa03807e 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -293,7 +293,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
> tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \
> tst-flock1 tst-flock2 \
> tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
> - tst-signal6 \
> + tst-signal6 tst-signal8 \
> tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \
> tst-exit1 tst-exit2 tst-exit3 \
> tst-stdio1 tst-stdio2 \
> diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
> index c6c6e83c08..d266d296c5 100644
> --- a/nptl/pthread_sigmask.c
> +++ b/nptl/pthread_sigmask.c
> @@ -29,12 +29,11 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
> /* The only thing we have to make sure here is that SIGCANCEL and
> SIGSETXID is not blocked. */
> if (newmask != NULL
> - && (__builtin_expect (__sigismember (newmask, SIGCANCEL), 0)
> - || __builtin_expect (__sigismember (newmask, SIGSETXID), 0)))
> + && (__glibc_unlikely (__sigismember (newmask, SIGCANCEL))
> + || __glibc_unlikely (__sigismember (newmask, SIGSETXID))))
> {
> local_newmask = *newmask;
> - __sigdelset (&local_newmask, SIGCANCEL);
> - __sigdelset (&local_newmask, SIGSETXID);
> + __clear_internal_signals (&local_newmask);
> newmask = &local_newmask;
> }
>
> diff --git a/nptl/tst-signal8.c b/nptl/tst-signal8.c
> new file mode 100644
> index 0000000000..9da7e5ef07
> --- /dev/null
> +++ b/nptl/tst-signal8.c
> @@ -0,0 +1,62 @@
> +/* Tests for sigisemptyset and pthread_sigmask.
> + Copyright (C) 2020 Free Software Foundation, Inc.
> + This file is part of the GNU C Library.
> +
> + The GNU C Library is free software; you can redistribute it and/or
> + modify it under the terms of the GNU Lesser General Public
> + License as published by the Free Software Foundation; either
> + version 2.1 of the License, or (at your option) any later version.
> +
> + The GNU C Library is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + Lesser General Public License for more details.
> +
> + You should have received a copy of the GNU Lesser General Public
> + License along with the GNU C Library; if not, see
> + <https://www.gnu.org/licenses/>. */
> +
> +#include <signal.h>
> +
> +#include <support/check.h>
> +#include <support/xthread.h>
> +
> +static void *
> +tf (void *arg)
> +{
> + {
> + sigset_t set;
> + sigemptyset (&set);
> + TEST_COMPARE (pthread_sigmask (SIG_BLOCK, 0, &set), 0);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + {
> + sigset_t set;
> + sigfillset (&set);
> + TEST_COMPARE (pthread_sigmask (SIG_BLOCK, 0, &set), 0);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + return NULL;
> +}
> +
> +static int
> +do_test (void)
> +{
> + /* Ensure current SIG_BLOCK mask empty. */
> + {
> + sigset_t set;
> + sigemptyset (&set);
> + TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0);
> + }
> +
> + {
> + pthread_t thr = xpthread_create (NULL, tf, NULL);
> + xpthread_join (thr);
> + }
> +
> + return 0;
> +}
> +
> +#include <support/test-driver.c>
> diff --git a/signal/Makefile b/signal/Makefile
> index 37de438bba..f3c19e2992 100644
> --- a/signal/Makefile
> +++ b/signal/Makefile
> @@ -49,6 +49,7 @@ tests := tst-signal tst-sigset tst-sigsimple tst-raise tst-sigset2 \
> tst-sigwait-eintr tst-sigaction \
> tst-minsigstksz-1 tst-minsigstksz-2 tst-minsigstksz-3 \
> tst-minsigstksz-3a tst-minsigstksz-4 \
> + tst-sigisemptyset
>
> include ../Rules
>
> diff --git a/signal/sigsetops.c b/signal/sigsetops.c
> index eb89e6780e..1165377876 100644
> --- a/signal/sigsetops.c
> +++ b/signal/sigsetops.c
> @@ -26,28 +26,28 @@
>
> int
> attribute_compat_text_section
> -(__sigismember) (const __sigset_t *set, int sig)
> +__sigismember_compat (const __sigset_t *set, int sig)
> {
> return __sigismember (set, sig);
> }
> -compat_symbol (libc, __sigismember, __sigismember, GLIBC_2_0);
> +compat_symbol (libc, __sigismember_compat, __sigismember, GLIBC_2_0);
>
> int
> attribute_compat_text_section
> -(__sigaddset) (__sigset_t *set, int sig)
> +__sigaddset_compat (__sigset_t *set, int sig)
> {
> __sigaddset (set, sig);
> return 0;
> }
> -compat_symbol (libc, __sigaddset, __sigaddset, GLIBC_2_0);
> +compat_symbol (libc, __sigaddset_compat, __sigaddset, GLIBC_2_0);
>
> int
> attribute_compat_text_section
> -(__sigdelset) (__sigset_t *set, int sig)
> +__sigdelset_compat (__sigset_t *set, int sig)
> {
> __sigdelset (set, sig);
> return 0;
> }
> -compat_symbol (libc, __sigdelset, __sigdelset, GLIBC_2_0);
> +compat_symbol (libc, __sigdelset_compat, __sigdelset, GLIBC_2_0);
>
> #endif
> diff --git a/signal/tst-sigisemptyset.c b/signal/tst-sigisemptyset.c
> new file mode 100644
> index 0000000000..9ed95496f2
> --- /dev/null
> +++ b/signal/tst-sigisemptyset.c
> @@ -0,0 +1,95 @@
> +/* Tests for sigisemptyset/sigorset/sigandset.
> + Copyright (C) 2020 Free Software Foundation, Inc.
> + This file is part of the GNU C Library.
> +
> + The GNU C Library is free software; you can redistribute it and/or
> + modify it under the terms of the GNU Lesser General Public
> + License as published by the Free Software Foundation; either
> + version 2.1 of the License, or (at your option) any later version.
> +
> + The GNU C Library is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + Lesser General Public License for more details.
> +
> + You should have received a copy of the GNU Lesser General Public
> + License along with the GNU C Library; if not, see
> + <https://www.gnu.org/licenses/>. */
> +
> +#include <signal.h>
> +
> +#include <support/check.h>
> +
> +static int
> +do_test (void)
> +{
> + {
> + sigset_t set;
> + sigemptyset (&set);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + {
> + sigset_t set;
> + sigfillset (&set);
> + TEST_COMPARE (sigisemptyset (&set), 0);
> + }
> +
> + {
> + sigset_t setfill, setempty, set;
> + sigfillset (&setfill);
> + sigemptyset (&setempty);
> +
> + sigorset (&set, &setfill, &setempty);
> + TEST_COMPARE (sigisemptyset (&set), 0);
> +
> + sigandset (&set, &setfill, &setempty);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + /* Ensure current SIG_BLOCK mask empty. */
> + {
> + sigset_t set;
> + sigemptyset (&set);
> + TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0);
> + }
> +
> + {
> + sigset_t set;
> + sigemptyset (&set);
> + TEST_COMPARE (sigprocmask (SIG_BLOCK, 0, &set), 0);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + {
> + sigset_t set;
> + sigfillset (&set);
> + TEST_COMPARE (sigprocmask (SIG_BLOCK, 0, &set), 0);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + /* Block all signals. */
> + {
> + sigset_t set;
> + sigfillset (&set);
> + TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0);
> + }
> +
> + {
> + sigset_t set;
> + sigemptyset (&set);
> + TEST_COMPARE (sigpending (&set), 0);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + {
> + sigset_t set;
> + sigfillset (&set);
> + TEST_COMPARE (sigpending (&set), 0);
> + TEST_COMPARE (sigisemptyset (&set), 1);
> + }
> +
> + return 0;
> +}
> +
> +#include <support/test-driver.c>
> diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c
> index f6bedb5182..458a3cf99e 100644
> --- a/sysdeps/unix/sysv/linux/sigpending.c
> +++ b/sysdeps/unix/sysv/linux/sigpending.c
> @@ -15,13 +15,9 @@
> License along with the GNU C Library; if not, see
> <https://www.gnu.org/licenses/>. */
>
> -#include <errno.h>
> #include <signal.h>
> -#include <unistd.h>
> -
> #include <sysdep.h>
> -#include <sys/syscall.h>
> -
> +#include <sigsetops.h>
>
> /* Change the set of blocked signals to SET,
> wait until a signal arrives, and restore the set of blocked signals. */
> diff --git a/sysdeps/unix/sysv/linux/sigsetops.h b/sysdeps/unix/sysv/linux/sigsetops.h
> index cb97c98b10..f6ca34c842 100644
> --- a/sysdeps/unix/sysv/linux/sigsetops.h
> +++ b/sysdeps/unix/sysv/linux/sigsetops.h
> @@ -28,81 +28,72 @@
> /* Return the word index for SIG. */
> # define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
>
> -# define __sigemptyset(set) \
> - (__extension__ ({ \
> - int __cnt = _SIGSET_NWORDS; \
> - sigset_t *__set = (set); \
> - while (--__cnt >= 0) \
> - __set->__val[__cnt] = 0; \
> - (void)0; \
> - }))
> -
> -# define __sigfillset(set) \
> - (__extension__ ({ \
> - int __cnt = _SIGSET_NWORDS; \
> - sigset_t *__set = (set); \
> - while (--__cnt >= 0) \
> - __set->__val[__cnt] = ~0UL; \
> - (void)0; \
> - }))
> -
> -# define __sigisemptyset(set) \
> - (__extension__ ({ \
> - int __cnt = _SIGSET_NWORDS; \
> - const sigset_t *__set = (set); \
> - int __ret = __set->__val[--__cnt]; \
> - while (!__ret && --__cnt >= 0) \
> - __ret = __set->__val[__cnt]; \
> - __ret == 0; \
> - }))
> -
> -# define __sigandset(dest, left, right) \
> - (__extension__ ({ \
> - int __cnt = _SIGSET_NWORDS; \
> - sigset_t *__dest = (dest); \
> - const sigset_t *__left = (left); \
> - const sigset_t *__right = (right); \
> - while (--__cnt >= 0) \
> - __dest->__val[__cnt] = (__left->__val[__cnt] \
> - & __right->__val[__cnt]); \
> - (void)0; \
> - }))
> -
> -# define __sigorset(dest, left, right) \
> - (__extension__ ({ \
> - int __cnt = _SIGSET_NWORDS; \
> - sigset_t *__dest = (dest); \
> - const sigset_t *__left = (left); \
> - const sigset_t *__right = (right); \
> - while (--__cnt >= 0) \
> - __dest->__val[__cnt] = (__left->__val[__cnt] \
> - | __right->__val[__cnt]); \
> - (void)0; \
> - }))
> -
> -/* These macros needn't check for a bogus signal number;
> - error checking is done in the non-__ versions. */
> -# define __sigismember(set, sig) \
> - (__extension__ ({ \
> - unsigned long int __mask = __sigmask (sig); \
> - unsigned long int __word = __sigword (sig); \
> - (set)->__val[__word] & __mask ? 1 : 0; \
> - }))
> -
> -# define __sigaddset(set, sig) \
> - (__extension__ ({ \
> - unsigned long int __mask = __sigmask (sig); \
> - unsigned long int __word = __sigword (sig); \
> - (set)->__val[__word] |= __mask; \
> - (void)0; \
> - }))
> -
> -# define __sigdelset(set, sig) \
> - (__extension__ ({ \
> - unsigned long int __mask = __sigmask (sig); \
> - unsigned long int __word = __sigword (sig); \
> - (set)->__val[__word] &= ~__mask; \
> - (void)0; \
> - }))
> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
> +
> +static inline void
> +__sigemptyset (sigset_t *set)
> +{
> + int cnt = __NSIG_WORDS;
> + while (--cnt >= 0)
> + set->__val[cnt] = 0;
> +}
> +
> +static inline void
> +__sigfillset (sigset_t *set)
> +{
> + int cnt = __NSIG_WORDS;
> + while (--cnt >= 0)
> + set->__val[cnt] = ~0UL;
> +}
> +
> +static inline int
> +__sigisemptyset (const sigset_t *set)
> +{
> + int cnt = __NSIG_WORDS;
> + int ret = set->__val[--cnt];
> + while (ret == 0 && --cnt >= 0)
> + ret = set->__val[cnt];
> + return ret == 0;
> +}
> +
> +static inline void
> +__sigandset (sigset_t *dest, const sigset_t *left, const sigset_t *right)
> +{
> + int cnt = __NSIG_WORDS;
> + while (--cnt >= 0)
> + dest->__val[cnt] = left->__val[cnt] & right->__val[cnt];
> +}
> +
> +static inline void
> +__sigorset (sigset_t *dest, const sigset_t *left, const sigset_t *right)
> +{
> + int cnt = __NSIG_WORDS;
> + while (--cnt >= 0)
> + dest->__val[cnt] = left->__val[cnt] | right->__val[cnt];
> +}
> +
> +static inline int
> +__sigismember (const sigset_t *set, int sig)
> +{
> + unsigned long int mask = __sigmask (sig);
> + unsigned long int word = __sigword (sig);
> + return set->__val[word] & mask ? 1 : 0;
> +}
> +
> +static inline void
> +__sigaddset (sigset_t *set, int sig)
> +{
> + unsigned long int mask = __sigmask (sig);
> + unsigned long int word = __sigword (sig);
> + set->__val[word] |= mask;
> +}
> +
> +static inline void
> +__sigdelset (sigset_t *set, int sig)
> +{
> + unsigned long int mask = __sigmask (sig);
> + unsigned long int word = __sigword (sig);
> + set->__val[word] &= ~mask;
> +}
>
> #endif /* bits/sigsetops.h */
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc
2020-03-13 19:48 [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
` (3 preceding siblings ...)
2020-04-17 13:25 ` [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
@ 2020-04-21 11:50 ` Florian Weimer
2020-04-21 14:06 ` Adhemerval Zanella
4 siblings, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 11:50 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella via Libc-alpha:
> diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
> index 512b4c77c8..92c981c2d2 100644
> --- a/nptl/libpthread-compat.c
> +++ b/nptl/libpthread-compat.c
> @@ -36,6 +36,12 @@ __libpthread_version_placeholder (void)
> version or later, the placeholder symbol is not needed because
> there are plenty of other symbols which populate those later
> versions. */
> +
> +#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1))
> +compat_symbol_unique (libpthread,
> + __libpthread_version_placeholder, GLIBC_2_0);
> +#endif
> +
I do not think this is necessary yet because there are other symbols
which keep the version alive.
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index 06fb0d74c5..edec8d0501 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -482,6 +482,8 @@ extern void __pthread_testcancel (void);
> extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
> const struct timespec *, bool)
> attribute_hidden;
> +extern int __pthread_sigmask (int how, const sigset_t *newmask,
> + sigset_t *oldmask);
I suggest to drop it. It's not exported, and local users cannot call
it because it's not hidden (the usual check-localplt failure).
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist seems to
be missing from the abilist updates. Rest of the abilist changes look
okay to me.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread
2020-03-13 19:48 ` [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
@ 2020-04-21 11:56 ` Florian Weimer
2020-04-21 12:06 ` Adhemerval Zanella
1 sibling, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 11:56 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella via Libc-alpha:
> It is required because __libc_unwind_longjmp (used on thread
> cancellation) calls __sigprocmask. Replace with a direct call.
>
> The sigblock was never exported and thus unused.
Perhaps:
They are required because __libc_unwind_longjmp (used for thread
cancellation) calls __sigprocmask. Replace this with a direct call.
The sigblock function is not exported and is not used internally, so
it can be removed.
> Checked on cross build for ia64-linux-gnu.
I can put this through a build-many-glibcs.py run just to be sure
(once the first patch is ready as well), but change itself looks good
to me.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask
2020-03-13 19:48 ` [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
@ 2020-04-21 12:01 ` Florian Weimer
2020-04-21 12:30 ` Adhemerval Zanella
1 sibling, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 12:01 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella via Libc-alpha:
> With pthread_sigmask on libc.so, it allows consolidate both
> implementations.
“in sigprocmask”?
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index edec8d0501..c6d8fc69be 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -484,6 +484,7 @@ extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
> attribute_hidden;
> extern int __pthread_sigmask (int how, const sigset_t *newmask,
> sigset_t *oldmask);
> +libc_hidden_proto (__pthread_sigmask)
>
>
> #if IS_IN (libpthread)
> diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
> index 0e326d610c..c6c6e83c08 100644
> --- a/nptl/pthread_sigmask.c
> +++ b/nptl/pthread_sigmask.c
> @@ -46,6 +46,8 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
> ? INTERNAL_SYSCALL_ERRNO (result)
> : 0);
> }
> +libc_hidden_def (__pthread_sigmask)
> +
> versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32);
> #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
> strong_alias (__pthread_sigmask, __pthread_sigmask_2);
Ah, perhaps put this into the first commit?
> diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
> index eb9e4d5e83..6ed0ab1e6a 100644
> --- a/sysdeps/unix/sysv/linux/sigprocmask.c
> +++ b/sysdeps/unix/sysv/linux/sigprocmask.c
> + int result = __pthread_sigmask (how, set, oset);
> + if (result == 0)
> + return 0;
> + __set_errno (result);
> + return result;
The final statement needs to return -1. It's curious that this does
not result in a testsuite failure.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread
2020-04-21 11:56 ` Florian Weimer
@ 2020-04-21 12:06 ` Adhemerval Zanella
0 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 12:06 UTC (permalink / raw)
To: Florian Weimer, Adhemerval Zanella via Libc-alpha
On 21/04/2020 08:56, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> It is required because __libc_unwind_longjmp (used on thread
>> cancellation) calls __sigprocmask. Replace with a direct call.
>>
>> The sigblock was never exported and thus unused.
>
> Perhaps:
>
> They are required because __libc_unwind_longjmp (used for thread
> cancellation) calls __sigprocmask. Replace this with a direct call.
>
> The sigblock function is not exported and is not used internally, so
> it can be removed.
Ack, I have changed the commit message.
>
>
>> Checked on cross build for ia64-linux-gnu.
>
> I can put this through a build-many-glibcs.py run just to be sure
> (once the first patch is ready as well), but change itself looks good
> to me.
>
I will double check with a full build-many-glibcs.py as well.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask
2020-04-21 12:01 ` Florian Weimer
@ 2020-04-21 12:30 ` Adhemerval Zanella
2020-04-21 12:35 ` Florian Weimer
0 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 12:30 UTC (permalink / raw)
To: Florian Weimer, Adhemerval Zanella via Libc-alpha
On 21/04/2020 09:01, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> With pthread_sigmask on libc.so, it allows consolidate both
>> implementations.
>
> “in sigprocmask”?
Ack.
>
>> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
>> index edec8d0501..c6d8fc69be 100644
>> --- a/nptl/pthreadP.h
>> +++ b/nptl/pthreadP.h
>> @@ -484,6 +484,7 @@ extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
>> attribute_hidden;
>> extern int __pthread_sigmask (int how, const sigset_t *newmask,
>> sigset_t *oldmask);
>> +libc_hidden_proto (__pthread_sigmask)
>>
>>
>> #if IS_IN (libpthread)
>> diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
>> index 0e326d610c..c6c6e83c08 100644
>> --- a/nptl/pthread_sigmask.c
>> +++ b/nptl/pthread_sigmask.c
>> @@ -46,6 +46,8 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
>> ? INTERNAL_SYSCALL_ERRNO (result)
>> : 0);
>> }
>> +libc_hidden_def (__pthread_sigmask)
>> +
>> versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32);
>> #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
>> strong_alias (__pthread_sigmask, __pthread_sigmask_2);
>
> Ah, perhaps put this into the first commit?
Alright (although it just does require on this set).
>
>> diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
>> index eb9e4d5e83..6ed0ab1e6a 100644
>> --- a/sysdeps/unix/sysv/linux/sigprocmask.c
>> +++ b/sysdeps/unix/sysv/linux/sigprocmask.c
>
>> + int result = __pthread_sigmask (how, set, oset);
>> + if (result == 0)
>> + return 0;
>> + __set_errno (result);
>> + return result;
>
> The final statement needs to return -1. It's curious that this does
> not result in a testsuite failure.
>
Ack. I think because sigprocmask only fails for an invalid 'how'
(EINVAL) or invalid address (EFAULT) for 'set' or 'oldset', which
are not issued on glibc testsuite.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask
2020-04-21 12:30 ` Adhemerval Zanella
@ 2020-04-21 12:35 ` Florian Weimer
2020-04-21 13:01 ` Adhemerval Zanella
0 siblings, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 12:35 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella:
>>> diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
>>> index eb9e4d5e83..6ed0ab1e6a 100644
>>> --- a/sysdeps/unix/sysv/linux/sigprocmask.c
>>> +++ b/sysdeps/unix/sysv/linux/sigprocmask.c
>>
>>> + int result = __pthread_sigmask (how, set, oset);
>>> + if (result == 0)
>>> + return 0;
>>> + __set_errno (result);
>>> + return result;
>>
>> The final statement needs to return -1. It's curious that this does
>> not result in a testsuite failure.
>>
>
> Ack. I think because sigprocmask only fails for an invalid 'how'
> (EINVAL) or invalid address (EFAULT) for 'set' or 'oldset', which
> are not issued on glibc testsuite.
Maybe you can add another test to
sysdeps/unix/sysv/linux/test-errno-linux.c, just in case?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-03-13 19:48 ` [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657) Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
@ 2020-04-21 12:53 ` Florian Weimer
2020-04-21 13:11 ` Adhemerval Zanella
1 sibling, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 12:53 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella via Libc-alpha:
> The upper bits of the sigset_t s not fully initialized in the signal
> mask calls that return information from kernel (sigprocmask,
> sigpending, and pthread_sigmask), since the exported sigset_t size
> (1024 bits) is larger than Linux support one (64 or 128 bits).
> It might make sigisemptyset/sigorset/sigandset fail if the mask
> is filled prior the call.
>
> This patch changes the internal signal function to handle up to
> supported Linux signal number (_NSIG), the remaining bits are
> untouched.
Sorry, I have trouble what the intended outcome of this change is.
What is the expected behavior here? We have an overly large sigset_t,
but only signal numbers from 0 to NSIG - 1 (inclusive) are valid in
all function calls?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask
2020-04-21 12:35 ` Florian Weimer
@ 2020-04-21 13:01 ` Adhemerval Zanella
0 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 13:01 UTC (permalink / raw)
To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha
On 21/04/2020 09:35, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>>>> diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
>>>> index eb9e4d5e83..6ed0ab1e6a 100644
>>>> --- a/sysdeps/unix/sysv/linux/sigprocmask.c
>>>> +++ b/sysdeps/unix/sysv/linux/sigprocmask.c
>>>
>>>> + int result = __pthread_sigmask (how, set, oset);
>>>> + if (result == 0)
>>>> + return 0;
>>>> + __set_errno (result);
>>>> + return result;
>>>
>>> The final statement needs to return -1. It's curious that this does
>>> not result in a testsuite failure.
>>>
>>
>> Ack. I think because sigprocmask only fails for an invalid 'how'
>> (EINVAL) or invalid address (EFAULT) for 'set' or 'oldset', which
>> are not issued on glibc testsuite.
>
> Maybe you can add another test to
> sysdeps/unix/sysv/linux/test-errno-linux.c, just in case?
>
Ack. I will do it.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 12:53 ` Florian Weimer
@ 2020-04-21 13:11 ` Adhemerval Zanella
2020-04-21 13:14 ` Florian Weimer
0 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 13:11 UTC (permalink / raw)
To: Florian Weimer, Adhemerval Zanella via Libc-alpha
On 21/04/2020 09:53, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> The upper bits of the sigset_t s not fully initialized in the signal
>> mask calls that return information from kernel (sigprocmask,
>> sigpending, and pthread_sigmask), since the exported sigset_t size
>> (1024 bits) is larger than Linux support one (64 or 128 bits).
>> It might make sigisemptyset/sigorset/sigandset fail if the mask
>> is filled prior the call.
>>
>> This patch changes the internal signal function to handle up to
>> supported Linux signal number (_NSIG), the remaining bits are
>> untouched.
>
> Sorry, I have trouble what the intended outcome of this change is.
>
> What is the expected behavior here? We have an overly large sigset_t,
> but only signal numbers from 0 to NSIG - 1 (inclusive) are valid in
> all function calls?
>
The bug report link to a stackoverflow example, which simplified is:
#define _GNU_SOURCE
#include <stdio.h>
#include <signal.h>
int
main (int argc, char *argv[])
{
sigset_t set;
sigfillset (&set);
sigprocmask (SIG_BLOCK, NULL, &set);
printf ("%d\n", sigisemptyset (&set));
return 0;
}
The main issue is GNU extensions sigisemptyset/sigorset/sigandset
operates on full internal signal bits where kernel only updates
up to _NSIG signals.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 13:11 ` Adhemerval Zanella
@ 2020-04-21 13:14 ` Florian Weimer
2020-04-21 13:29 ` Adhemerval Zanella
0 siblings, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 13:14 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella:
> On 21/04/2020 09:53, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>>
>>> The upper bits of the sigset_t s not fully initialized in the signal
>>> mask calls that return information from kernel (sigprocmask,
>>> sigpending, and pthread_sigmask), since the exported sigset_t size
>>> (1024 bits) is larger than Linux support one (64 or 128 bits).
>>> It might make sigisemptyset/sigorset/sigandset fail if the mask
>>> is filled prior the call.
>>>
>>> This patch changes the internal signal function to handle up to
>>> supported Linux signal number (_NSIG), the remaining bits are
>>> untouched.
>>
>> Sorry, I have trouble what the intended outcome of this change is.
>>
>> What is the expected behavior here? We have an overly large sigset_t,
>> but only signal numbers from 0 to NSIG - 1 (inclusive) are valid in
>> all function calls?
>>
>
> The bug report link to a stackoverflow example, which simplified is:
>
> #define _GNU_SOURCE
> #include <stdio.h>
> #include <signal.h>
> int
> main (int argc, char *argv[])
> {
> sigset_t set;
> sigfillset (&set);
> sigprocmask (SIG_BLOCK, NULL, &set);
> printf ("%d\n", sigisemptyset (&set));
> return 0;
> }
>
> The main issue is GNU extensions sigisemptyset/sigorset/sigandset
> operates on full internal signal bits where kernel only updates
> up to _NSIG signals.
I get that, but what do you want to do to fix it?
It's not entirely clear from the changes in the patch.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 13:14 ` Florian Weimer
@ 2020-04-21 13:29 ` Adhemerval Zanella
2020-04-21 13:47 ` Florian Weimer
0 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 13:29 UTC (permalink / raw)
To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha
On 21/04/2020 10:14, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> On 21/04/2020 09:53, Florian Weimer wrote:
>>> * Adhemerval Zanella via Libc-alpha:
>>>
>>>> The upper bits of the sigset_t s not fully initialized in the signal
>>>> mask calls that return information from kernel (sigprocmask,
>>>> sigpending, and pthread_sigmask), since the exported sigset_t size
>>>> (1024 bits) is larger than Linux support one (64 or 128 bits).
>>>> It might make sigisemptyset/sigorset/sigandset fail if the mask
>>>> is filled prior the call.
>>>>
>>>> This patch changes the internal signal function to handle up to
>>>> supported Linux signal number (_NSIG), the remaining bits are
>>>> untouched.
>>>
>>> Sorry, I have trouble what the intended outcome of this change is.
>>>
>>> What is the expected behavior here? We have an overly large sigset_t,
>>> but only signal numbers from 0 to NSIG - 1 (inclusive) are valid in
>>> all function calls?
>>>
>>
>> The bug report link to a stackoverflow example, which simplified is:
>>
>> #define _GNU_SOURCE
>> #include <stdio.h>
>> #include <signal.h>
>> int
>> main (int argc, char *argv[])
>> {
>> sigset_t set;
>> sigfillset (&set);
>> sigprocmask (SIG_BLOCK, NULL, &set);
>> printf ("%d\n", sigisemptyset (&set));
>> return 0;
>> }
>>
>> The main issue is GNU extensions sigisemptyset/sigorset/sigandset
>> operates on full internal signal bits where kernel only updates
>> up to _NSIG signals.
>
> I get that, but what do you want to do to fix it?
>
> It's not entirely clear from the changes in the patch.
>
Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
when manipulating sigset_t masks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 13:29 ` Adhemerval Zanella
@ 2020-04-21 13:47 ` Florian Weimer
2020-04-21 14:02 ` Adhemerval Zanella
0 siblings, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 13:47 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella:
> On 21/04/2020 10:14, Florian Weimer wrote:
> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
> when manipulating sigset_t masks.
Hmm. __NSIG_WORDS is defined like this:
> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
This gives us two words for _NSIG == 65. Is this correct?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 13:47 ` Florian Weimer
@ 2020-04-21 14:02 ` Adhemerval Zanella
2020-04-21 14:07 ` Florian Weimer
0 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 14:02 UTC (permalink / raw)
To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha
On 21/04/2020 10:47, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> On 21/04/2020 10:14, Florian Weimer wrote:
>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>> when manipulating sigset_t masks.
>
> Hmm. __NSIG_WORDS is defined like this:
>
>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>
> This gives us two words for _NSIG == 65. Is this correct?
>
Two words (32-bits) for all 64-bit architectures, except mips64 that
defined _NSIG as 128 as requires 4 words. And 4 words for all 32-bit
architectures and 8 for mips32.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc
2020-04-21 11:50 ` Florian Weimer
@ 2020-04-21 14:06 ` Adhemerval Zanella
0 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 14:06 UTC (permalink / raw)
To: Florian Weimer, Adhemerval Zanella via Libc-alpha
On 21/04/2020 08:50, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
>> index 512b4c77c8..92c981c2d2 100644
>> --- a/nptl/libpthread-compat.c
>> +++ b/nptl/libpthread-compat.c
>> @@ -36,6 +36,12 @@ __libpthread_version_placeholder (void)
>> version or later, the placeholder symbol is not needed because
>> there are plenty of other symbols which populate those later
>> versions. */
>> +
>> +#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1))
>> +compat_symbol_unique (libpthread,
>> + __libpthread_version_placeholder, GLIBC_2_0);
>> +#endif
>> +
>
> I do not think this is necessary yet because there are other symbols
> which keep the version alive.
I don't have a strong preference here, I added just to be future proof.
I have removed it.
>
>> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
>> index 06fb0d74c5..edec8d0501 100644
>> --- a/nptl/pthreadP.h
>> +++ b/nptl/pthreadP.h
>> @@ -482,6 +482,8 @@ extern void __pthread_testcancel (void);
>> extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
>> const struct timespec *, bool)
>> attribute_hidden;
>> +extern int __pthread_sigmask (int how, const sigset_t *newmask,
>> + sigset_t *oldmask);
>
> I suggest to drop it. It's not exported, and local users cannot call
> it because it's not hidden (the usual check-localplt failure).
Alright, will the required symbol in the patch that sets sigprocmask
to use pthread_sigmask.
>
> sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist seems to
> be missing from the abilist updates. Rest of the abilist changes look
> okay to me.
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 14:02 ` Adhemerval Zanella
@ 2020-04-21 14:07 ` Florian Weimer
2020-04-21 14:10 ` Adhemerval Zanella
0 siblings, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 14:07 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella:
> On 21/04/2020 10:47, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>> when manipulating sigset_t masks.
>>
>> Hmm. __NSIG_WORDS is defined like this:
>>
>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>
>> This gives us two words for _NSIG == 65. Is this correct?
>
> Two words (32-bits) for all 64-bit architectures,
sizeof (unsigned long int) is 8 on 64-bit. 65 / (8 * 8) is 1.
I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
valid and can be manipulated using sigaddset etc. This suggests to me
that we need three 32-bit longs and two 64-bit longs.
Sorry, maybe I'm confused, I'm not feeling too well this week.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 14:07 ` Florian Weimer
@ 2020-04-21 14:10 ` Adhemerval Zanella
2020-04-21 14:35 ` Florian Weimer
2020-04-21 15:05 ` Andreas Schwab
0 siblings, 2 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 14:10 UTC (permalink / raw)
To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha
On 21/04/2020 11:07, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> On 21/04/2020 10:47, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>>> when manipulating sigset_t masks.
>>>
>>> Hmm. __NSIG_WORDS is defined like this:
>>>
>>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>>
>>> This gives us two words for _NSIG == 65. Is this correct?
>>
>> Two words (32-bits) for all 64-bit architectures,
>
> sizeof (unsigned long int) is 8 on 64-bit. 65 / (8 * 8) is 1.
>
> I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
> valid and can be manipulated using sigaddset etc. This suggests to me
> that we need three 32-bit longs and two 64-bit longs.
Indeed my mistake here, I was reading the value as the required words
the maximum accessed index.
>
> Sorry, maybe I'm confused, I'm not feeling too well this week.
>
I hope you get better soon.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 14:10 ` Adhemerval Zanella
@ 2020-04-21 14:35 ` Florian Weimer
2020-04-21 14:36 ` Adhemerval Zanella
2020-04-21 15:05 ` Andreas Schwab
1 sibling, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 14:35 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella:
> On 21/04/2020 11:07, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> On 21/04/2020 10:47, Florian Weimer wrote:
>>>> * Adhemerval Zanella:
>>>>
>>>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>>>> when manipulating sigset_t masks.
>>>>
>>>> Hmm. __NSIG_WORDS is defined like this:
>>>>
>>>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>>>
>>>> This gives us two words for _NSIG == 65. Is this correct?
>>>
>>> Two words (32-bits) for all 64-bit architectures,
>>
>> sizeof (unsigned long int) is 8 on 64-bit. 65 / (8 * 8) is 1.
>>
>> I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
>> valid and can be manipulated using sigaddset etc. This suggests to me
>> that we need three 32-bit longs and two 64-bit longs.
>
> Indeed my mistake here, I was reading the value as the required words
> the maximum accessed index.
Ahh. Please put also a comment into sigsetops.h how this is supposed
to work, that is, which signal numbers are expected to be valid.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 14:35 ` Florian Weimer
@ 2020-04-21 14:36 ` Adhemerval Zanella
0 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 14:36 UTC (permalink / raw)
To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha
On 21/04/2020 11:35, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> On 21/04/2020 11:07, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> On 21/04/2020 10:47, Florian Weimer wrote:
>>>>> * Adhemerval Zanella:
>>>>>
>>>>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>>>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>>>>> when manipulating sigset_t masks.
>>>>>
>>>>> Hmm. __NSIG_WORDS is defined like this:
>>>>>
>>>>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>>>>
>>>>> This gives us two words for _NSIG == 65. Is this correct?
>>>>
>>>> Two words (32-bits) for all 64-bit architectures,
>>>
>>> sizeof (unsigned long int) is 8 on 64-bit. 65 / (8 * 8) is 1.
>>>
>>> I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
>>> valid and can be manipulated using sigaddset etc. This suggests to me
>>> that we need three 32-bit longs and two 64-bit longs.
>>
>> Indeed my mistake here, I was reading the value as the required words
>> the maximum accessed index.
>
> Ahh. Please put also a comment into sigsetops.h how this is supposed
> to work, that is, which signal numbers are expected to be valid.
>
Alright. I will do it.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 14:10 ` Adhemerval Zanella
2020-04-21 14:35 ` Florian Weimer
@ 2020-04-21 15:05 ` Andreas Schwab
2020-04-21 17:28 ` Florian Weimer
1 sibling, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2020-04-21 15:05 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha; +Cc: Florian Weimer, Adhemerval Zanella
On Apr 21 2020, Adhemerval Zanella via Libc-alpha wrote:
> On 21/04/2020 11:07, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> On 21/04/2020 10:47, Florian Weimer wrote:
>>>> * Adhemerval Zanella:
>>>>
>>>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>>>> when manipulating sigset_t masks.
>>>>
>>>> Hmm. __NSIG_WORDS is defined like this:
>>>>
>>>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>>>
>>>> This gives us two words for _NSIG == 65. Is this correct?
>>>
>>> Two words (32-bits) for all 64-bit architectures,
>>
>> sizeof (unsigned long int) is 8 on 64-bit. 65 / (8 * 8) is 1.
>>
>> I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
>> valid and can be manipulated using sigaddset etc. This suggests to me
>> that we need three 32-bit longs and two 64-bit longs.
>
> Indeed my mistake here, I was reading the value as the required words
> the maximum accessed index.
Note that signal numbers are 1-based, and bit 0 of a signal mask is for
signal 1.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 15:05 ` Andreas Schwab
@ 2020-04-21 17:28 ` Florian Weimer
2020-04-21 17:49 ` Adhemerval Zanella
0 siblings, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-21 17:28 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Adhemerval Zanella via Libc-alpha, Adhemerval Zanella
* Andreas Schwab:
> On Apr 21 2020, Adhemerval Zanella via Libc-alpha wrote:
>
>> On 21/04/2020 11:07, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> On 21/04/2020 10:47, Florian Weimer wrote:
>>>>> * Adhemerval Zanella:
>>>>>
>>>>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>>>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>>>>> when manipulating sigset_t masks.
>>>>>
>>>>> Hmm. __NSIG_WORDS is defined like this:
>>>>>
>>>>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>>>>
>>>>> This gives us two words for _NSIG == 65. Is this correct?
>>>>
>>>> Two words (32-bits) for all 64-bit architectures,
>>>
>>> sizeof (unsigned long int) is 8 on 64-bit. 65 / (8 * 8) is 1.
>>>
>>> I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
>>> valid and can be manipulated using sigaddset etc. This suggests to me
>>> that we need three 32-bit longs and two 64-bit longs.
>>
>> Indeed my mistake here, I was reading the value as the required words
>> the maximum accessed index.
>
> Note that signal numbers are 1-based, and bit 0 of a signal mask is for
> signal 1.
Right, all the more reason to spell this out in a top-level comment in
the header file.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 17:28 ` Florian Weimer
@ 2020-04-21 17:49 ` Adhemerval Zanella
2020-04-21 18:40 ` Andreas Schwab
0 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 17:49 UTC (permalink / raw)
To: Florian Weimer, Andreas Schwab; +Cc: Adhemerval Zanella via Libc-alpha
On 21/04/2020 14:28, Florian Weimer wrote:
> * Andreas Schwab:
>
>> On Apr 21 2020, Adhemerval Zanella via Libc-alpha wrote:
>>
>>> On 21/04/2020 11:07, Florian Weimer wrote:
>>>> * Adhemerval Zanella:
>>>>
>>>>> On 21/04/2020 10:47, Florian Weimer wrote:
>>>>>> * Adhemerval Zanella:
>>>>>>
>>>>>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>>>>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>>>>>> when manipulating sigset_t masks.
>>>>>>
>>>>>> Hmm. __NSIG_WORDS is defined like this:
>>>>>>
>>>>>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>>>>>
>>>>>> This gives us two words for _NSIG == 65. Is this correct?
>>>>>
>>>>> Two words (32-bits) for all 64-bit architectures,
>>>>
>>>> sizeof (unsigned long int) is 8 on 64-bit. 65 / (8 * 8) is 1.
>>>>
>>>> I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
>>>> valid and can be manipulated using sigaddset etc. This suggests to me
>>>> that we need three 32-bit longs and two 64-bit longs.
>>>
>>> Indeed my mistake here, I was reading the value as the required words
>>> the maximum accessed index.
>>
>> Note that signal numbers are 1-based, and bit 0 of a signal mask is for
>> signal 1.
>
> Right, all the more reason to spell this out in a top-level comment in
> the header file.
>
I have added the following comment on linux sigsetopts.h:
/* Linux sig* functions only handle up to __NSIG_WORDS words instead of
full _SIGSET_NWORDS sigset size. The signal numbers are 1-based, and
bit 0 of a signal mask is for signal 1. */
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 17:49 ` Adhemerval Zanella
@ 2020-04-21 18:40 ` Andreas Schwab
2020-04-21 19:00 ` Adhemerval Zanella
0 siblings, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2020-04-21 18:40 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Florian Weimer, Adhemerval Zanella via Libc-alpha
On Apr 21 2020, Adhemerval Zanella wrote:
> I have added the following comment on linux sigsetopts.h:
>
> /* Linux sig* functions only handle up to __NSIG_WORDS words instead of
> full _SIGSET_NWORDS sigset size. The signal numbers are 1-based, and
> bit 0 of a signal mask is for signal 1. */
You forgot to fix __NSIG_WORDS.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 18:40 ` Andreas Schwab
@ 2020-04-21 19:00 ` Adhemerval Zanella
2020-04-21 21:14 ` Andreas Schwab
0 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-21 19:00 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Florian Weimer, Adhemerval Zanella via Libc-alpha
On 21/04/2020 15:40, Andreas Schwab wrote:
> On Apr 21 2020, Adhemerval Zanella wrote:
>
>> I have added the following comment on linux sigsetopts.h:
>>
>> /* Linux sig* functions only handle up to __NSIG_WORDS words instead of
>> full _SIGSET_NWORDS sigset size. The signal numbers are 1-based, and
>> bit 0 of a signal mask is for signal 1. */
>
> You forgot to fix __NSIG_WORDS.
Hum what exactly? I missing to see what might be missing here. Is the
related to comment or the __NSIG_WORDS value itself?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 19:00 ` Adhemerval Zanella
@ 2020-04-21 21:14 ` Andreas Schwab
2020-04-22 8:32 ` Florian Weimer
0 siblings, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2020-04-21 21:14 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Florian Weimer, Adhemerval Zanella via Libc-alpha
On Apr 21 2020, Adhemerval Zanella wrote:
> On 21/04/2020 15:40, Andreas Schwab wrote:
>> On Apr 21 2020, Adhemerval Zanella wrote:
>>
>>> I have added the following comment on linux sigsetopts.h:
>>>
>>> /* Linux sig* functions only handle up to __NSIG_WORDS words instead of
>>> full _SIGSET_NWORDS sigset size. The signal numbers are 1-based, and
>>> bit 0 of a signal mask is for signal 1. */
>>
>> You forgot to fix __NSIG_WORDS.
>
> Hum what exactly? I missing to see what might be missing here. Is the
> related to comment or the __NSIG_WORDS value itself?
The problem really is that _NSIG is bogus, it is actually the number of
signals plus one. That doesn't change the value of __NSIG_WORDS, but if
there would actually be 65 signals then __NSIG_WORDS would be too small.
Note also that mips has the wrong value for __SIGRTMAX (it should be
128).
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-21 21:14 ` Andreas Schwab
@ 2020-04-22 8:32 ` Florian Weimer
2020-04-22 11:34 ` Adhemerval Zanella
0 siblings, 1 reply; 34+ messages in thread
From: Florian Weimer @ 2020-04-22 8:32 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: Andreas Schwab, Adhemerval Zanella via Libc-alpha
* Andreas Schwab:
> On Apr 21 2020, Adhemerval Zanella wrote:
>
>> On 21/04/2020 15:40, Andreas Schwab wrote:
>>> On Apr 21 2020, Adhemerval Zanella wrote:
>>>
>>>> I have added the following comment on linux sigsetopts.h:
>>>>
>>>> /* Linux sig* functions only handle up to __NSIG_WORDS words instead of
>>>> full _SIGSET_NWORDS sigset size. The signal numbers are 1-based, and
>>>> bit 0 of a signal mask is for signal 1. */
>>>
>>> You forgot to fix __NSIG_WORDS.
>>
>> Hum what exactly? I missing to see what might be missing here. Is the
>> related to comment or the __NSIG_WORDS value itself?
>
> The problem really is that _NSIG is bogus, it is actually the number of
> signals plus one. That doesn't change the value of __NSIG_WORDS, but if
> there would actually be 65 signals then __NSIG_WORDS would be too small.
>
> Note also that mips has the wrong value for __SIGRTMAX (it should be
> 128).
Adhemerval, if you address this, please also fix these whitespace
issue:
+# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
(Space before define (it's not nested) and after “unsigned long int”.)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)
2020-04-22 8:32 ` Florian Weimer
@ 2020-04-22 11:34 ` Adhemerval Zanella
0 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2020-04-22 11:34 UTC (permalink / raw)
To: Florian Weimer; +Cc: Andreas Schwab, Adhemerval Zanella via Libc-alpha
> Il giorno 22 apr 2020, alle ore 05:32, Florian Weimer <fw@deneb.enyo.de> ha scritto:
>
> * Andreas Schwab:
>
>>> On Apr 21 2020, Adhemerval Zanella wrote:
>>>
>>> On 21/04/2020 15:40, Andreas Schwab wrote:
>>>> On Apr 21 2020, Adhemerval Zanella wrote:
>>>>
>>>>> I have added the following comment on linux sigsetopts.h:
>>>>>
>>>>> /* Linux sig* functions only handle up to __NSIG_WORDS words instead of
>>>>> full _SIGSET_NWORDS sigset size. The signal numbers are 1-based, and
>>>>> bit 0 of a signal mask is for signal 1. */
>>>>
>>>> You forgot to fix __NSIG_WORDS.
>>>
>>> Hum what exactly? I missing to see what might be missing here. Is the
>>> related to comment or the __NSIG_WORDS value itself?
>>
>> The problem really is that _NSIG is bogus, it is actually the number of
>> signals plus one. That doesn't change the value of __NSIG_WORDS, but if
>> there would actually be 65 signals then __NSIG_WORDS would be too small.
>>
>> Note also that mips has the wrong value for __SIGRTMAX (it should be
>> 128).
>
> Adhemerval, if you address this, please also fix these whitespace
> issue:
>
> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>
> (Space before define (it's not nested) and after “unsigned long int”.)
I will check this out.
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2020-04-22 11:34 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 19:48 [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
2020-03-13 19:48 ` [PATCH 2/4] ia64: Remove sigprocmask/sigblock objects from libpthread Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 11:56 ` Florian Weimer
2020-04-21 12:06 ` Adhemerval Zanella
2020-03-13 19:48 ` [PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 12:01 ` Florian Weimer
2020-04-21 12:30 ` Adhemerval Zanella
2020-04-21 12:35 ` Florian Weimer
2020-04-21 13:01 ` Adhemerval Zanella
2020-03-13 19:48 ` [PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657) Adhemerval Zanella
2020-04-17 13:25 ` Adhemerval Zanella
2020-04-21 12:53 ` Florian Weimer
2020-04-21 13:11 ` Adhemerval Zanella
2020-04-21 13:14 ` Florian Weimer
2020-04-21 13:29 ` Adhemerval Zanella
2020-04-21 13:47 ` Florian Weimer
2020-04-21 14:02 ` Adhemerval Zanella
2020-04-21 14:07 ` Florian Weimer
2020-04-21 14:10 ` Adhemerval Zanella
2020-04-21 14:35 ` Florian Weimer
2020-04-21 14:36 ` Adhemerval Zanella
2020-04-21 15:05 ` Andreas Schwab
2020-04-21 17:28 ` Florian Weimer
2020-04-21 17:49 ` Adhemerval Zanella
2020-04-21 18:40 ` Andreas Schwab
2020-04-21 19:00 ` Adhemerval Zanella
2020-04-21 21:14 ` Andreas Schwab
2020-04-22 8:32 ` Florian Weimer
2020-04-22 11:34 ` Adhemerval Zanella
2020-04-17 13:25 ` [PATCH v2 1/4] nptl: Move pthread_sigmask implementation to libc Adhemerval Zanella
2020-04-21 11:50 ` Florian Weimer
2020-04-21 14:06 ` Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).