Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753973AbbHTOsm (ORCPT ); Thu, 20 Aug 2015 10:48:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:47427 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbbHTOsi (ORCPT ); Thu, 20 Aug 2015 10:48:38 -0400 From: Andreas Schwab To: Roland McGrath Cc: Ernie Petrides , Andrew Morton , Jakub Jelinek , "Ulrich Drepper \\, Ingo Molnar" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] fix for zeroed user-space tids in multi-threaded core dumps References: <200610260141.k9Q1fgUW026204@pasta.boston.redhat.com> <20061027015930.40C67180057@magilla.sf.frob.com> X-Yow: I have a TINY BOWL in my HEAD Date: Thu, 20 Aug 2015 16:48:35 +0200 In-Reply-To: <20061027015930.40C67180057@magilla.sf.frob.com> (Roland McGrath's message of "Thu, 26 Oct 2006 18:59:30 -0700 (PDT)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1645 Lines: 36 Roland McGrath writes: > [PATCH] Disable CLONE_CHILD_CLEARTID for abnormal exit. > > The CLONE_CHILD_CLEARTID flag is used by NPTL to have its threads > communicate via memory/futex when they exit, so pthread_join can > synchronize using a simple futex wait. The word of user memory where NPTL > stores a thread's own TID is what it passes; this gets reset to zero at > thread exit. > > It is not desireable to touch this user memory when threads are dying due > to a fatal signal. A core dump is more usefully representative of the > dying program state if the threads live at the time of the crash have their > NPTL data structures unperturbed. The userland expectation of > CLONE_CHILD_CLEARTID has only ever been that it works for a thread making > an _exit system call. This breaks nscd. It uses CLONE_CHILD_CLEARTID to clear the nscd_certainly_running flag in the shared databases, so that the clients are notified when nscd is restarted. Now, when nscd uses a non-persistent database, the clients that have it mapped keep thinking the database is being updated by nscd, when in fact nscd has created a new (anonymous) one (for non-persistent databases it uses an unlinked file as backend). Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/