From patchwork Sun Mar 1 17:00:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 130908 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id C4C6B4BA2E1D for ; Sun, 1 Mar 2026 17:00:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4C6B4BA2E1D X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id C8AA84BA2E0E for ; Sun, 1 Mar 2026 17:00:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8AA84BA2E0E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C8AA84BA2E0E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772384418; cv=none; b=RFJKru77a1Pi2wXPFI42TBaDgVqec4TebTMiSg/YWF7jVFA7nyHEkWshu64YBuf2NXmZj1k7a/A1Vz9DPGPbksK0quo8Ih226XDC8dCsEZETMebZ+FpidsV621Jm5/OR62LcuBkVb6BExFp8rl/tB3ZS8FaQ5tzi1Uyh3dI88bs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772384418; c=relaxed/simple; bh=OwBFs5BAWcqQm5xPf2cVomPoNjXwmWIIuYKXbyY3iMo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bIgO4OmAlZa3M4JeafCtZmBd/PQum1lP+OkmLoogqw4zNhoKyoDWeyHb0BFw+UplRaUryA502RL0gAS6UolKn7vTrIEgumzZ8Ir8POUabN89sQ/p8nxG6Bp1Kwtg0YZX2G6R/RQx4kvamPrlwnxUK43E6Zjb9vUk/6XNxCIDdsU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8AA84BA2E0E Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id D6150A05A6; Sun, 1 Mar 2026 18:00:17 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qneCARGv3y3H; Sun, 1 Mar 2026 18:00:17 +0100 (CET) Received: from end (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 9FDC4A0531; Sun, 1 Mar 2026 18:00:17 +0100 (CET) Received: from samy by end with local (Exim 4.99.1) (envelope-from ) id 1vwk9R-0000000Eqc6-0yI5; Sun, 01 Mar 2026 18:00:17 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] htl: Fix mt-safeness of libio Date: Sun, 1 Mar 2026 18:00:15 +0100 Message-ID: <20260301170015.3538830-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Since d2e04918833 ("Single threaded stdio optimization") we are supposed to call _IO_enable_locks when creating the first thread, but that commit missed doing it for htl. --- htl/pt-create.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htl/pt-create.c b/htl/pt-create.c index ef9e411f22..2a43285372 100644 --- a/htl/pt-create.c +++ b/htl/pt-create.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -250,6 +251,9 @@ __pthread_create_internal (struct __pthread **thread, avoid calling pthread_self), read it before starting the thread. */ *thread = pthread; + if (start_routine) + _IO_enable_locks (); + /* Schedule the new thread. */ err = __pthread_thread_start (pthread); if (err)