From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: proced: ppid of process ID 0 can be 0 Date: Wed, 24 Dec 2008 20:29:59 +0200 Message-ID: References: <18765.19040.568030.246241@tfkp04.physik.uni-erlangen.de> <18765.29820.997276.703222@tfkp04.physik.uni-erlangen.de> <18765.51840.943986.608296@tfkp04.physik.uni-erlangen.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1230143419 6081 80.91.229.12 (24 Dec 2008 18:30:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Dec 2008 18:30:19 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org, Roland.Winkler@physik.uni-erlangen.de To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 24 19:31:25 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LFYVw-0007T7-0d for ged-emacs-devel@m.gmane.org; Wed, 24 Dec 2008 19:31:24 +0100 Original-Received: from localhost ([127.0.0.1]:55252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFYUj-0004Db-4H for ged-emacs-devel@m.gmane.org; Wed, 24 Dec 2008 13:30:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFYUf-0004DW-6m for emacs-devel@gnu.org; Wed, 24 Dec 2008 13:30:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFYUc-0004DF-Qe for emacs-devel@gnu.org; Wed, 24 Dec 2008 13:30:03 -0500 Original-Received: from [199.232.76.173] (port=38485 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFYUc-0004D9-Hd for emacs-devel@gnu.org; Wed, 24 Dec 2008 13:30:02 -0500 Original-Received: from mtaout3.012.net.il ([84.95.2.7]:12126) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LFYUc-000088-3c for emacs-devel@gnu.org; Wed, 24 Dec 2008 13:30:02 -0500 Original-Received: from conversion-daemon.i_mtaout3.012.net.il by i_mtaout3.012.net.il (HyperSendmail v2004.12) id <0KCE002008Q9BV00@i_mtaout3.012.net.il> for emacs-devel@gnu.org; Wed, 24 Dec 2008 20:32:32 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.252.83]) by i_mtaout3.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KCE00E858U7JLC1@i_mtaout3.012.net.il>; Wed, 24 Dec 2008 20:32:32 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:107274 Archived-At: > From: Stefan Monnier > Cc: Roland.Winkler@physik.uni-erlangen.de, lekktu@gmail.com, emacs-devel@gnu.org > Date: Wed, 24 Dec 2008 11:47:12 -0500 > > >> > It's not hypothetical, I've seen such cases and reported them to > >> > Roland. > >> What were those cases? > > Processes that disappeared while Emacs was reading /proc, for example. > > Then don't return them at all How? I don't know enough about Linux kernel internals to decide which attribute's absence means that the process died while Emacs was reading /proc. For examples, quite a few lack the command line, but I don't think that's a good reason to not return such processes. In addition, judging by comments in procps sources, the set of attributes depend on the version of the Linux kernel. If you (or someone else) can define a clear logic, one that won't change with the next release of the kernel, then perhaps we could avoid returning such processes. Reading /proc is inherently prone to race conditions with the kernel, unless someone can suggest a way of getting from /proc a consistent snapshot of the set of system processes. I don't see how to overcome this difficulty at the primitive level.