From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: leak in make-network-process Date: Tue, 30 Dec 2008 16:18:28 -0500 Message-ID: References: <200812221802.mBMI28aU001131@mothra.ics.uci.edu> <200812291910.mBTJAEUT027466@mothra.ics.uci.edu> <87d4fa8l4x.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230671938 15610 80.91.229.12 (30 Dec 2008 21:18:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2008 21:18:58 +0000 (UTC) Cc: Dan Nicolaescu , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 30 22:20:05 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 1LHm0K-0001oC-3A for ged-emacs-devel@m.gmane.org; Tue, 30 Dec 2008 22:19:56 +0100 Original-Received: from localhost ([127.0.0.1]:51506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHlz6-0008AV-5U for ged-emacs-devel@m.gmane.org; Tue, 30 Dec 2008 16:18:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHlz1-00089g-Au for emacs-devel@gnu.org; Tue, 30 Dec 2008 16:18:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHlyw-00088L-8O for emacs-devel@gnu.org; Tue, 30 Dec 2008 16:18:34 -0500 Original-Received: from [199.232.76.173] (port=50523 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHlyw-00088I-39 for emacs-devel@gnu.org; Tue, 30 Dec 2008 16:18:30 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:4350 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LHlyv-0005na-NE for emacs-devel@gnu.org; Tue, 30 Dec 2008 16:18:29 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYEAK0eWklLd+aG/2dsb2JhbACBbMtLhkSBZw X-IronPort-AV: E=Sophos;i="4.36,304,1228107600"; d="scan'208";a="31621506" Original-Received: from 75-119-230-134.dsl.teksavvy.com (HELO pastel.home) ([75.119.230.134]) by ironport2-out.teksavvy.com with ESMTP; 30 Dec 2008 16:18:27 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 4AED18CF4; Tue, 30 Dec 2008 16:18:28 -0500 (EST) In-Reply-To: <87d4fa8l4x.fsf@cyd.mit.edu> (Chong Yidong's message of "Mon, 29 Dec 2008 21:14:22 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:107425 Archived-At: >> Actually only this is needed: >> >> { >> struct Lisp_Process *p = XPROCESS (proc); >> /* Set all Lisp_Object members of struct Lisp_Process to nil. */ p-> childp = Qnil; p-> status = Qnil; >> } >> >> Why can't GC get these fields? Should something like this be checked >> in? > Maybe something else in Lisp is still referring to that dead process > object. In any case, I think it's OK to explicitly set those fields to nil. For objects that can be killed (and not revived) like frames, terminals, processes, it's OK to zero out (some of) their fields to make sure that even if someone holds on to them, what they referred to can be GC'd (as long as it makes no other visible difference: e.g. frame parameters should be nil'd). Stefan