From patchwork Fri Nov 13 01:24:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1399483 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@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org 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 4CXLNn1jxmz9sTK for ; Fri, 13 Nov 2020 12:24:41 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3AB2F3857838; Fri, 13 Nov 2020 01:24:38 +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 C7ACE3858024 for ; Fri, 13 Nov 2020 01:24:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C7ACE3858024 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C5D35DBF; Fri, 13 Nov 2020 02:24:34 +0100 (CET) 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 5YqJaIPgx1Q5; Fri, 13 Nov 2020 02:24:34 +0100 (CET) Received: from function.youpi.perso.aquilenet.fr (lfbn-bor-1-56-204.w90-50.abo.wanadoo.fr [90.50.148.204]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 13757BE4; Fri, 13 Nov 2020 02:24:33 +0100 (CET) Received: from samy by function.youpi.perso.aquilenet.fr with local (Exim 4.94) (envelope-from ) id 1kdNpI-005iAp-O1; Fri, 13 Nov 2020 02:24:32 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd, commited] hurd: initialize libpthread before starting the signal thread Date: Fri, 13 Nov 2020 02:24:32 +0100 Message-Id: <20201113012432.1361402-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 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.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: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" We cannot rely on csu calling __pthread_initialize_minimal before posixland_init, in some cases _init gets called before that. --- hurd/hurdinit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hurd/hurdinit.c b/hurd/hurdinit.c index 06a2d3b7fd..7faa51b352 100644 --- a/hurd/hurdinit.c +++ b/hurd/hurdinit.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "set-hooks.h" #include "hurdmalloc.h" /* XXX */ @@ -116,6 +117,11 @@ _hurd_libc_proc_init (char **argv) { if (_hurd_portarray) { + /* We will start the signal thread, so we need to initialize libpthread + * if linked in. */ + if (__pthread_initialize_minimal != NULL) + __pthread_initialize_minimal (); + /* Tell the proc server we exist, if it does. */ if (_hurd_portarray[INIT_PORT_PROC] != MACH_PORT_NULL) _hurd_new_proc_init (argv, _hurd_intarray, _hurd_intarraysize);