From patchwork Sun Jul 11 17:54:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 44310 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 5D8C9383D034 for ; Sun, 11 Jul 2021 17:54:50 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) by sourceware.org (Postfix) with ESMTPS id 015183840002 for ; Sun, 11 Jul 2021 17:54:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 015183840002 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 5607E382; Sun, 11 Jul 2021 19:54:36 +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 zzeLT1CCe09e; Sun, 11 Jul 2021 19:54:35 +0200 (CEST) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 541F91B3; Sun, 11 Jul 2021 19:54:35 +0200 (CEST) Received: from samy by begin with local (Exim 4.94.2) (envelope-from ) id 1m2df0-00BFlV-1E; Sun, 11 Jul 2021 19:54:34 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited] hurd _Fork: Drop duplicate malloc_fork_lock calls Date: Sun, 11 Jul 2021 19:54:34 +0200 Message-Id: <20210711175434.2682166-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spamd-Bar: +++++ X-Rspamd-Server: hera Authentication-Results: hera.aquilenet.fr X-Rspamd-Queue-Id: 5607E382 X-Spamd-Result: default: False [5.00 / 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)[] X-Spam-Status: No, score=-11.6 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This was put in __libc_fork by c32c868ab8b2 ("posix: Add _Fork [BZ #4737]") so we need to avoid locking them again in _Fork called by __libc_lock, otherwise we deadlock. --- sysdeps/mach/hurd/_Fork.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sysdeps/mach/hurd/_Fork.c b/sysdeps/mach/hurd/_Fork.c index df4ee05faa..75d45d6cad 100644 --- a/sysdeps/mach/hurd/_Fork.c +++ b/sysdeps/mach/hurd/_Fork.c @@ -119,7 +119,6 @@ retry: handlers may use malloc, and the libio list lock has an indirect malloc dependency as well (via the getdelim function). */ - call_function_static_weak (__malloc_fork_lock_parent); _hurd_malloc_fork_prepare (); newtask = MACH_PORT_NULL; @@ -588,7 +587,6 @@ retry: /* Release malloc locks. */ _hurd_malloc_fork_parent (); - call_function_static_weak (__malloc_fork_unlock_parent); /* Run things that want to run in the parent to restore it to normality. Usually prepare hooks and parent hooks are @@ -662,7 +660,6 @@ retry: /* Release malloc locks. */ _hurd_malloc_fork_child (); - call_function_static_weak (__malloc_fork_unlock_child); /* Run things that want to run in the child task to set up. */ RUN_HOOK (_hurd_fork_child_hook, ());