Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 28 Feb 2002 17:02:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 28 Feb 2002 17:00:11 -0500 Received: from dell-paw-3.cambridge.redhat.com ([195.224.55.237]:39408 "HELO executor.cambridge.redhat.com") by vger.kernel.org with SMTP id ; Thu, 28 Feb 2002 16:57:57 -0500 To: Linus Torvalds Cc: David Howells , linux-kernel@vger.kernel.org Subject: Re: thread groups bug? In-Reply-To: Message from Linus Torvalds of "Thu, 28 Feb 2002 09:16:47 PST." User-Agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?UTF-8?B?VW5l?= =?UTF-8?B?Ymlnb3J58m1hZQ==?=) APEL/10.3 Emacs/21.1 (i386-redhat-linux-gnu) (with unibyte mode) MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Date: Thu, 28 Feb 2002 21:57:55 +0000 Message-ID: <15283.1014933475@warthog.cambridge.redhat.com> From: David Howells Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > When they have the same TGID, they _are_ the same thread group. Apparently not so... Doing an execve() on the master thread breaks this internally by removing the master thread from the thread-group ring without resetting the TGID on all subsidiary threads. So if one of the subsidiary threads thinks its TGID is x before an execve on the master, then if it tries to use that TGID after the execve on the master, it will affect the master's new thread group and not itself. > There is absolutely _zero_ correlation between thread ID and MM. Never has > been, never will be. An execve() is a total non-event from a TGID > perspective. Except that the execve() _can_ (a) change the TGID and (b) result in two effective thread groups of the same TGID as far as the kernel is concerned. > If you expect POSIX behaviour, you do not do execve's from the master. > It's that simple. My concern is not so much dealing with POSIX behaviour as coping with behaviour that can happen without getting snookered. David - 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/