From patchwork Mon Dec 7 21:27:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41330 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 487C43896807; Mon, 7 Dec 2020 21:28:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 487C43896807 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376487; bh=3vQKv453aKDJ++ml5Jbl8mhmd9ip8QsRLHMpqEbibQ4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=xKby2kg71lnejOjE5kVlDPJkkdmc24MQOT40SNGJ5+TrXfjVxAz6sK3Q1k/y66V7f WghcivwOqJoGDSs1p9tyR3/H+uUVKo6XWYNcMoAWMXG2IO5oLMqgxhmn+/XOybeTIe a6Mn8lwZP2wNi3/ba9KJSiAEZ3wzddtFy50QyhLs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by sourceware.org (Postfix) with ESMTPS id 72D9B385782A for ; Mon, 7 Dec 2020 21:28:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 72D9B385782A Received: by mail-qv1-xf42.google.com with SMTP id n9so7299015qvp.5 for ; Mon, 07 Dec 2020 13:28:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3vQKv453aKDJ++ml5Jbl8mhmd9ip8QsRLHMpqEbibQ4=; b=rDRzolyhy7xkojNHlfVV1ZjzYfdtO3wondvS/dpIKfcH+4tM40glrPCxWQbzROBud+ Ha7H3JbughkH8tXnXye7mL72oqI1ByTPvMIArIouTgnE8VQOVi4GYEWeTp0DgOnvBrkI Zm9Dsgg1wyj03UCrTUwUCdWb8E0K3Pk3WUkNpaDlkn1SSvoMAkEQMouus04IFUvC5BK3 A551K++nx93XUIUzZBrDVec28R2osuzUrMxc1cXoo3Ecenckk9f09E3HDJ1RP8QX8kD0 MQSPuZnNEQ7dKMun8f1ot5T8XjUN9bK1ov0EUhiqssmR9J/Z8QbUaE+M4oU4rX3oe1pR GgFA== X-Gm-Message-State: AOAM5329u3NOsI7LbJCudfJ3UfQplanVooifmdfj5ri43SIBKHai5NB1 NJ4wOd8xw9G4ITgw2vXOzW9SYaCA9ML0+g== X-Google-Smtp-Source: ABdhPJxbcb2EZRdjJ2iHOCm0otidrm3+i9CS7AYnM/my69K2Ho5NoIVVQlSDfgsJ5ygk6lENrton/Q== X-Received: by 2002:a05:6214:aa1:: with SMTP id ew1mr22548253qvb.55.1607376482699; Mon, 07 Dec 2020 13:28:02 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:02 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 1/8] nptl: Move Linux pthread_kill to nptl Date: Mon, 7 Dec 2020 18:27:50 -0300 Message-Id: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The nptl already expects a Linux syscall internally. Also __is_internal_signal is used and the DEBUGGING_P check is removed. Checked on x86_64-linux-gnu. --- nptl/pthread_kill.c | 28 ++++++++----- sysdeps/unix/sysv/linux/pthread_kill.c | 57 -------------------------- 2 files changed, 18 insertions(+), 67 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/pthread_kill.c diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index 73144a07ec..7ef68d1572 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -1,4 +1,4 @@ -/* Send a signal to a specific pthread. Stub version. +/* Send a signal to a specific pthread. Linux version. Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,23 +16,31 @@ License along with the GNU C Library; if not, see . */ -#include -#include +#include #include - int __pthread_kill (pthread_t threadid, int signo) { + /* Disallow sending the signal we use for cancellation, timers, + for the setxid implementation. */ + if (__is_internal_signal (signo)) + return EINVAL; + + /* Force load of pd->tid into local variable or register. Otherwise + if a thread exits between ESRCH test and tgkill, we might return + EINVAL, because pd->tid would be cleared by the kernel. */ struct pthread *pd = (struct pthread *) threadid; - - /* Make sure the descriptor is valid. */ - if (DEBUGGING_P && INVALID_TD_P (pd)) + pid_t tid = atomic_forced_read (pd->tid); + if (__glibc_unlikely (tid <= 0)) /* Not a valid thread handle. */ return ESRCH; - return ENOSYS; + /* We have a special syscall to do the work. */ + pid_t pid = __getpid (); + + int val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); + return (INTERNAL_SYSCALL_ERROR_P (val) + ? INTERNAL_SYSCALL_ERRNO (val) : 0); } strong_alias (__pthread_kill, pthread_kill) - -stub_warning (pthread_kill) diff --git a/sysdeps/unix/sysv/linux/pthread_kill.c b/sysdeps/unix/sysv/linux/pthread_kill.c deleted file mode 100644 index 4dfe08ffcd..0000000000 --- a/sysdeps/unix/sysv/linux/pthread_kill.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. - - 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 - . */ - -#include -#include -#include -#include -#include -#include - - -int -__pthread_kill (pthread_t threadid, int signo) -{ - struct pthread *pd = (struct pthread *) threadid; - - /* Make sure the descriptor is valid. */ - if (DEBUGGING_P && INVALID_TD_P (pd)) - /* Not a valid thread handle. */ - return ESRCH; - - /* Force load of pd->tid into local variable or register. Otherwise - if a thread exits between ESRCH test and tgkill, we might return - EINVAL, because pd->tid would be cleared by the kernel. */ - pid_t tid = atomic_forced_read (pd->tid); - if (__glibc_unlikely (tid <= 0)) - /* Not a valid thread handle. */ - return ESRCH; - - /* Disallow sending the signal we use for cancellation, timers, - for the setxid implementation. */ - if (signo == SIGCANCEL || signo == SIGTIMER || signo == SIGSETXID) - return EINVAL; - - /* We have a special syscall to do the work. */ - pid_t pid = __getpid (); - - int val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); - return (INTERNAL_SYSCALL_ERROR_P (val) - ? INTERNAL_SYSCALL_ERRNO (val) : 0); -} -strong_alias (__pthread_kill, pthread_kill) From patchwork Mon Dec 7 21:27:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41332 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D846B3945062; Mon, 7 Dec 2020 21:28:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D846B3945062 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376491; bh=CNEThlXe3LpZgXGshB6ihkWwYs3vsJ0X4CiXvGs6EJA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=X984+9eFxWTdDz77b59fFJDOZbuKQU3PY2pslw6vFsC1f4o+huUKts2CPOf7S6WaM glxEvG3jbaZWi/qEuS6I9cLXQVbxZirI30IEVZvYYE7bRh2V1ZBN5w7HoQa2yMPrrs Im7TEdx4YdeSM4SMOzqMOPQ4RfDv2qCVk0LyME08= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by sourceware.org (Postfix) with ESMTPS id 3CF15386188D for ; Mon, 7 Dec 2020 21:28:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3CF15386188D Received: by mail-qv1-xf2b.google.com with SMTP id l7so1924396qvt.4 for ; Mon, 07 Dec 2020 13:28:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CNEThlXe3LpZgXGshB6ihkWwYs3vsJ0X4CiXvGs6EJA=; b=Pj797Ee9UhQtWQRf1dq+KGx2Ypv5an3ednNdJKFn1xJ6/ICusNHB1MRQMyWB1bVGGi ITc8QBFzv7cZVgwNpM0C/qsl0WVtBQunSDDCeRZsuB1dMt4iWKF7+tNwDLQ2Rc5yavq7 4LWBtrrmzWOBbEamaCzjlOWR+gHLINuDID54lRIoEdIvuPQiaAD7fC+eMoK4ZHhsIa4c qEvRFJ9wMNs/TGbAmyQnua6O0IqAvFZf/kqHyM0O1uh13ylqCMoXiiaWXVzwwaK1HR9W 9hZ34PmstzRLPJkcDM7H+TFWzZgSjlRhMFaoSelF6DAtG/FHdEDJouAWQ4Bh++KdwdoS SrNw== X-Gm-Message-State: AOAM533zR0lIUMy4ZWpDQ0kfTxUBtB67IDExY8oQcTNjmWf6GUghG+v4 Joj5WacBlOk5yhrt7fIg1jpRsSIKW0xqlQ== X-Google-Smtp-Source: ABdhPJwkFNre08tIYl/GW3jSqVjw7lmTYGRp1OefUE71BO9lzK3bC4A0L9dwDW3ISaBrnF5GCd50KQ== X-Received: by 2002:ad4:55c2:: with SMTP id bt2mr23770485qvb.48.1607376484939; Mon, 07 Dec 2020 13:28:04 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:04 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 2/8] nptl: Move pthread_kill to libc Date: Mon, 7 Dec 2020 18:27:51 -0300 Message-Id: <20201207212757.3948164-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> References: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from previous version: * Removed __libpthread_version_placeholder for GLIBC 2.0 --- Checke on x86_64-linux-gnu. --- nptl/Makefile | 3 ++- nptl/Versions | 1 + sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/aarch64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arc/libc.abilist | 1 + sysdeps/unix/sysv/linux/arc/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/csky/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist | 1 + sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/microblaze/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/microblaze/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist | 1 + sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist | 1 + sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist | 1 + .../unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist | 1 + .../unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist | 1 + sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist | 1 + sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist | 1 - 63 files changed, 35 insertions(+), 30 deletions(-) diff --git a/nptl/Makefile b/nptl/Makefile index ddd83dfbdd..3f6e77f63f 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -65,6 +65,7 @@ routines = \ pthread_getaffinity \ pthread_getattr_np \ pthread_getschedparam \ + pthread_kill \ pthread_self \ pthread_setschedparam \ pthread_sigmask \ @@ -131,7 +132,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_kill pthread_sigqueue \ + pthread_sigqueue \ pthread_cancel pthread_testcancel \ pthread_setcancelstate pthread_setcanceltype \ pthread_once \ diff --git a/nptl/Versions b/nptl/Versions index 02650fe91c..7cfe39a91c 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -12,6 +12,7 @@ libc { pthread_cond_timedwait; pthread_equal; pthread_exit; pthread_getschedparam; pthread_setschedparam; + pthread_kill; pthread_mutex_destroy; pthread_mutex_init; pthread_mutex_lock; pthread_mutex_unlock; pthread_self; diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 4cc1c6a591..9bd30091b2 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -1442,6 +1442,7 @@ GLIBC_2.17 pthread_exit F GLIBC_2.17 pthread_getaffinity_np F GLIBC_2.17 pthread_getattr_np F GLIBC_2.17 pthread_getschedparam F +GLIBC_2.17 pthread_kill F GLIBC_2.17 pthread_mutex_destroy F GLIBC_2.17 pthread_mutex_init F GLIBC_2.17 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist index c6b4ea2dc1..18f2b38dca 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist @@ -102,7 +102,6 @@ GLIBC_2.17 pthread_getspecific F GLIBC_2.17 pthread_join F GLIBC_2.17 pthread_key_create F GLIBC_2.17 pthread_key_delete F -GLIBC_2.17 pthread_kill F GLIBC_2.17 pthread_kill_other_threads_np F GLIBC_2.17 pthread_mutex_consistent F GLIBC_2.17 pthread_mutex_consistent_np F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 26ad9845e4..8d0d149380 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -883,6 +883,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index 390b6384d0..a05379d8d7 100644 --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index bb9dfd4daf..59e73552a9 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -1369,6 +1369,7 @@ GLIBC_2.32 pthread_exit F GLIBC_2.32 pthread_getaffinity_np F GLIBC_2.32 pthread_getattr_np F GLIBC_2.32 pthread_getschedparam F +GLIBC_2.32 pthread_kill F GLIBC_2.32 pthread_mutex_destroy F GLIBC_2.32 pthread_mutex_init F GLIBC_2.32 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/libpthread.abilist index 1adcbecc2e..9a5a035490 100644 --- a/sysdeps/unix/sysv/linux/arc/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arc/libpthread.abilist @@ -113,7 +113,6 @@ GLIBC_2.32 pthread_getspecific F GLIBC_2.32 pthread_join F GLIBC_2.32 pthread_key_create F GLIBC_2.32 pthread_key_delete F -GLIBC_2.32 pthread_kill F GLIBC_2.32 pthread_kill_other_threads_np F GLIBC_2.32 pthread_mutex_clocklock F GLIBC_2.32 pthread_mutex_consistent F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 3b0a47e967..fb76fc2a9e 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -1534,6 +1534,7 @@ GLIBC_2.4 pthread_exit F GLIBC_2.4 pthread_getaffinity_np F GLIBC_2.4 pthread_getattr_np F GLIBC_2.4 pthread_getschedparam F +GLIBC_2.4 pthread_kill F GLIBC_2.4 pthread_mutex_destroy F GLIBC_2.4 pthread_mutex_init F GLIBC_2.4 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index b6c26c7a50..fc7343bae9 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.4 pthread_getspecific F GLIBC_2.4 pthread_join F GLIBC_2.4 pthread_key_create F GLIBC_2.4 pthread_key_delete F -GLIBC_2.4 pthread_kill F GLIBC_2.4 pthread_kill_other_threads_np F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_destroy F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 9ab3924888..a8199f5de9 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -1531,6 +1531,7 @@ GLIBC_2.4 pthread_exit F GLIBC_2.4 pthread_getaffinity_np F GLIBC_2.4 pthread_getattr_np F GLIBC_2.4 pthread_getschedparam F +GLIBC_2.4 pthread_kill F GLIBC_2.4 pthread_mutex_destroy F GLIBC_2.4 pthread_mutex_init F GLIBC_2.4 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist index b6c26c7a50..fc7343bae9 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.4 pthread_getspecific F GLIBC_2.4 pthread_join F GLIBC_2.4 pthread_key_create F GLIBC_2.4 pthread_key_delete F -GLIBC_2.4 pthread_kill F GLIBC_2.4 pthread_kill_other_threads_np F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_destroy F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 14a84dac8f..7f038c4e6f 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -1430,6 +1430,7 @@ GLIBC_2.29 pthread_exit F GLIBC_2.29 pthread_getaffinity_np F GLIBC_2.29 pthread_getattr_np F GLIBC_2.29 pthread_getschedparam F +GLIBC_2.29 pthread_kill F GLIBC_2.29 pthread_mutex_destroy F GLIBC_2.29 pthread_mutex_init F GLIBC_2.29 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist index 6ce59276a7..d82933bab8 100644 --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist @@ -111,7 +111,6 @@ GLIBC_2.29 pthread_getspecific F GLIBC_2.29 pthread_join F GLIBC_2.29 pthread_key_create F GLIBC_2.29 pthread_key_delete F -GLIBC_2.29 pthread_kill F GLIBC_2.29 pthread_kill_other_threads_np F GLIBC_2.29 pthread_mutex_consistent F GLIBC_2.29 pthread_mutex_consistent_np F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 5c8502f3d3..4afe849736 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -1266,6 +1266,7 @@ GLIBC_2.2 pthread_condattr_init F GLIBC_2.2 pthread_equal F GLIBC_2.2 pthread_exit F GLIBC_2.2 pthread_getschedparam F +GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F GLIBC_2.2 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index cabc5af858..041f965447 100644 --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -100,7 +100,6 @@ GLIBC_2.2 pthread_getspecific F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_key_create F GLIBC_2.2 pthread_key_delete F -GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_kill_other_threads_np F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 4f0d3c1eb5..4d4e4bca71 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -860,6 +860,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index 18177307c8..8875b14ad1 100644 --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index e3b345b803..1fd9df36d2 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1287,6 +1287,7 @@ GLIBC_2.2 pthread_condattr_init F GLIBC_2.2 pthread_equal F GLIBC_2.2 pthread_exit F GLIBC_2.2 pthread_getschedparam F +GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F GLIBC_2.2 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist index 335f486cb5..998d7d2d99 100644 --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist @@ -100,7 +100,6 @@ GLIBC_2.2 pthread_getspecific F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_key_create F GLIBC_2.2 pthread_key_delete F -GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_kill_other_threads_np F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 25f2d1c08f..38b379a876 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -1514,6 +1514,7 @@ GLIBC_2.4 pthread_exit F GLIBC_2.4 pthread_getaffinity_np F GLIBC_2.4 pthread_getattr_np F GLIBC_2.4 pthread_getschedparam F +GLIBC_2.4 pthread_kill F GLIBC_2.4 pthread_mutex_destroy F GLIBC_2.4 pthread_mutex_init F GLIBC_2.4 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist index b6c26c7a50..fc7343bae9 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.4 pthread_getspecific F GLIBC_2.4 pthread_join F GLIBC_2.4 pthread_key_create F GLIBC_2.4 pthread_key_delete F -GLIBC_2.4 pthread_kill F GLIBC_2.4 pthread_kill_other_threads_np F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_destroy F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index c4891479d3..0704160e7c 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -859,6 +859,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index 18177307c8..8875b14ad1 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 143b0163b4..f4ded90314 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -1445,6 +1445,7 @@ GLIBC_2.18 pthread_exit F GLIBC_2.18 pthread_getaffinity_np F GLIBC_2.18 pthread_getattr_np F GLIBC_2.18 pthread_getschedparam F +GLIBC_2.18 pthread_kill F GLIBC_2.18 pthread_mutex_destroy F GLIBC_2.18 pthread_mutex_init F GLIBC_2.18 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist index 60397187b6..6a26159353 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist @@ -103,7 +103,6 @@ GLIBC_2.18 pthread_getspecific F GLIBC_2.18 pthread_join F GLIBC_2.18 pthread_key_create F GLIBC_2.18 pthread_key_delete F -GLIBC_2.18 pthread_kill F GLIBC_2.18 pthread_kill_other_threads_np F GLIBC_2.18 pthread_mutex_consistent F GLIBC_2.18 pthread_mutex_consistent_np F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 13d374a031..fac0b0f773 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -1445,6 +1445,7 @@ GLIBC_2.18 pthread_exit F GLIBC_2.18 pthread_getaffinity_np F GLIBC_2.18 pthread_getattr_np F GLIBC_2.18 pthread_getschedparam F +GLIBC_2.18 pthread_kill F GLIBC_2.18 pthread_mutex_destroy F GLIBC_2.18 pthread_mutex_init F GLIBC_2.18 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist index 60397187b6..6a26159353 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist @@ -103,7 +103,6 @@ GLIBC_2.18 pthread_getspecific F GLIBC_2.18 pthread_join F GLIBC_2.18 pthread_key_create F GLIBC_2.18 pthread_key_delete F -GLIBC_2.18 pthread_kill F GLIBC_2.18 pthread_kill_other_threads_np F GLIBC_2.18 pthread_mutex_consistent F GLIBC_2.18 pthread_mutex_consistent_np F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index b2295f1937..18492fce28 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -856,6 +856,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index b35d7f19ca..42112cee49 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 4c786070d0..1d1e9e0d90 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -856,6 +856,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist index b35d7f19ca..42112cee49 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index aa9c6a4dca..364f58a555 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -856,6 +856,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 5939588ad5..69c1dfc372 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -854,6 +854,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 92556c4237..dc26597034 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -1487,6 +1487,7 @@ GLIBC_2.21 pthread_exit F GLIBC_2.21 pthread_getaffinity_np F GLIBC_2.21 pthread_getattr_np F GLIBC_2.21 pthread_getschedparam F +GLIBC_2.21 pthread_kill F GLIBC_2.21 pthread_mutex_destroy F GLIBC_2.21 pthread_mutex_init F GLIBC_2.21 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist index 924ad6e451..b1061cdbdd 100644 --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist @@ -103,7 +103,6 @@ GLIBC_2.21 pthread_getspecific F GLIBC_2.21 pthread_join F GLIBC_2.21 pthread_key_create F GLIBC_2.21 pthread_key_delete F -GLIBC_2.21 pthread_kill F GLIBC_2.21 pthread_kill_other_threads_np F GLIBC_2.21 pthread_mutex_consistent F GLIBC_2.21 pthread_mutex_consistent_np F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 26c93dff05..ca1ccde821 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -867,6 +867,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index 13b41dafb6..abb726e354 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index f04b167788..b3334d5e07 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -867,6 +867,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index c2ca00709e..64c4634b3b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -1373,6 +1373,7 @@ GLIBC_2.3 pthread_equal F GLIBC_2.3 pthread_exit F GLIBC_2.3 pthread_getattr_np F GLIBC_2.3 pthread_getschedparam F +GLIBC_2.3 pthread_kill F GLIBC_2.3 pthread_mutex_destroy F GLIBC_2.3 pthread_mutex_init F GLIBC_2.3 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist index e9477a3584..7edba91681 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist @@ -120,7 +120,6 @@ GLIBC_2.3 pthread_getspecific F GLIBC_2.3 pthread_join F GLIBC_2.3 pthread_key_create F GLIBC_2.3 pthread_key_delete F -GLIBC_2.3 pthread_kill F GLIBC_2.3 pthread_kill_other_threads_np F GLIBC_2.3 pthread_mutex_destroy F GLIBC_2.3 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 0ea50dc851..588436eadf 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -1531,6 +1531,7 @@ GLIBC_2.17 pthread_exit F GLIBC_2.17 pthread_getaffinity_np F GLIBC_2.17 pthread_getattr_np F GLIBC_2.17 pthread_getschedparam F +GLIBC_2.17 pthread_kill F GLIBC_2.17 pthread_mutex_destroy F GLIBC_2.17 pthread_mutex_init F GLIBC_2.17 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist index c6b4ea2dc1..18f2b38dca 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist @@ -102,7 +102,6 @@ GLIBC_2.17 pthread_getspecific F GLIBC_2.17 pthread_join F GLIBC_2.17 pthread_key_create F GLIBC_2.17 pthread_key_delete F -GLIBC_2.17 pthread_kill F GLIBC_2.17 pthread_kill_other_threads_np F GLIBC_2.17 pthread_mutex_consistent F GLIBC_2.17 pthread_mutex_consistent_np F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index 0263e284d4..5d471b76dd 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -1371,6 +1371,7 @@ GLIBC_2.33 pthread_exit F GLIBC_2.33 pthread_getaffinity_np F GLIBC_2.33 pthread_getattr_np F GLIBC_2.33 pthread_getschedparam F +GLIBC_2.33 pthread_kill F GLIBC_2.33 pthread_mutex_destroy F GLIBC_2.33 pthread_mutex_init F GLIBC_2.33 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist index 61b3c4ff7a..0023fa95df 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist @@ -113,7 +113,6 @@ GLIBC_2.33 pthread_getspecific F GLIBC_2.33 pthread_join F GLIBC_2.33 pthread_key_create F GLIBC_2.33 pthread_key_delete F -GLIBC_2.33 pthread_kill F GLIBC_2.33 pthread_kill_other_threads_np F GLIBC_2.33 pthread_mutex_clocklock F GLIBC_2.33 pthread_mutex_consistent F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 1626c5351f..a851e6e26a 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -1433,6 +1433,7 @@ GLIBC_2.27 pthread_exit F GLIBC_2.27 pthread_getaffinity_np F GLIBC_2.27 pthread_getattr_np F GLIBC_2.27 pthread_getschedparam F +GLIBC_2.27 pthread_kill F GLIBC_2.27 pthread_mutex_destroy F GLIBC_2.27 pthread_mutex_init F GLIBC_2.27 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist index 894c474fcb..faeb8dd7b6 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist @@ -100,7 +100,6 @@ GLIBC_2.27 pthread_getspecific F GLIBC_2.27 pthread_join F GLIBC_2.27 pthread_key_create F GLIBC_2.27 pthread_key_delete F -GLIBC_2.27 pthread_kill F GLIBC_2.27 pthread_kill_other_threads_np F GLIBC_2.27 pthread_mutex_consistent F GLIBC_2.27 pthread_mutex_consistent_np F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index a66426eb4d..8ca57937b4 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -858,6 +858,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index 0a60f1cca2..41f7d4371b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index ab351873ae..45eb1b4878 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1284,6 +1284,7 @@ GLIBC_2.2 pthread_condattr_init F GLIBC_2.2 pthread_equal F GLIBC_2.2 pthread_exit F GLIBC_2.2 pthread_getschedparam F +GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F GLIBC_2.2 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist index 0e99688824..dca95c3126 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist @@ -102,7 +102,6 @@ GLIBC_2.2 pthread_getspecific F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_key_create F GLIBC_2.2 pthread_key_delete F -GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_kill_other_threads_np F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 22ceaa3d87..7cb0df1c3b 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -1270,6 +1270,7 @@ GLIBC_2.2 pthread_condattr_init F GLIBC_2.2 pthread_equal F GLIBC_2.2 pthread_exit F GLIBC_2.2 pthread_getschedparam F +GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F GLIBC_2.2 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index cabc5af858..041f965447 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -100,7 +100,6 @@ GLIBC_2.2 pthread_getspecific F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_key_create F GLIBC_2.2 pthread_key_delete F -GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_kill_other_threads_np F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index d36f228192..b8acbd5839 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -1270,6 +1270,7 @@ GLIBC_2.2 pthread_condattr_init F GLIBC_2.2 pthread_equal F GLIBC_2.2 pthread_exit F GLIBC_2.2 pthread_getschedparam F +GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F GLIBC_2.2 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index cabc5af858..041f965447 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -100,7 +100,6 @@ GLIBC_2.2 pthread_getspecific F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_key_create F GLIBC_2.2 pthread_key_delete F -GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_kill_other_threads_np F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 59b4313280..b8583563b5 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -861,6 +861,7 @@ GLIBC_2.0 pthread_condattr_init F GLIBC_2.0 pthread_equal F GLIBC_2.0 pthread_exit F GLIBC_2.0 pthread_getschedparam F +GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F GLIBC_2.0 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index 390b6384d0..a05379d8d7 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist @@ -56,7 +56,6 @@ GLIBC_2.0 pthread_getspecific F GLIBC_2.0 pthread_join F GLIBC_2.0 pthread_key_create F GLIBC_2.0 pthread_key_delete F -GLIBC_2.0 pthread_kill F GLIBC_2.0 pthread_kill_other_threads_np F GLIBC_2.0 pthread_mutex_destroy F GLIBC_2.0 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 266dcdfa08..2f27067543 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1313,6 +1313,7 @@ GLIBC_2.2 pthread_condattr_init F GLIBC_2.2 pthread_equal F GLIBC_2.2 pthread_exit F GLIBC_2.2 pthread_getschedparam F +GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F GLIBC_2.2 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist index 335f486cb5..998d7d2d99 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist @@ -100,7 +100,6 @@ GLIBC_2.2 pthread_getspecific F GLIBC_2.2 pthread_join F GLIBC_2.2 pthread_key_create F GLIBC_2.2 pthread_key_delete F -GLIBC_2.2 pthread_kill F GLIBC_2.2 pthread_kill_other_threads_np F GLIBC_2.2 pthread_mutex_destroy F GLIBC_2.2 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 4fff61818b..4541c8b54e 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1281,6 +1281,7 @@ GLIBC_2.2.5 pthread_equal F GLIBC_2.2.5 pthread_exit F GLIBC_2.2.5 pthread_getattr_np F GLIBC_2.2.5 pthread_getschedparam F +GLIBC_2.2.5 pthread_kill F GLIBC_2.2.5 pthread_mutex_destroy F GLIBC_2.2.5 pthread_mutex_init F GLIBC_2.2.5 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist index 971269d2ef..2a74e40f01 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist @@ -100,7 +100,6 @@ GLIBC_2.2.5 pthread_getspecific F GLIBC_2.2.5 pthread_join F GLIBC_2.2.5 pthread_key_create F GLIBC_2.2.5 pthread_key_delete F -GLIBC_2.2.5 pthread_kill F GLIBC_2.2.5 pthread_kill_other_threads_np F GLIBC_2.2.5 pthread_mutex_destroy F GLIBC_2.2.5 pthread_mutex_init F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 102ed47a9c..d14923e737 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -1450,6 +1450,7 @@ GLIBC_2.16 pthread_exit F GLIBC_2.16 pthread_getaffinity_np F GLIBC_2.16 pthread_getattr_np F GLIBC_2.16 pthread_getschedparam F +GLIBC_2.16 pthread_kill F GLIBC_2.16 pthread_mutex_destroy F GLIBC_2.16 pthread_mutex_init F GLIBC_2.16 pthread_mutex_lock F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist index b9bf4324a9..81f294c3e0 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist @@ -102,7 +102,6 @@ GLIBC_2.16 pthread_getspecific F GLIBC_2.16 pthread_join F GLIBC_2.16 pthread_key_create F GLIBC_2.16 pthread_key_delete F -GLIBC_2.16 pthread_kill F GLIBC_2.16 pthread_kill_other_threads_np F GLIBC_2.16 pthread_mutex_consistent F GLIBC_2.16 pthread_mutex_consistent_np F From patchwork Mon Dec 7 21:27:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41331 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4E08E393D02B; Mon, 7 Dec 2020 21:28:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E08E393D02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376489; bh=T7p/TJ6gknrumM+IJ6j8r2cqInKQmGcgFTq+RBXfryY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Fqz8jlozcT4NexF5xbnFzn/rWc2FKNXm0IlVPcJDy5G09FRZesK48Xt0GSHk2PA96 Lc2nx4Z5hgA7L2dM1KnFSUHjPkzMq1Dmp/8fRIUvEtEvZ7RBwmqnLj5MegpIycpVSb hZc9iEvK3ajY5CgIthB/ljreZAUsLuW7zuX1WyMQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 6FF3B393BC09 for ; Mon, 7 Dec 2020 21:28:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6FF3B393BC09 Received: by mail-qk1-x741.google.com with SMTP id q5so14125069qkc.12 for ; Mon, 07 Dec 2020 13:28:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T7p/TJ6gknrumM+IJ6j8r2cqInKQmGcgFTq+RBXfryY=; b=hOA+3H40V8eU2lZf48PNqJtS0PPErNtrM0AoM+u4dFgG9sEnvj4bCkPdP/1/WiTXIw x4qOFR/QNJRKwrhf9hL3ZAgzEGYj/i/CW1R+P6QP24zhDiJI+l6WtZjF2oeWqN93DaX2 wRdh2NnzI8Y9gG2U3M6dW5a/lAJNg+oE5zCjUto+IdsP+zCeqtnXqM8yKuWLIeTFBZej 4vFEElQ6M54kNXYnYp+gMzi3bdmpImd9vJbqXOsToczai3avC7wuR7UiLL/+wLR5Vs12 6DFRFXyWI9JQzLlA3sV0HUuS8/yegRFfI7kgHGC0z1n2njN7SX1MOWOA8H4/hKktWD1C EyhA== X-Gm-Message-State: AOAM5304KXEKvwkl4L5opQVM+bi4w19VTA559zRA2hhUagAx4aNC1OAI lPkyi47cZrhbVGu6GiXBB1BDgB5UCMTBiw== X-Google-Smtp-Source: ABdhPJxq4/tjBlt+317+3RL8WSClgU2cbdo3eZDwaAl2h27Of1XI0Ysd3DWVuur8cZLIyELv/LLPUg== X-Received: by 2002:a05:620a:1526:: with SMTP id n6mr4706530qkk.334.1607376486779; Mon, 07 Dec 2020 13:28:06 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:06 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 3/8] nptl: Make pthread_kill async-signal-safe Date: Mon, 7 Dec 2020 18:27:52 -0300 Message-Id: <20201207212757.3948164-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> References: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from previous version: * Move __libc_signal_block_all prior TID read. --- Simiar to raise (BZ #15368), pthread_kill is also defined as async-signal-safe (POSIX.1-2008 TC1). However, similar to raise it has the same issues relating to signal handling. Different than raise, all the signal are blocked so it would be possible to implement pthread_cancel (which also should be async-cancel safe). Checked on x86_64-linux-gnu. --- nptl/pthread_kill.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index 7ef68d1572..006322ea9f 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -27,6 +27,11 @@ __pthread_kill (pthread_t threadid, int signo) if (__is_internal_signal (signo)) return EINVAL; + sigset_t set; + __libc_signal_block_all (&set); + + int val; + /* Force load of pd->tid into local variable or register. Otherwise if a thread exits between ESRCH test and tgkill, we might return EINVAL, because pd->tid would be cleared by the kernel. */ @@ -34,13 +39,19 @@ __pthread_kill (pthread_t threadid, int signo) pid_t tid = atomic_forced_read (pd->tid); if (__glibc_unlikely (tid <= 0)) /* Not a valid thread handle. */ - return ESRCH; + val = ESRCH; + else + { + /* We have a special syscall to do the work. */ + pid_t pid = __getpid (); + + val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); + val = (INTERNAL_SYSCALL_ERROR_P (val) + ? INTERNAL_SYSCALL_ERRNO (val) : 0); + } - /* We have a special syscall to do the work. */ - pid_t pid = __getpid (); + __libc_signal_restore_set (&set); - int val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); - return (INTERNAL_SYSCALL_ERROR_P (val) - ? INTERNAL_SYSCALL_ERRNO (val) : 0); + return val; } strong_alias (__pthread_kill, pthread_kill) From patchwork Mon Dec 7 21:27:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41333 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66E64393BC09; Mon, 7 Dec 2020 21:28:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66E64393BC09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376493; bh=OXvnjyEtVQAtJK7FXdzeLQ05uyQQnWu8/pSfhWYJJc0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uEf/nTMSnsvBwp2ZYUAYOBcsXbOCxrA/kOPo0TwlusaUUBlh9aj3fOdc0pDZ2Qpru 9zbwCa+R7481oTHSoa8ZEguU6dNMgiZ/vOhdTL32LxEgTNoa3K2RALuxOOt35D2721 8oZXd+a0kQIEV6OCCbFDFx21iQvs1w2pwhGRnNf8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 980B23943540 for ; Mon, 7 Dec 2020 21:28:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 980B23943540 Received: by mail-qk1-x734.google.com with SMTP id q5so14125193qkc.12 for ; Mon, 07 Dec 2020 13:28:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OXvnjyEtVQAtJK7FXdzeLQ05uyQQnWu8/pSfhWYJJc0=; b=HepcurLQNAVIjzk0ho28PpgzGqD205xLlAY4EHzzA8bgWBZ6YSk5jO1ivej9MgGmr8 D3GfZrgPVaKg2VMWqfHsucyXWHCf9183ftLt1Mf7Gf/ApnzPud0zq7iVA8CTA7/e/Lep 2s+mZFmDMoGtZJI9aDMVx9vDwcV7zBw9AcZgyAg4ZkKgNMs1h28ulW76OGkbYA0fRaqb bofDLZ5S+5tdy61J7bc4pervC5s+mQzFRLRIrjTCHfJCsUBUynqkGRtrkRMakDST4PzZ Pv147/jaYCgcgee/u3lmRKhtRQhZUCVEDEj/v/MO3Cj+OyaADiNea2CufYJ0b43gXTXa kfww== X-Gm-Message-State: AOAM533PY/IO22a9stClKmZRQvlURP8U8eb6ELew90s259E3D7XyGKuV dkf8041Bmt7WAd73MLFd4luPJFmVTo4C5A== X-Google-Smtp-Source: ABdhPJyBsj2yVXKfdWO4gJqCgr+qgMRQYQd8w4oJz1W7ZrIYOVZ7DRUx4yhy7E2UfgL8DsLsJt8aig== X-Received: by 2002:a37:883:: with SMTP id 125mr4952060qki.366.1607376488657; Mon, 07 Dec 2020 13:28:08 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:08 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 4/8] nptl: Remove pthread raise implementation Date: Mon, 7 Dec 2020 18:27:53 -0300 Message-Id: <20201207212757.3948164-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> References: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from previous version: * Removed spurious new line. --- The Linux version already target the current thread by using tgkill along with getpid and gettid. Checked on x86_64-linux-gnu. --- nptl/Makefile | 2 +- nptl/pt-raise.c | 29 ------------------- .../sysv/linux/aarch64/libpthread.abilist | 1 - .../unix/sysv/linux/alpha/libpthread.abilist | 1 - .../unix/sysv/linux/arc/libpthread.abilist | 1 - .../unix/sysv/linux/arm/be/libpthread.abilist | 1 - .../unix/sysv/linux/arm/le/libpthread.abilist | 1 - .../unix/sysv/linux/csky/libpthread.abilist | 1 - .../unix/sysv/linux/hppa/libpthread.abilist | 1 - .../unix/sysv/linux/i386/libpthread.abilist | 1 - .../unix/sysv/linux/ia64/libpthread.abilist | 1 - .../linux/m68k/coldfire/libpthread.abilist | 1 - .../sysv/linux/m68k/m680x0/libpthread.abilist | 1 - .../linux/microblaze/be/libpthread.abilist | 1 - .../linux/microblaze/le/libpthread.abilist | 1 - .../sysv/linux/mips/mips32/libpthread.abilist | 1 - .../sysv/linux/mips/mips64/libpthread.abilist | 1 - .../unix/sysv/linux/nios2/libpthread.abilist | 1 - .../powerpc/powerpc32/libpthread.abilist | 1 - .../powerpc/powerpc64/be/libpthread.abilist | 1 - .../powerpc/powerpc64/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/pt-raise.c | 20 ------------- .../sysv/linux/riscv/rv32/libpthread.abilist | 1 - .../sysv/linux/riscv/rv64/libpthread.abilist | 1 - .../linux/s390/s390-32/libpthread.abilist | 1 - .../linux/s390/s390-64/libpthread.abilist | 1 - .../unix/sysv/linux/sh/be/libpthread.abilist | 1 - .../unix/sysv/linux/sh/le/libpthread.abilist | 1 - .../linux/sparc/sparc32/libpthread.abilist | 1 - .../linux/sparc/sparc64/libpthread.abilist | 1 - .../sysv/linux/x86_64/64/libpthread.abilist | 1 - .../sysv/linux/x86_64/x32/libpthread.abilist | 1 - 32 files changed, 1 insertion(+), 79 deletions(-) delete mode 100644 nptl/pt-raise.c delete mode 100644 sysdeps/unix/sysv/linux/pt-raise.c diff --git a/nptl/Makefile b/nptl/Makefile index 3f6e77f63f..0e0f50e95b 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -150,7 +150,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ lowlevellock \ pt-fork pt-fcntl \ $(pthread-compat-wrappers) \ - pt-raise pt-system \ + pt-system \ flockfile ftrylockfile funlockfile \ sigaction \ herrno res pt-allocrtsig \ diff --git a/nptl/pt-raise.c b/nptl/pt-raise.c deleted file mode 100644 index 069b33a86e..0000000000 --- a/nptl/pt-raise.c +++ /dev/null @@ -1,29 +0,0 @@ -/* ISO C raise function for libpthread. - Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. - - 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 - . */ - -#include -#include - - -int -raise (int sig) -{ - /* This is what POSIX says must happen. */ - return pthread_kill (pthread_self (), sig); -} diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist index 18f2b38dca..8674d82bad 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist @@ -164,7 +164,6 @@ GLIBC_2.17 pthread_tryjoin_np F GLIBC_2.17 pthread_yield F GLIBC_2.17 pwrite F GLIBC_2.17 pwrite64 F -GLIBC_2.17 raise F GLIBC_2.17 read F GLIBC_2.17 recv F GLIBC_2.17 recvfrom F diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index a05379d8d7..37e2e498ba 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/libpthread.abilist index 9a5a035490..85cdb87513 100644 --- a/sysdeps/unix/sysv/linux/arc/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arc/libpthread.abilist @@ -179,7 +179,6 @@ GLIBC_2.32 pthread_tryjoin_np F GLIBC_2.32 pthread_yield F GLIBC_2.32 pwrite F GLIBC_2.32 pwrite64 F -GLIBC_2.32 raise F GLIBC_2.32 read F GLIBC_2.32 recv F GLIBC_2.32 recvfrom F diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index fc7343bae9..e29ecce521 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist @@ -193,7 +193,6 @@ GLIBC_2.4 pthread_tryjoin_np F GLIBC_2.4 pthread_yield F GLIBC_2.4 pwrite F GLIBC_2.4 pwrite64 F -GLIBC_2.4 raise F GLIBC_2.4 read F GLIBC_2.4 recv F GLIBC_2.4 recvfrom F diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist index fc7343bae9..e29ecce521 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist @@ -193,7 +193,6 @@ GLIBC_2.4 pthread_tryjoin_np F GLIBC_2.4 pthread_yield F GLIBC_2.4 pwrite F GLIBC_2.4 pwrite64 F -GLIBC_2.4 raise F GLIBC_2.4 read F GLIBC_2.4 recv F GLIBC_2.4 recvfrom F diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist index d82933bab8..5975349ad0 100644 --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist @@ -174,7 +174,6 @@ GLIBC_2.29 pthread_tryjoin_np F GLIBC_2.29 pthread_yield F GLIBC_2.29 pwrite F GLIBC_2.29 pwrite64 F -GLIBC_2.29 raise F GLIBC_2.29 read F GLIBC_2.29 recv F GLIBC_2.29 recvfrom F diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index 041f965447..f16ca227ab 100644 --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -144,7 +144,6 @@ GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 pwrite F GLIBC_2.2 pwrite64 F -GLIBC_2.2 raise F GLIBC_2.2 read F GLIBC_2.2 recv F GLIBC_2.2 recvfrom F diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index 8875b14ad1..c3e8cbf284 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist index 998d7d2d99..d249bf0bb1 100644 --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist @@ -144,7 +144,6 @@ GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 pwrite F GLIBC_2.2 pwrite64 F -GLIBC_2.2 raise F GLIBC_2.2 read F GLIBC_2.2 recv F GLIBC_2.2 recvfrom F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist index fc7343bae9..e29ecce521 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist @@ -193,7 +193,6 @@ GLIBC_2.4 pthread_tryjoin_np F GLIBC_2.4 pthread_yield F GLIBC_2.4 pwrite F GLIBC_2.4 pwrite64 F -GLIBC_2.4 raise F GLIBC_2.4 read F GLIBC_2.4 recv F GLIBC_2.4 recvfrom F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index 8875b14ad1..c3e8cbf284 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist index 6a26159353..a260eaf1ad 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist @@ -166,7 +166,6 @@ GLIBC_2.18 pthread_tryjoin_np F GLIBC_2.18 pthread_yield F GLIBC_2.18 pwrite F GLIBC_2.18 pwrite64 F -GLIBC_2.18 raise F GLIBC_2.18 read F GLIBC_2.18 recv F GLIBC_2.18 recvfrom F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist index 6a26159353..a260eaf1ad 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist @@ -166,7 +166,6 @@ GLIBC_2.18 pthread_tryjoin_np F GLIBC_2.18 pthread_yield F GLIBC_2.18 pwrite F GLIBC_2.18 pwrite64 F -GLIBC_2.18 raise F GLIBC_2.18 read F GLIBC_2.18 recv F GLIBC_2.18 recvfrom F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index 42112cee49..55b42b617c 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist index 42112cee49..55b42b617c 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist index b1061cdbdd..5d5c5aab44 100644 --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist @@ -166,7 +166,6 @@ GLIBC_2.21 pthread_tryjoin_np F GLIBC_2.21 pthread_yield F GLIBC_2.21 pwrite F GLIBC_2.21 pwrite64 F -GLIBC_2.21 raise F GLIBC_2.21 read F GLIBC_2.21 recv F GLIBC_2.21 recvfrom F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index abb726e354..e9b0739340 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist index 7edba91681..0faf484806 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist @@ -164,7 +164,6 @@ GLIBC_2.3 pthread_testcancel F GLIBC_2.3 pthread_yield F GLIBC_2.3 pwrite F GLIBC_2.3 pwrite64 F -GLIBC_2.3 raise F GLIBC_2.3 read F GLIBC_2.3 recv F GLIBC_2.3 recvfrom F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist index 18f2b38dca..8674d82bad 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist @@ -164,7 +164,6 @@ GLIBC_2.17 pthread_tryjoin_np F GLIBC_2.17 pthread_yield F GLIBC_2.17 pwrite F GLIBC_2.17 pwrite64 F -GLIBC_2.17 raise F GLIBC_2.17 read F GLIBC_2.17 recv F GLIBC_2.17 recvfrom F diff --git a/sysdeps/unix/sysv/linux/pt-raise.c b/sysdeps/unix/sysv/linux/pt-raise.c deleted file mode 100644 index 0c8246b0cc..0000000000 --- a/sysdeps/unix/sysv/linux/pt-raise.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ISO C raise function for libpthread. - Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. - - 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 - . */ - -#include diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist index 0023fa95df..62a11c535a 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist @@ -179,7 +179,6 @@ GLIBC_2.33 pthread_tryjoin_np F GLIBC_2.33 pthread_yield F GLIBC_2.33 pwrite F GLIBC_2.33 pwrite64 F -GLIBC_2.33 raise F GLIBC_2.33 read F GLIBC_2.33 recv F GLIBC_2.33 recvfrom F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist index faeb8dd7b6..4628abce49 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist @@ -163,7 +163,6 @@ GLIBC_2.27 pthread_tryjoin_np F GLIBC_2.27 pthread_yield F GLIBC_2.27 pwrite F GLIBC_2.27 pwrite64 F -GLIBC_2.27 raise F GLIBC_2.27 read F GLIBC_2.27 recv F GLIBC_2.27 recvfrom F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index 41f7d4371b..a02aafedbc 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist index dca95c3126..249dd16a6b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist @@ -146,7 +146,6 @@ GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 pwrite F GLIBC_2.2 pwrite64 F -GLIBC_2.2 raise F GLIBC_2.2 read F GLIBC_2.2 recv F GLIBC_2.2 recvfrom F diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index 041f965447..f16ca227ab 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -144,7 +144,6 @@ GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 pwrite F GLIBC_2.2 pwrite64 F -GLIBC_2.2 raise F GLIBC_2.2 read F GLIBC_2.2 recv F GLIBC_2.2 recvfrom F diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index 041f965447..f16ca227ab 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -144,7 +144,6 @@ GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 pwrite F GLIBC_2.2 pwrite64 F -GLIBC_2.2 raise F GLIBC_2.2 read F GLIBC_2.2 recv F GLIBC_2.2 recvfrom F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index a05379d8d7..37e2e498ba 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_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F GLIBC_2.0 pthread_testcancel F -GLIBC_2.0 raise F GLIBC_2.0 read F GLIBC_2.0 recv F GLIBC_2.0 recvfrom F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist index 998d7d2d99..d249bf0bb1 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist @@ -144,7 +144,6 @@ GLIBC_2.2 pthread_testcancel F GLIBC_2.2 pthread_yield F GLIBC_2.2 pwrite F GLIBC_2.2 pwrite64 F -GLIBC_2.2 raise F GLIBC_2.2 read F GLIBC_2.2 recv F GLIBC_2.2 recvfrom F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist index 2a74e40f01..71390950d1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist @@ -144,7 +144,6 @@ GLIBC_2.2.5 pthread_testcancel F GLIBC_2.2.5 pthread_yield F GLIBC_2.2.5 pwrite F GLIBC_2.2.5 pwrite64 F -GLIBC_2.2.5 raise F GLIBC_2.2.5 read F GLIBC_2.2.5 recv F GLIBC_2.2.5 recvfrom F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist index 81f294c3e0..cd337846d9 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist @@ -164,7 +164,6 @@ GLIBC_2.16 pthread_tryjoin_np F GLIBC_2.16 pthread_yield F GLIBC_2.16 pwrite F GLIBC_2.16 pwrite64 F -GLIBC_2.16 raise F GLIBC_2.16 read F GLIBC_2.16 recv F GLIBC_2.16 recvfrom F From patchwork Mon Dec 7 21:27:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41334 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC12D3943540; Mon, 7 Dec 2020 21:28:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC12D3943540 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376495; bh=MhMiiC4KKLtEv+F5BHMQFzDz+2WXwHbgzzeF0upExfE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=rjyBA+G3wnNsykmrrT1CM44/mUtYnPjm28VTeT5D2UmGi01RB3cv6bQkQwDj/MgsG EJ5UZb5+YFNDN8AtlLnVIqbrbX0A5aWGio7fSefDo8UfvAGjLjnDFOOxRrHryPSu2Z J0LWx5Z4BFMfMTFSuYvjcAVZtaaAMaHyWRd4M7tM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by sourceware.org (Postfix) with ESMTPS id 21B2A393BC09 for ; Mon, 7 Dec 2020 21:28:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 21B2A393BC09 Received: by mail-qk1-x743.google.com with SMTP id y18so14112902qki.11 for ; Mon, 07 Dec 2020 13:28:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MhMiiC4KKLtEv+F5BHMQFzDz+2WXwHbgzzeF0upExfE=; b=DycLvv1b799q7q3csgq1wYL3BU9hKWmGOtosyyPdi2JNtccTAN+gt2Jc/q+N5XPXwE 97gvyfIQJuakfDsclJptWXeF5Tewmw+XregaN2E6fDJugIGxCwaXbNJDi5NMqF7W/s4H fiuumkSYB+DsN+LwdGyBO11om8dDZc9iU68pOMyFTtiyUPkTPdF5WQ0+wZ2W8Gf/dgYS 6CewtanwkC7iPIxzgNC1AkTHu0BiJ5e/DSuu7ixfMzLV+tR3uV8MpYSM9/ShjYjQqfnC RES9mz5XWEdvsiPRJPyVnBoJxmhyvC3oDtWa10vTawtoC5cT/Q1BFBmQyKV9KAWJkuT6 8/Qw== X-Gm-Message-State: AOAM533dsMorJeegLWsUqa4VXEPBphiH/AjuSmd4WDre0ZfWXLcxZaw6 9R/sL+8BzvnmVwkUCGB2TGFLB2Vjkkv2fQ== X-Google-Smtp-Source: ABdhPJzlcVKxJntgDtwajai71IDbGEHZlwFR3Lpy6CqbufEc2gwlRD3MqyWOZJ3nJ47gLpJnBXUcOA== X-Received: by 2002:a37:4f4e:: with SMTP id d75mr27434028qkb.284.1607376490395; Mon, 07 Dec 2020 13:28:10 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:10 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 5/8] nptl: Implement raise in terms of pthread_kill Date: Mon, 7 Dec 2020 18:27:54 -0300 Message-Id: <20201207212757.3948164-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> References: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from previous version: * Handle vfork usage for raise and obtain the TID using a syscall instead of reading from TCB. --- Now that pthread_kill is provided by libc.so and async-signal-safe, it is possible to implement the generic POSIX implementation as pthread_kill(pthread_self(), sig). For Linux implementation, pthread_kill read the targetting TID from the TCB. For raise, this it not possible because it would make raise fail when issue after vfork (where creates the resulting process has a different TID from the parent, but its TCB is not updated as for pthread_create). For this case, gettid is called directly. Checked on x86_64-linux-gnu. --- include/pthread.h | 5 ++++ nptl/pthreadP.h | 4 +-- nptl/pthread_kill.c | 40 +++++++++++++------------ nptl/pthread_self.c | 4 ++- sysdeps/htl/pthreadP.h | 2 -- sysdeps/posix/raise.c | 11 +++++-- sysdeps/unix/sysv/linux/raise.c | 52 --------------------------------- 7 files changed, 41 insertions(+), 77 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/raise.c diff --git a/include/pthread.h b/include/pthread.h index 858c869a16..2623fb5e95 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -13,4 +13,9 @@ extern int __pthread_barrier_wait (pthread_barrier_t *__barrier) /* This function is called to initialize the pthread library. */ extern void __pthread_initialize (void) __attribute__ ((weak)); + +extern int __pthread_kill (pthread_t threadid, int signo); + +extern pthread_t __pthread_self (void); + #endif diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index a7510f9f63..968adcdb6a 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -521,11 +521,11 @@ extern int __pthread_once (pthread_once_t *once_control, void (*init_routine) (void)); extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)); -extern pthread_t __pthread_self (void); +libc_hidden_proto (__pthread_self) extern int __pthread_equal (pthread_t thread1, pthread_t thread2); extern int __pthread_detach (pthread_t th); extern int __pthread_cancel (pthread_t th); -extern int __pthread_kill (pthread_t threadid, int signo); +libc_hidden_proto (__pthread_kill) extern void __pthread_exit (void *value) __attribute__ ((__noreturn__)); extern int __pthread_join (pthread_t threadid, void **thread_return); extern int __pthread_setcanceltype (int type, int *oldtype); diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index 006322ea9f..cf12fa743f 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -30,28 +30,32 @@ __pthread_kill (pthread_t threadid, int signo) sigset_t set; __libc_signal_block_all (&set); - int val; - - /* Force load of pd->tid into local variable or register. Otherwise - if a thread exits between ESRCH test and tgkill, we might return - EINVAL, because pd->tid would be cleared by the kernel. */ + pid_t tid; struct pthread *pd = (struct pthread *) threadid; - pid_t tid = atomic_forced_read (pd->tid); - if (__glibc_unlikely (tid <= 0)) - /* Not a valid thread handle. */ - val = ESRCH; - else - { - /* We have a special syscall to do the work. */ - pid_t pid = __getpid (); - val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); - val = (INTERNAL_SYSCALL_ERROR_P (val) - ? INTERNAL_SYSCALL_ERRNO (val) : 0); - } + if (pd == THREAD_SELF) + tid = INLINE_SYSCALL_CALL (gettid); + else + /* Force load of pd->tid into local variable or register. Otherwise + if a thread exits between ESRCH test and tgkill, we might return + EINVAL, because pd->tid would be cleared by the kernel. */ + tid = atomic_forced_read (pd->tid); + + int val; + if (__glibc_likely (tid > 0)) + { + pid_t pid = __getpid (); + + val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); + val = (INTERNAL_SYSCALL_ERROR_P (val) + ? INTERNAL_SYSCALL_ERRNO (val) : 0); + } + else + val = ESRCH; __libc_signal_restore_set (&set); return val; } -strong_alias (__pthread_kill, pthread_kill) +libc_hidden_def (__pthread_kill) +weak_alias (__pthread_kill, pthread_kill) diff --git a/nptl/pthread_self.c b/nptl/pthread_self.c index 00a8474909..4fab462bbf 100644 --- a/nptl/pthread_self.c +++ b/nptl/pthread_self.c @@ -20,7 +20,9 @@ #include pthread_t -pthread_self (void) +__pthread_self (void) { return (pthread_t) THREAD_SELF; } +libc_hidden_def (__pthread_self) +weak_alias (__pthread_self, pthread_self) diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index bf00f7d2f0..befe18b421 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -31,8 +31,6 @@ extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; /* These represent the interface used by glibc itself. */ -extern pthread_t __pthread_self (void); -extern int __pthread_kill (pthread_t threadid, int signo); extern struct __pthread **__pthread_threads; extern int __pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__attr); diff --git a/sysdeps/posix/raise.c b/sysdeps/posix/raise.c index 32cb108f0b..586116fc1c 100644 --- a/sysdeps/posix/raise.c +++ b/sysdeps/posix/raise.c @@ -16,13 +16,20 @@ . */ #include -#include +#include +#include /* Raise the signal SIG. */ int raise (int sig) { - return __kill (__getpid (), sig); + int ret = __pthread_kill (__pthread_self (), sig); + if (ret != 0) + { + __set_errno (ret); + ret = -1; + } + return ret; } libc_hidden_def (raise) weak_alias (raise, gsignal) diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c deleted file mode 100644 index 3b90ae1d55..0000000000 --- a/sysdeps/unix/sysv/linux/raise.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. - - 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 - . */ - -#include -#include -#include -#include -#include -#include - -int -raise (int sig) -{ - /* rt_sigprocmask may fail if: - - 1. sigsetsize != sizeof (sigset_t) (EINVAL) - 2. a failure in copy from/to user space (EFAULT) - 3. an invalid 'how' operation (EINVAL) - - The first case is already handle in glibc syscall call by using the arch - defined _NSIG. Second case is handled by using a stack allocated mask. - The last one should be handled by the block/unblock functions. */ - - sigset_t set; - __libc_signal_block_app (&set); - - pid_t pid = INTERNAL_SYSCALL_CALL (getpid); - pid_t tid = INTERNAL_SYSCALL_CALL (gettid); - - int ret = INLINE_SYSCALL_CALL (tgkill, pid, tid, sig); - - __libc_signal_restore_set (&set); - - return ret; -} -libc_hidden_def (raise) -weak_alias (raise, gsignal) From patchwork Mon Dec 7 21:27:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41335 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7CBF03945C0A; Mon, 7 Dec 2020 21:28:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CBF03945C0A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376495; bh=AkqbdLPEvnHcaf9WDEH4fOfx8FldJnLcB04IwL7bfV0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=k9U/oSoPa93w5/5baVLJh+BlXhozv1vIRqPodN3KEFEeOjMXHV/Fct7w4T14uCyg1 S4oUiA0Kz8XJTVQjjx39Cg8FExpiFewavuac9HUGB4UvAfF74asXiuykqFCkyMp6YM ZVvCnvrNGH87in5gqvvbpUL7LPymw2vp+OzTD68k= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 0A4073943540 for ; Mon, 7 Dec 2020 21:28:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0A4073943540 Received: by mail-qk1-x741.google.com with SMTP id u4so14139494qkk.10 for ; Mon, 07 Dec 2020 13:28:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AkqbdLPEvnHcaf9WDEH4fOfx8FldJnLcB04IwL7bfV0=; b=l1imMeKxzaeoWB7v+6d5CaxMLlbonVXRwZdT6YCpYBTi4W9K3wNL3PqMCvf46OX4hI 4Sm7wAgzBdOcUhGk98IL9uSItxJFK4fF5Ucc3wf4NhnzNdo9+MSGIwZkjUKr7kUU0aZH G/1GYyVYz/+Nwu3ujWrGrtkINaqQ65xeE/y3v2oBPSY2/a7VkeOOad6elTEz7tbJHi6V F9yScYRWtp77D71GChJgleQEXNY/+8OLcycK5kD4zHkTGJlKg+6Gh/VyR7ka/V8g1otV yK5MeAffF6MWEocaHw3SEopLxIJdOIjjOp8+9aKWdLeHVNHcRzneObg3YgUnbZURAe6C 0u3Q== X-Gm-Message-State: AOAM531UtS4AMLxnsARU5eFTkTFB+nIksDgkCIEwHzuBaPXVe32Shrm7 EJ+7fF0wLeIBIQyiqqeQoOPBoZtFvcx/7w== X-Google-Smtp-Source: ABdhPJzXj4ayogrUeTfba8UBhpfZgzGMhUMB4GuchvM980klb4BZeBBcPtNRcApz1DjU5A7ycnjc7A== X-Received: by 2002:a37:4f12:: with SMTP id d18mr7141137qkb.378.1607376492153; Mon, 07 Dec 2020 13:28:12 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:11 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 6/8] nptl: Move cancel state out of cancelhandling Date: Mon, 7 Dec 2020 18:27:55 -0300 Message-Id: <20201207212757.3948164-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> References: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from previous version [1] * Rebased against master. --- The thread cancellation state is not accessed concurrently internally neither the pthread interface allows changing the state of a different thread than its own. By removing the cancel state out of the internal thread cancel handling state there is no need to check if cancelled bit was set in CAS operation. The code is also simplified: the CANCELLATION_P is replaced with a internal pthread_testcancel call and the CANCELSTATE_BIT{MASK} is removed. The second part of this patchset also keeps the pthread_setcanceltype as cancellation entrypoint by calling pthread_testcancel if the new type is PTHREAD_CANCEL_ASYNCHRONOUS. With this behavior pthread_setcancelstate does not require to act on cancellation if cancel type is asynchronous (is already handled either by pthread_setcanceltype or by the signal handler). Checked on x86_64-linux-gnu. [1] https://patchwork.sourceware.org/project/glibc/patch/20200520174819.1138124-1-adhemerval.zanella@linaro.org/ --- nptl/allocatestack.c | 1 + nptl/cancellation.c | 3 ++- nptl/cleanup_defer.c | 2 +- nptl/cleanup_defer_compat.c | 2 +- nptl/descr.h | 14 ++++++-------- nptl/pthreadP.h | 12 ------------ nptl/pthread_cancel.c | 3 ++- nptl/pthread_join_common.c | 5 ++++- nptl/pthread_setcancelstate.c | 36 +++-------------------------------- nptl/pthread_setcanceltype.c | 3 ++- nptl/pthread_testcancel.c | 11 ++++++++++- 11 files changed, 32 insertions(+), 60 deletions(-) diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index b7f9eeebf6..169ed41b9e 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -220,6 +220,7 @@ get_cached_stack (size_t *sizep, void **memp) /* Cancellation handling is back to the default. */ result->cancelhandling = 0; + result->cancelstate = PTHREAD_CANCEL_ENABLE; result->cleanup = NULL; /* No pending event. */ diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 826071321e..7e8cbe9fe1 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -45,7 +45,8 @@ __pthread_enable_asynccancel (void) oldval); if (__glibc_likely (curval == oldval)) { - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) { THREAD_SETMEM (self, result, PTHREAD_CANCELED); __do_cancel (); diff --git a/nptl/cleanup_defer.c b/nptl/cleanup_defer.c index 8ad9a90c50..33d4ea6eef 100644 --- a/nptl/cleanup_defer.c +++ b/nptl/cleanup_defer.c @@ -86,6 +86,6 @@ __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *buf) cancelhandling = curval; } - CANCELLATION_P (self); + __pthread_testcancel (); } } diff --git a/nptl/cleanup_defer_compat.c b/nptl/cleanup_defer_compat.c index 33e47888f2..a1ad291fcc 100644 --- a/nptl/cleanup_defer_compat.c +++ b/nptl/cleanup_defer_compat.c @@ -83,7 +83,7 @@ _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, cancelhandling = curval; } - CANCELLATION_P (self); + __pthread_testcancel (); } /* If necessary call the cleanup routine after we removed the diff --git a/nptl/descr.h b/nptl/descr.h index b172ee408b..258c485ef1 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -277,9 +277,6 @@ struct pthread /* Flags determining processing of cancellation. */ int cancelhandling; - /* Bit set if cancellation is disabled. */ -#define CANCELSTATE_BIT 0 -#define CANCELSTATE_BITMASK (0x01 << CANCELSTATE_BIT) /* Bit set if asynchronous cancellation mode is selected. */ #define CANCELTYPE_BIT 1 #define CANCELTYPE_BITMASK (0x01 << CANCELTYPE_BIT) @@ -301,11 +298,8 @@ struct pthread /* Mask for the rest. Helps the compiler to optimize. */ #define CANCEL_RESTMASK 0xffffff80 -#define CANCEL_ENABLED_AND_CANCELED(value) \ - (((value) & (CANCELSTATE_BITMASK | CANCELED_BITMASK | EXITING_BITMASK \ - | CANCEL_RESTMASK | TERMINATED_BITMASK)) == CANCELED_BITMASK) -#define CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS(value) \ - (((value) & (CANCELSTATE_BITMASK | CANCELTYPE_BITMASK | CANCELED_BITMASK \ +#define CANCEL_CANCELED_AND_ASYNCHRONOUS(value) \ + (((value) & (CANCELTYPE_BITMASK | CANCELED_BITMASK \ | EXITING_BITMASK | CANCEL_RESTMASK | TERMINATED_BITMASK)) \ == (CANCELTYPE_BITMASK | CANCELED_BITMASK)) @@ -409,6 +403,10 @@ struct pthread /* Used on strsignal. */ struct tls_internal_t tls_state; + /* Thread cancel state (PTHREAD_CANCEL_ENABLE or + PTHREAD_CANCEL_DISABLE). */ + unsigned char cancelstate; + /* This member must be last. */ char end_padding[]; diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 968adcdb6a..1a8518ef23 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -253,18 +253,6 @@ extern int __pthread_debug attribute_hidden; #endif -/* Cancellation test. */ -#define CANCELLATION_P(self) \ - do { \ - int cancelhandling = THREAD_GETMEM (self, cancelhandling); \ - if (CANCEL_ENABLED_AND_CANCELED (cancelhandling)) \ - { \ - THREAD_SETMEM (self, result, PTHREAD_CANCELED); \ - __do_cancel (); \ - } \ - } while (0) - - extern void __pthread_unwind (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute __attribute ((__noreturn__)) #if !defined SHARED && !IS_IN (libpthread) diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 88c1ab8f6a..5b2789d620 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -55,7 +55,8 @@ __pthread_cancel (pthread_t th) /* If the cancellation is handled asynchronously just send a signal. We avoid this if possible since it's more expensive. */ - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) + if (pd->cancelstate == PTHREAD_CANCEL_ENABLE + && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) { /* Mark the cancellation as "in progress". */ if (atomic_compare_and_exchange_bool_acq (&pd->cancelhandling, diff --git a/nptl/pthread_join_common.c b/nptl/pthread_join_common.c index 4293b072c8..2d23e83ced 100644 --- a/nptl/pthread_join_common.c +++ b/nptl/pthread_join_common.c @@ -59,7 +59,10 @@ __pthread_clockjoin_ex (pthread_t threadid, void **thread_return, && (pd->cancelhandling & (CANCELING_BITMASK | CANCELED_BITMASK | EXITING_BITMASK | TERMINATED_BITMASK)) == 0)) - && !CANCEL_ENABLED_AND_CANCELED (self->cancelhandling)) + && !(self->cancelstate == PTHREAD_CANCEL_ENABLE + && (pd->cancelhandling & (CANCELED_BITMASK | EXITING_BITMASK + | TERMINATED_BITMASK)) + == CANCELED_BITMASK)) /* This is a deadlock situation. The threads are waiting for each other to finish. Note that this is a "may" error. To be 100% sure we catch this error we would have to lock the data diff --git a/nptl/pthread_setcancelstate.c b/nptl/pthread_setcancelstate.c index 4d7f413e19..aa1c8073a8 100644 --- a/nptl/pthread_setcancelstate.c +++ b/nptl/pthread_setcancelstate.c @@ -31,39 +31,9 @@ __pthread_setcancelstate (int state, int *oldstate) self = THREAD_SELF; - int oldval = THREAD_GETMEM (self, cancelhandling); - while (1) - { - int newval = (state == PTHREAD_CANCEL_DISABLE - ? oldval | CANCELSTATE_BITMASK - : oldval & ~CANCELSTATE_BITMASK); - - /* Store the old value. */ - if (oldstate != NULL) - *oldstate = ((oldval & CANCELSTATE_BITMASK) - ? PTHREAD_CANCEL_DISABLE : PTHREAD_CANCEL_ENABLE); - - /* Avoid doing unnecessary work. The atomic operation can - potentially be expensive if the memory has to be locked and - remote cache lines have to be invalidated. */ - if (oldval == newval) - break; - - /* Update the cancel handling word. This has to be done - atomically since other bits could be modified as well. */ - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - { - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) - __do_cancel (); - - break; - } - - /* Prepare for the next round. */ - oldval = curval; - } + if (oldstate != NULL) + *oldstate = self->cancelstate; + self->cancelstate = state; return 0; } diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c index fcaae8abc7..cc0507ae04 100644 --- a/nptl/pthread_setcanceltype.c +++ b/nptl/pthread_setcanceltype.c @@ -53,7 +53,8 @@ __pthread_setcanceltype (int type, int *oldtype) oldval); if (__glibc_likely (curval == oldval)) { - if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval)) + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) { THREAD_SETMEM (self, result, PTHREAD_CANCELED); __do_cancel (); diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c index 30408c2008..cd937bb3a3 100644 --- a/nptl/pthread_testcancel.c +++ b/nptl/pthread_testcancel.c @@ -23,7 +23,16 @@ void __pthread_testcancel (void) { - CANCELLATION_P (THREAD_SELF); + struct pthread *self = THREAD_SELF; + int cancelhandling = THREAD_GETMEM (self, cancelhandling); + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && (cancelhandling & CANCELED_BITMASK) + && !(cancelhandling & EXITING_BITMASK) + && !(cancelhandling & TERMINATED_BITMASK)) + { + THREAD_SETMEM (self, result, PTHREAD_CANCELED); + __do_cancel (); + } } strong_alias (__pthread_testcancel, pthread_testcancel) hidden_def (__pthread_testcancel) From patchwork Mon Dec 7 21:27:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41336 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EDA4739450E5; Mon, 7 Dec 2020 21:28:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDA4739450E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376499; bh=w96kDclm7c5x4c7lv/2SYK5rnCzhSMvjUeNbuuRukjo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=msrls+oQaVzz5Fxjhnbbhgw1bjlw2aeCNzRlMjxGLSNl4WWYa8A4uCJkWpu+Ca3d/ YJZd+zw0JFCaDSkeLCYFcUXFIwQSX3Icacq08xYn5ErD9Om29yVJoE3CU11EImjZM8 JHk17vy4imAd8/7zG2lnAKqSph5628HUeLYPm7s4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id E099739450E5 for ; Mon, 7 Dec 2020 21:28:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E099739450E5 Received: by mail-qk1-x741.google.com with SMTP id h20so14173032qkk.4 for ; Mon, 07 Dec 2020 13:28:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w96kDclm7c5x4c7lv/2SYK5rnCzhSMvjUeNbuuRukjo=; b=I5/NwyCMd7UfjWFoOP0klkThDn40C9i9GUd2bDgeYz15JHaLjiU5BFt63AgLWOooj6 7NoljxmD++g7Lgu6qizzEK0YX/XmjtwocyzciyydmPsSGxcUs7n5I2D/7dFDcvij7gC2 5/CKJR7xtvTFll/qAkZ2KP1GIZ3RJdTRBR4fljgciXhepM7YJnehQnvvPA5JovZHYuTI hmDsfuq3TFTclk+/6h9xOjFKUlx54TSFZpe6MkcXBmjcjJcYcJEY/ks0ydz+AB87r3uh bGcKuZLm67qTYVLr5uyiu9yK6zIX5VwrLioZvq2gOtnbRikEqMX5swdXqJtQ4LZhX9nH XC0Q== X-Gm-Message-State: AOAM531GJRBJxu2DdWRfAxEPNCtpVfUG1C+oU8u2zpP3YlA1JMjLeMof Lqz9zm4eZH+lxt8ksNIYZBXiBBTYz0sBqQ== X-Google-Smtp-Source: ABdhPJzAWRd2t+ljGc8msIsVBEJiqToAbHzrEp9FgoV9X02QWUtQXBpVUtL9jbr1hBVE1oDhph9SDQ== X-Received: by 2002:a37:a14a:: with SMTP id k71mr26224321qke.33.1607376494051; Mon, 07 Dec 2020 13:28:14 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:13 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 7/8] nptl: Move cancel type out of cancelhandling Date: Mon, 7 Dec 2020 18:27:56 -0300 Message-Id: <20201207212757.3948164-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> References: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes from previous version [1] * Rebased against master. --- The thread cancellation type is not accessed concurrently internally neither its pthread interface allows changing the state of a different thread than its own. By removing the cancel state out of the internal thread cancel handling state there is no need to check if cancelled bit was set in CAS operation. It allows simplifing the cancellation wrappers and the CANCEL_CANCELED_AND_ASYNCHRONOUS is removed. Checked on x86_64-linux-gnu. [1] https://patchwork.sourceware.org/project/glibc/patch/20200520174819.1138124-2-adhemerval.zanella@linaro.org/ --- nptl/allocatestack.c | 1 + nptl/cancellation.c | 60 ++++++++++-------------------------- nptl/cleanup_defer.c | 46 +++------------------------ nptl/cleanup_defer_compat.c | 46 +++------------------------ nptl/descr.h | 14 +++------ nptl/nptl-init.c | 2 +- nptl/pthread_cancel.c | 5 ++- nptl/pthread_setcanceltype.c | 42 +++---------------------- nptl/pthread_testcancel.c | 2 +- 9 files changed, 43 insertions(+), 175 deletions(-) diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 169ed41b9e..a5da5e4337 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -221,6 +221,7 @@ get_cached_stack (size_t *sizep, void **memp) /* Cancellation handling is back to the default. */ result->cancelhandling = 0; result->cancelstate = PTHREAD_CANCEL_ENABLE; + result->canceltype = PTHREAD_CANCEL_DEFERRED; result->cleanup = NULL; /* No pending event. */ diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 7e8cbe9fe1..90974c0b18 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -32,31 +32,19 @@ attribute_hidden __pthread_enable_asynccancel (void) { struct pthread *self = THREAD_SELF; - int oldval = THREAD_GETMEM (self, cancelhandling); - while (1) - { - int newval = oldval | CANCELTYPE_BITMASK; - - if (newval == oldval) - break; - - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - { - if (self->cancelstate == PTHREAD_CANCEL_ENABLE - && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) - { - THREAD_SETMEM (self, result, PTHREAD_CANCELED); - __do_cancel (); - } + int oldval = THREAD_GETMEM (self, canceltype); + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_ASYNCHRONOUS); - break; - } + int ch = THREAD_GETMEM (self, cancelhandling); - /* Prepare the next round. */ - oldval = curval; + if (self->cancelstate == PTHREAD_CANCEL_ENABLE + && (ch & CANCELED_BITMASK) + && !(ch & EXITING_BITMASK) + && !(ch & TERMINATED_BITMASK)) + { + THREAD_SETMEM (self, result, PTHREAD_CANCELED); + __do_cancel (); } return oldval; @@ -70,36 +58,22 @@ __pthread_disable_asynccancel (int oldtype) { /* If asynchronous cancellation was enabled before we do not have anything to do. */ - if (oldtype & CANCELTYPE_BITMASK) + if (oldtype == PTHREAD_CANCEL_ASYNCHRONOUS) return; struct pthread *self = THREAD_SELF; - int newval; - - int oldval = THREAD_GETMEM (self, cancelhandling); - - while (1) - { - newval = oldval & ~CANCELTYPE_BITMASK; - - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - break; - - /* Prepare the next round. */ - oldval = curval; - } + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_DEFERRED); /* We cannot return when we are being canceled. Upon return the thread might be things which would have to be undone. The following loop should loop until the cancellation signal is delivered. */ - while (__builtin_expect ((newval & (CANCELING_BITMASK | CANCELED_BITMASK)) - == CANCELING_BITMASK, 0)) + int ch = THREAD_GETMEM (self, cancelhandling); + while (__glibc_unlikely ((ch & CANCELING_BITMASK) + && !(ch & CANCELED_BITMASK))) { - futex_wait_simple ((unsigned int *) &self->cancelhandling, newval, + futex_wait_simple ((unsigned int *) &self->cancelhandling, ch, FUTEX_PRIVATE); - newval = THREAD_GETMEM (self, cancelhandling); + ch = THREAD_GETMEM (self, cancelhandling); } } diff --git a/nptl/cleanup_defer.c b/nptl/cleanup_defer.c index 33d4ea6eef..3300b4df46 100644 --- a/nptl/cleanup_defer.c +++ b/nptl/cleanup_defer.c @@ -31,27 +31,9 @@ __pthread_register_cancel_defer (__pthread_unwind_buf_t *buf) ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf); ibuf->priv.data.cleanup = THREAD_GETMEM (self, cleanup); - int cancelhandling = THREAD_GETMEM (self, cancelhandling); - /* Disable asynchronous cancellation for now. */ - if (__glibc_unlikely (cancelhandling & CANCELTYPE_BITMASK)) - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - & ~CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - - ibuf->priv.data.canceltype = (cancelhandling & CANCELTYPE_BITMASK - ? PTHREAD_CANCEL_ASYNCHRONOUS - : PTHREAD_CANCEL_DEFERRED); + ibuf->priv.data.canceltype = THREAD_GETMEM (self, canceltype); + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_DEFERRED); /* Store the new cleanup handler info. */ THREAD_SETMEM (self, cleanup_jmp_buf, (struct pthread_unwind_buf *) buf); @@ -67,25 +49,7 @@ __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *buf) THREAD_SETMEM (self, cleanup_jmp_buf, ibuf->priv.data.prev); - int cancelhandling; - if (ibuf->priv.data.canceltype != PTHREAD_CANCEL_DEFERRED - && ((cancelhandling = THREAD_GETMEM (self, cancelhandling)) - & CANCELTYPE_BITMASK) == 0) - { - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - | CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - - __pthread_testcancel (); - } + THREAD_SETMEM (self, canceltype, ibuf->priv.data.canceltype); + if (ibuf->priv.data.canceltype == PTHREAD_CANCEL_ASYNCHRONOUS) + __pthread_testcancel (); } diff --git a/nptl/cleanup_defer_compat.c b/nptl/cleanup_defer_compat.c index a1ad291fcc..77655c1b0a 100644 --- a/nptl/cleanup_defer_compat.c +++ b/nptl/cleanup_defer_compat.c @@ -29,27 +29,9 @@ _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, buffer->__arg = arg; buffer->__prev = THREAD_GETMEM (self, cleanup); - int cancelhandling = THREAD_GETMEM (self, cancelhandling); - /* Disable asynchronous cancellation for now. */ - if (__glibc_unlikely (cancelhandling & CANCELTYPE_BITMASK)) - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - & ~CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - - buffer->__canceltype = (cancelhandling & CANCELTYPE_BITMASK - ? PTHREAD_CANCEL_ASYNCHRONOUS - : PTHREAD_CANCEL_DEFERRED); + buffer->__canceltype = THREAD_GETMEM (self, canceltype); + THREAD_SETMEM (self, canceltype, PTHREAD_CANCEL_DEFERRED); THREAD_SETMEM (self, cleanup, buffer); } @@ -64,27 +46,9 @@ _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, THREAD_SETMEM (self, cleanup, buffer->__prev); - int cancelhandling; - if (__builtin_expect (buffer->__canceltype != PTHREAD_CANCEL_DEFERRED, 0) - && ((cancelhandling = THREAD_GETMEM (self, cancelhandling)) - & CANCELTYPE_BITMASK) == 0) - { - while (1) - { - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, - cancelhandling - | CANCELTYPE_BITMASK, - cancelhandling); - if (__glibc_likely (curval == cancelhandling)) - /* Successfully replaced the value. */ - break; - - /* Prepare for the next round. */ - cancelhandling = curval; - } - - __pthread_testcancel (); - } + THREAD_SETMEM (self, canceltype, buffer->__canceltype); + if (buffer->__canceltype == PTHREAD_CANCEL_ASYNCHRONOUS) + __pthread_testcancel (); /* If necessary call the cleanup routine after we removed the current cleanup block from the list. */ diff --git a/nptl/descr.h b/nptl/descr.h index 258c485ef1..0aed19ccd7 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -277,9 +277,6 @@ struct pthread /* Flags determining processing of cancellation. */ int cancelhandling; - /* Bit set if asynchronous cancellation mode is selected. */ -#define CANCELTYPE_BIT 1 -#define CANCELTYPE_BITMASK (0x01 << CANCELTYPE_BIT) /* Bit set if canceling has been initiated. */ #define CANCELING_BIT 2 #define CANCELING_BITMASK (0x01 << CANCELING_BIT) @@ -295,13 +292,6 @@ struct pthread /* Bit set if thread is supposed to change XID. */ #define SETXID_BIT 6 #define SETXID_BITMASK (0x01 << SETXID_BIT) - /* Mask for the rest. Helps the compiler to optimize. */ -#define CANCEL_RESTMASK 0xffffff80 - -#define CANCEL_CANCELED_AND_ASYNCHRONOUS(value) \ - (((value) & (CANCELTYPE_BITMASK | CANCELED_BITMASK \ - | EXITING_BITMASK | CANCEL_RESTMASK | TERMINATED_BITMASK)) \ - == (CANCELTYPE_BITMASK | CANCELED_BITMASK)) /* Flags. Including those copied from the thread attribute. */ int flags; @@ -407,6 +397,10 @@ struct pthread PTHREAD_CANCEL_DISABLE). */ unsigned char cancelstate; + /* Thread cancel type (PTHREAD_CANCEL_DEFERRED or + PTHREAD_CANCEL_ASYNCHRONOUS). */ + unsigned char canceltype; + /* This member must be last. */ char end_padding[]; diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index 53b817715d..2202d44b95 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -156,7 +156,7 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx) THREAD_SETMEM (self, result, PTHREAD_CANCELED); /* Make sure asynchronous cancellation is still enabled. */ - if ((newval & CANCELTYPE_BITMASK) != 0) + if (self->canceltype == PTHREAD_CANCEL_ASYNCHRONOUS) /* Run the registered destructors and terminate the thread. */ __do_cancel (); diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 5b2789d620..266fd77284 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -56,7 +56,10 @@ __pthread_cancel (pthread_t th) signal. We avoid this if possible since it's more expensive. */ if (pd->cancelstate == PTHREAD_CANCEL_ENABLE - && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) + && pd->canceltype == PTHREAD_CANCEL_ASYNCHRONOUS + && (newval & CANCELED_BITMASK) + && !(newval & EXITING_BITMASK) + && !(newval & TERMINATED_BITMASK)) { /* Mark the cancellation as "in progress". */ if (atomic_compare_and_exchange_bool_acq (&pd->cancelhandling, diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c index cc0507ae04..d8cb54736d 100644 --- a/nptl/pthread_setcanceltype.c +++ b/nptl/pthread_setcanceltype.c @@ -29,43 +29,11 @@ __pthread_setcanceltype (int type, int *oldtype) volatile struct pthread *self = THREAD_SELF; - int oldval = THREAD_GETMEM (self, cancelhandling); - while (1) - { - int newval = (type == PTHREAD_CANCEL_ASYNCHRONOUS - ? oldval | CANCELTYPE_BITMASK - : oldval & ~CANCELTYPE_BITMASK); - - /* Store the old value. */ - if (oldtype != NULL) - *oldtype = ((oldval & CANCELTYPE_BITMASK) - ? PTHREAD_CANCEL_ASYNCHRONOUS : PTHREAD_CANCEL_DEFERRED); - - /* Avoid doing unnecessary work. The atomic operation can - potentially be expensive if the memory has to be locked and - remote cache lines have to be invalidated. */ - if (oldval == newval) - break; - - /* Update the cancel handling word. This has to be done - atomically since other bits could be modified as well. */ - int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval, - oldval); - if (__glibc_likely (curval == oldval)) - { - if (self->cancelstate == PTHREAD_CANCEL_ENABLE - && CANCEL_CANCELED_AND_ASYNCHRONOUS (newval)) - { - THREAD_SETMEM (self, result, PTHREAD_CANCELED); - __do_cancel (); - } - - break; - } - - /* Prepare for the next round. */ - oldval = curval; - } + if (oldtype != NULL) + *oldtype = self->canceltype; + self->canceltype = type; + if (type == PTHREAD_CANCEL_ASYNCHRONOUS) + __pthread_testcancel (); return 0; } diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c index cd937bb3a3..cf518bb8a8 100644 --- a/nptl/pthread_testcancel.c +++ b/nptl/pthread_testcancel.c @@ -34,5 +34,5 @@ __pthread_testcancel (void) __do_cancel (); } } -strong_alias (__pthread_testcancel, pthread_testcancel) +weak_alias (__pthread_testcancel, pthread_testcancel) hidden_def (__pthread_testcancel) From patchwork Mon Dec 7 21:27:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41337 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7BD72394848E; Mon, 7 Dec 2020 21:28:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BD72394848E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607376499; bh=nPg49SGlmAqdkgyV7YRKmtHT8BWK/zMk4sX3ESMmTHI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=mZ5T/gHH9YSozfnXE4WygMzzFVKKYhjS5YiAr/RscwmIm4ey4VHBVcGBMRH1jZh6B MUC4vu0UXmEqN8n+/d0hTM7ucrsK33+znmi0CWaZjiqccJvlFwYwjYtUj+d+X1HHTj vQEA/edmzmeXSlJvMeOnndWB5iAKyrPSABRA2qEQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 573C939450DA for ; Mon, 7 Dec 2020 21:28:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 573C939450DA Received: by mail-qk1-x741.google.com with SMTP id q22so14156665qkq.6 for ; Mon, 07 Dec 2020 13:28:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nPg49SGlmAqdkgyV7YRKmtHT8BWK/zMk4sX3ESMmTHI=; b=Js2TyYCINhsNL6EXf/U03wlRGXvDS8aXPtEF3hclPyIU5GzFJ6PAE3mQOXJW32ie9K LMYTs5yrWirODEJN9PHjrt61vlDDKbXWNlPPc4zwbfRX80kS5VgQZq8ySxASWgLWURqN zGl7wUGe4BGGAFInSdU+HYZX80eR0LUgK/Kbu5thXi575P4Ec3TV8M4YYRSsuNptUJxv JYCt/PyFk3SGkTyFGukcB3C2m29HnvMS3yJjFQisKmuImV69qM6ml3xQD9au3ANQE9bn 5UpQpmAkrS1pLimLObGgqJX0FUdyhLurH7976mOya0DZ8qTuwuRUw7N2alkOlN4ogtuc jdjw== X-Gm-Message-State: AOAM533HZBRHOWUeZixJj3BayrsKGCbonRR1qYT6nhYQOKKIrvVJFTj8 xOWPBF8XYhL6eYuXgCDbXPEqCUnqkx1bmQ== X-Google-Smtp-Source: ABdhPJx+bE+Jc3zeUniRUuOuW29R0PDaLRhQTS45SjNZHV8tfnftTPgQbXfa6dPzlETBt2YKLQz5EA== X-Received: by 2002:ae9:ddc1:: with SMTP id r184mr26039366qkf.266.1607376495746; Mon, 07 Dec 2020 13:28:15 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id o29sm12832317qtl.7.2020.12.07.13.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:28:15 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 8/8] nptl: Use pthread_kill on pthread_cancel Date: Mon, 7 Dec 2020 18:27:57 -0300 Message-Id: <20201207212757.3948164-8-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> References: <20201207212757.3948164-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It consolidates the tgkill call and it is the first step of making pthread_cancel async-signal-safe. Checked on x86_64-linux-gnu. --- nptl/Versions | 2 ++ nptl/pthreadP.h | 2 ++ nptl/pthread_cancel.c | 7 +------ nptl/pthread_kill.c | 19 +++++++++++++------ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/nptl/Versions b/nptl/Versions index 7cfe39a91c..ec68f8bb3d 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -66,6 +66,8 @@ libc { __pthread_attr_copy; __pthread_getattr_default_np; __pthread_attr_setsigmask_internal; + # Used for thread cancellation. + __pthread_kill_internal; } } diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 1a8518ef23..40499d6881 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -514,6 +514,8 @@ extern int __pthread_equal (pthread_t thread1, pthread_t thread2); extern int __pthread_detach (pthread_t th); extern int __pthread_cancel (pthread_t th); libc_hidden_proto (__pthread_kill) +extern int __pthread_kill_internal (pthread_t threadid, int signo); +libc_hidden_proto (__pthread_kill_internal); extern void __pthread_exit (void *value) __attribute__ ((__noreturn__)); extern int __pthread_join (pthread_t threadid, void **thread_return); extern int __pthread_setcanceltype (int type, int *oldtype); diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 266fd77284..766dfca260 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -69,12 +69,7 @@ __pthread_cancel (pthread_t th) /* The cancellation handler will take care of marking the thread as canceled. */ - pid_t pid = __getpid (); - - int val = INTERNAL_SYSCALL_CALL (tgkill, pid, pd->tid, - SIGCANCEL); - if (INTERNAL_SYSCALL_ERROR_P (val)) - result = INTERNAL_SYSCALL_ERRNO (val); + __pthread_kill_internal (th, SIGCANCEL); break; } diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index cf12fa743f..97f1bf2b4b 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -20,13 +20,8 @@ #include int -__pthread_kill (pthread_t threadid, int signo) +__pthread_kill_internal (pthread_t threadid, int signo) { - /* Disallow sending the signal we use for cancellation, timers, - for the setxid implementation. */ - if (__is_internal_signal (signo)) - return EINVAL; - sigset_t set; __libc_signal_block_all (&set); @@ -57,5 +52,17 @@ __pthread_kill (pthread_t threadid, int signo) return val; } +libc_hidden_def (__pthread_kill_internal) + +int +__pthread_kill (pthread_t threadid, int signo) +{ + /* Disallow sending the signal we use for cancellation, timers, + for the setxid implementation. */ + if (__is_internal_signal (signo)) + return EINVAL; + + return __pthread_kill_internal (threadid, signo); +} libc_hidden_def (__pthread_kill) weak_alias (__pthread_kill, pthread_kill)