From patchwork Thu Aug 28 18:31:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 384001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49438140107 for ; Fri, 29 Aug 2014 04:33:28 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=Z650q8i5mfGvJZatO+c0oCy84K1OY2 mcB3sVi0UaO77qoTIffMKicEFt10CGgWnwV72XH7U62trnuw0cbWRIFjwo7yhcCs MJ/9GGwK3nHOxbEk3KzCG9GzywMhc8+mUI2k+wmKes3nttD1rbBQUzh+bJ47jSfe WC1+MjH4qPgdU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=dp3+s7Y6AX/PSq8+6wJBOadzfMQ=; b=IlFe EHTH+s6pfz9RE05qv9jI59n7hAnwLc9VkNiPNR0xuh/2JStX294ahDgWgHHG77Ta z9nb4DV4T4CqdkT7XTE6w3AIidF4MWbdUzlA43IGt7KlwAtB12R0IEeHaDgxuSxs /R3h0h7iNbJiUsQw8pDRUzqGjysvzSqJ+X4PCus= Received: (qmail 5088 invoked by alias); 28 Aug 2014 18:32:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 5040 invoked by uid 89); 28 Aug 2014 18:32:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: toccata.ens-lyon.org Date: Thu, 28 Aug 2014 20:31:57 +0200 From: Samuel Thibault To: Roland McGrath Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: Re: [PATCH,Hurd] Fix hang on fork Message-ID: <20140828183157.GH3011@type.youpi.perso.aquilenet.fr> Mail-Followup-To: Roland McGrath , libc-alpha@sourceware.org, bug-hurd@gnu.org References: <20140827230625.GW3343@type.youpi.perso.aquilenet.fr> <20140828182108.799512C3A5D@topped-with-meat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140828182108.799512C3A5D@topped-with-meat.com> User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) Roland McGrath, le Thu 28 Aug 2014 11:21:08 -0700, a écrit : > Fix comment formatting, put space before paren, Right, I really need to teach my editor to do the comments properly automatically... > write a ChangeLog entry. This is what I had put, is some information still missing? * sysdeps/mach/hurd/fork.c (__fork): Lock SS->lock around __proc_dostop() call. Signed-off-by: Samuel Thibault --- sysdeps/mach/hurd/fork.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c index ab11bab..1f0b8a3 100644 --- a/sysdeps/mach/hurd/fork.c +++ b/sysdeps/mach/hurd/fork.c @@ -122,9 +122,13 @@ __fork (void) ports_locked = 1; + /* Keep our SS locked while stopping other threads, so they don't get a + chance to be having it locked in the copied space. */ + __spin_lock (&ss->lock); /* Stop all other threads while copying the address space, so nothing changes. */ err = __proc_dostop (_hurd_ports[INIT_PORT_PROC].port, ss->thread); + __spin_unlock (&ss->lock); if (!err) { stopped = 1;