aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/pthread/Makefile
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-09-13 11:06:08 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-09-13 13:38:51 +0200
commit3abf3bd4edc86fb28c099cc85203cb46a811e0b8 (patch)
treec67ae925c14c1ce729058dec958c67c5145554a9 /sysdeps/pthread/Makefile
parentaddc9d62d61eea790a35328cbfce53333a07bd3e (diff)
downloadglibc-3abf3bd4edc86fb28c099cc85203cb46a811e0b8.tar.xz
glibc-3abf3bd4edc86fb28c099cc85203cb46a811e0b8.zip
nptl: pthread_kill, pthread_cancel should not fail after exit (bug 19193)
This closes one remaining race condition related to bug 12889: if the thread already exited on the kernel side, returning ESRCH is not correct because that error is reserved for the thread IDs (pthread_t values) whose lifetime has ended. In case of a kernel-side exit and a valid thread ID, no signal needs to be sent and cancellation does not have an effect, so just return 0. sysdeps/pthread/tst-kill4.c triggers undefined behavior and is removed with this commit. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> (cherry picked from commit 8af8456004edbab71f8903a60a3cae442cf6fe69)
Diffstat (limited to 'sysdeps/pthread/Makefile')
-rw-r--r--sysdeps/pthread/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index 42f9fc5072..dedfa0d290 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -89,7 +89,7 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
tst-join8 tst-join9 tst-join10 tst-join11 tst-join12 tst-join13 \
tst-join14 tst-join15 \
tst-key1 tst-key2 tst-key3 tst-key4 \
- tst-kill1 tst-kill2 tst-kill3 tst-kill4 tst-kill5 tst-kill6 \
+ tst-kill1 tst-kill2 tst-kill3 tst-kill5 tst-kill6 \
tst-locale1 tst-locale2 \
tst-memstream \
tst-mutex-errorcheck tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 \
@@ -118,6 +118,9 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
tst-unload \
tst-unwind-thread \
tst-pt-vfork1 tst-pt-vfork2 tst-vfork1x tst-vfork2x \
+ tst-pthread_cancel-exited \
+ tst-pthread_kill-exited \
+ # tests
tests-time64 := \
tst-abstime-time64 \