From patchwork Thu Jun 10 19:36:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 43823 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 3D58C399E046 for ; Thu, 10 Jun 2021 19:37:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D58C399E046 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623353827; bh=g5oO87st4g/ma7FbKgGfP5j8VRqnKB1uliA1LnQevcw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=UpFEVfG3NS5SWgJACFYB5AJ6gAuG8GCdG13Bz4F+PKIyurTSndKAtpJw3rKkS7rgs VCihaevDTLXP9GHWRh45mQ7f9V9xSuBetH3DeKXL6eV9f+jeFpDOoxRbrOg37XwdHu MENuHHIyN3WMzuZzXhFoPBCHyr9gzWPx1550t7Po= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id 268643865460 for ; Thu, 10 Jun 2021 19:36:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 268643865460 Received: by mail-qt1-x836.google.com with SMTP id u20so792878qtx.1 for ; Thu, 10 Jun 2021 12:36:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=g5oO87st4g/ma7FbKgGfP5j8VRqnKB1uliA1LnQevcw=; b=KLJhmHBJsgiP4Q2fKoWQi3kYTw5w+lc7v2GSgXTf6KWFRAp9LBZPr3jJ+Wx2/moouR +u+vKQ0gZAS/DM5Q9VaGiOG266KRC8Nmyz54mlC9dEe/FGfD/Ugztjn4t7Q0MMZrH/KF M1Klahy3cKIZ0CE8hNsTfghHnn/7hQ8w85z2iP7FCKc1csoUPb2RpBwUsn5uTNGTFFlN NuJXvHaxHjqm961Gx+PJxdCBK3Ir/23+oxrZ6czmwMpCaMZGnDTYsi8I+xzUltaKbo0q wR7siwnwoXSFRs7D4twoFC4Zcfy9WpdFSw3dfoTB6yA75Fq1STIf8jUABK3szAgzOPOR LsGA== X-Gm-Message-State: AOAM532rNB5h6d5ceDCzM3mUQdWDt/iwcmUIjqrC+VQrUSKdgaLlcSDj 2z2Cnq104zJxiuvk8WwUQpWe8CZXYQ99nA== X-Google-Smtp-Source: ABdhPJzjYZT4uNsWLiLfAU5AlyGS3yBwqCuwf/3Sj4v07iWtAwn8kDMaNIl4DnZlHdUuayulr7uoVg== X-Received: by 2002:ac8:7586:: with SMTP id s6mr413195qtq.117.1623353804337; Thu, 10 Jun 2021 12:36:44 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id i21sm3012583qkl.20.2021.06.10.12.36.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 12:36:44 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 0/6] More NPTL fixes Date: Thu, 10 Jun 2021 16:36:33 -0300 Message-Id: <20210610193639.3650754-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This patch fixes a couple of NPTL issues and continue to refactor the cancellation code to simplify the required synchronization. Adhemerval Zanella (6): nptl: Fix tst-cancel7 and tst-cancelx7 race condition (BZ #14232) nptl: Set cancellation type and state on pthread_exit nptl: Handle robust PI mutexes for !__ASSUME_SET_ROBUST_LIST nptl: Do not use pthread set_tid_address as state synchronization (BZ #19951) nptl: Move setxid flag out of cancelhandling nptl: Replace struct thread cancelhandling field nptl/Makefile | 5 +- nptl/allocatestack.c | 5 +- nptl/cancellation.c | 17 ++- nptl/descr.h | 44 ++++---- nptl/nptl-stack.h | 2 +- nptl/nptl_free_tcb.c | 22 ++-- nptl/nptl_setxid.c | 49 ++------- nptl/pthreadP.h | 21 ++-- nptl/pthread_cancel.c | 11 +- nptl/pthread_clockjoin.c | 2 +- nptl/pthread_create.c | 111 +++++++++++--------- nptl/pthread_detach.c | 36 +++---- nptl/pthread_exit.c | 4 +- nptl/pthread_getattr_np.c | 2 +- nptl/pthread_join.c | 2 +- nptl/pthread_join_common.c | 127 ++++++++-------------- nptl/pthread_testcancel.c | 11 +- nptl/pthread_timedjoin.c | 2 +- nptl/pthread_tryjoin.c | 18 ++-- nptl/tst-cancel7.c | 96 ++++++++--------- nptl/tst-cleanup5.c | 157 ++++++++++++++++++++++++++++ nptl_db/structs.def | 2 +- nptl_db/td_thr_get_info.c | 16 ++- nptl_db/td_thr_getfpregs.c | 9 +- nptl_db/td_thr_getgregs.c | 9 +- nptl_db/td_thr_setfpregs.c | 9 +- nptl_db/td_thr_setgregs.c | 9 +- sysdeps/hppa/nptl/tcb-offsets.sym | 1 - sysdeps/i386/nptl/tcb-offsets.sym | 1 - sysdeps/nptl/dl-tls_init_tp.c | 4 +- sysdeps/nptl/libc_start_call_main.h | 7 ++ sysdeps/pthread/tst-thrd-detach.c | 16 ++- sysdeps/sh/nptl/tcb-offsets.sym | 1 - sysdeps/x86_64/nptl/tcb-offsets.sym | 4 - 34 files changed, 448 insertions(+), 384 deletions(-) create mode 100644 nptl/tst-cleanup5.c