From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tramp with global-auto-revert-mode. Date: 18 May 2004 12:25:11 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200405122254.i4CMsUj29445@raven.dms.auburn.edu> <200405122326.i4CNQk929511@raven.dms.auburn.edu> <200405132324.i4DNOBs14811@raven.dms.auburn.edu> <200405140008.i4E08lb14858@raven.dms.auburn.edu> <871xln4xmc.fsf-monnier+emacs@gnu.org> <200405140132.i4E1WaH15085@raven.dms.auburn.edu> <87vfiz3fez.fsf-monnier+emacs@gnu.org> <200405140308.i4E38b415540@raven.dms.auburn.edu> <87pt973b7y.fsf-monnier+emacs@gnu.org> <200405150139.i4F1dbs26083@raven.dms.auburn.edu> <200405152044.i4FKiig02345@raven.dms.auburn.edu> <200405161811.i4GIB3O03519@raven.dms.auburn.edu> <200405162004.i4GK4I503710@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084899855 31613 80.91.224.253 (18 May 2004 17:04:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 May 2004 17:04:15 +0000 (UTC) Cc: Luc Teirlinck , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 18 19:04:07 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQ80c-0005Sh-00 for ; Tue, 18 May 2004 19:04:06 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQ80X-0007WP-00 for ; Tue, 18 May 2004 19:04:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BQ7Py-0005cS-2B for emacs-devel@quimby.gnus.org; Tue, 18 May 2004 12:26:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BQ7Pc-0005br-BF for emacs-devel@gnu.org; Tue, 18 May 2004 12:25:52 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BQ7P2-0005WU-Tt for emacs-devel@gnu.org; Tue, 18 May 2004 12:25:49 -0400 Original-Received: from [206.47.199.166] (helo=simmts8-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BQ7P2-0005WO-JJ for emacs-devel@gnu.org; Tue, 18 May 2004 12:25:16 -0400 Original-Received: from empanada.local ([67.71.116.83]) by simmts8-srv.bellnexxia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040518162514.IAIM15930.simmts8-srv.bellnexxia.net@empanada.local>; Tue, 18 May 2004 12:25:14 -0400 Original-Received: by empanada.local (Postfix, from userid 502) id 61C1E19715F; Tue, 18 May 2004 12:25:12 -0400 (EDT) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: Original-Lines: 40 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23638 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23638 >> I also made emacs crash with tramp + global-auto-revert-mode. > And I have studied the cause a little further and found at least one > reason for the crash -- trying to mark a Lisp_Misc_Free object, most > likely resulting from freeing a marker which is still present on > some undo list. > I have installed a fix for this; I don't know if it has any > bad effects, but at least it solves the crash for me. Well, it makes it "legal" to have a live Lisp_Misc_free object, which is at least odd and might lead to further problems. But more importantly, Fgarbage_collect has code that traverses the undo lists and removes entries that contain unmarked markers, which should make sure the problem you describe doesn't happen. Obviously that code is not 100% successful at it, but rather than hide the problem we might want to track it down further to see what's really going on. Looking at the code, I see one case where things could go awry: 1) mark buffer -> mark the undo_list, skipping markers 2) coming from somewhere else, mark a cons cell who happens to also be on the undo_list we marked in step 1 and whose car is a marker: because the cons cells were already marked, we won't look at the marker. Also the code in Fgarbage_collect will remove the cons cell from the undo_list but that will not remove it from the other list, so it will stay and be turned into a reachable Lisp_Misc_Free. Another thing I notice is that we do mark_stack and xg_mark_data after cleaning up the undo_lists, so if any undo_list gets marked from mark_stack or xg_mark_data we will leave the unmarked markers and turn them info Lisp_Misc_Free. I've just installed a fix for this last problem (although it's not a very likely scenario so I don't expect it fixes the problem we're seeing). I don't have a fix for the first yet problem yet (which is also somewhat unlikely, but less so, so maybe it is the problem we're seeing). Stefan