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: Fix to long-standing crashes in GC Date: 28 May 2004 19:49:54 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <40A3BC23.8060000@math.ku.dk> <200405180013.i4I0Ddl15818@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 1085807945 31599 80.91.224.253 (29 May 2004 05:19:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 29 May 2004 05:19:05 +0000 (UTC) Cc: Luc Teirlinck , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat May 29 07:18:57 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 1BTwFE-0000Cc-00 for ; Sat, 29 May 2004 07:18:56 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTwFE-0003h5-00 for ; Sat, 29 May 2004 07:18:56 +0200 Original-Received: from [127.0.0.1] (helo=mailman.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BTwFI-0005xF-Nt for emacs-devel@quimby.gnus.org; Sat, 29 May 2004 01:19:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BTwFE-0005vt-Sa for emacs-devel@gnu.org; Sat, 29 May 2004 01:18:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BTwFC-0005u6-Qa for emacs-devel@gnu.org; Sat, 29 May 2004 01:18:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BTwFC-0005tm-Jk for emacs-devel@gnu.org; Sat, 29 May 2004 01:18:54 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BTw4s-0001qk-9z; Sat, 29 May 2004 01:08:14 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by mx20.gnu.org with esmtp (Exim 4.34) id 1BTrBx-0001F5-J3; Fri, 28 May 2004 19:55:13 -0400 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id F1944B302DA; Fri, 28 May 2004 19:49:54 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id CAB5B8CA23; Fri, 28 May 2004 19:49:54 -0400 (EDT) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: Original-Lines: 23 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca 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:24132 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24132 > Now, when we on next gc calls mark_stack, and thus mark_maybe_object / > mark_maybe_pointer, we may accidentally have a pointer address that > leads to a (valid) cons, which is checked with mark_maybe_object... > that's ok, you see that it points to a valid cons block, and it is not > marked Vdead. Oh, yes, I understand now, thank you. > BTW, I think that clearing the cons cells before strings is still a > proper sequence in gc_sweep, as the old sequence (that your patch > reinstalls) implies that after cleaning the strings, there are > cons cells (unmarked though) that points into freed memory. I think this is a red-herring: doing it your way leads to temporarily having non-marked strings whose text-properties might point to deallocated cons-cells. The sweep step simply has to be atomic, just like most of the GC itself (afterall, that's why the mark&sweep algorithm is in the category called "stop-the-world"). Stefan