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: 1490629 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=LyaqzLzD; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G1Dkm6jxmz9sSs for ; Fri, 11 Jun 2021 05:37:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A23A399C8B6 for ; Thu, 10 Jun 2021 19:37:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A23A399C8B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623353820; bh=g5oO87st4g/ma7FbKgGfP5j8VRqnKB1uliA1LnQevcw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LyaqzLzD1Ra3oKy5eFySlLZoWf9STBSZ0b7ntL2Yi4cW2Oat46eJecXPGpBgJ7qza kNu2W9SawOSXYN7b0Fu5p5EhV+3W0V12rJ3x4LlV46DG3PeXYyGp7bkFyIFlZJU1lk +Hd2YfL2hZLf4ycn59dmBb8Il4oeSuMN+BN+v2cI= 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+incoming=patchwork.ozlabs.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