From patchwork Sun Sep 26 00:42:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1532857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 4HH6Rr4QZwz9t54 for ; Sun, 26 Sep 2021 10:42:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 50139385801A for ; Sun, 26 Sep 2021 00:42:29 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id CDEF43858403 for ; Sun, 26 Sep 2021 00:42:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CDEF43858403 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8A8BB120; Sun, 26 Sep 2021 02:42:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ymq6MS1rPtgE; Sun, 26 Sep 2021 02:42:16 +0200 (CEST) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id C0875FC; Sun, 26 Sep 2021 02:42:16 +0200 (CEST) Received: from samy by begin with local (Exim 4.95-RC2) (envelope-from ) id 1mUIFD-00AogH-Ql; Sun, 26 Sep 2021 02:42:15 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited] htl: Fix sigset of main thread Date: Sun, 26 Sep 2021 02:42:15 +0200 Message-Id: <20210926004215.2578090-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Spamd-Bar: ++++ X-Rspamd-Server: hera Authentication-Results: hera.aquilenet.fr X-Rspamd-Queue-Id: 8A8BB120 X-Spamd-Result: default: False [4.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_MISSING_CHARSET(2.50)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; MID_CONTAINS_FROM(1.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; BAYES_HAM(-0.01)[51.08%] X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" d482ebfa6785 ('htl: Keep thread signals blocked during its initialization') fixed not letting signals get delivered too early during thread creation, but it also affected the main thread, thus making it block signals by default. We need to just let the main thread sigset as it is. --- htl/pt-create.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htl/pt-create.c b/htl/pt-create.c index a6c9ab3e93..d30c27fd36 100644 --- a/htl/pt-create.c +++ b/htl/pt-create.c @@ -213,8 +213,11 @@ __pthread_create_internal (struct __pthread **thread, err = __pthread_sigstate (_pthread_self (), 0, 0, &pthread->init_sigset, 0); assert_perror (err); - /* But block the signals for now, until the thread is fully initialized. */ - __sigfillset (&sigset); + if (start_routine) + /* But block the signals for now, until the thread is fully initialized. */ + __sigfillset (&sigset); + else + sigset = pthread->init_sigset; err = __pthread_sigstate (pthread, SIG_SETMASK, &sigset, 0, 1); assert_perror (err);