GNU bug report logs - #6301
23.2.50; GC may lose Lisp objects in the image cache

Previous Next

Package: emacs;

Reported by: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Date: Sat, 29 May 2010 15:50:02 UTC

Severity: normal

Tags: patch

Found in version 23.2.50

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2.50; GC may lose Lisp objects in the image cache
Date: Sat, 29 May 2010 17:37:43 +0900
Currently, Fgarbage_collect calls mark_terminals after marking
staticpro'ed objects.  Terminal objects need a special marking
strategy with respect to image cache, but if a terminal object is
reachable from some staticpro'ed object, then it is marked normally
(i.e., without considering image cache).  As a result, Lisp objects in
the image cache might be collected though they should have been
marked.

The simplest way to fix this would be to call mark_terminals earlier.
Actually, the latest release of the Mac port includes the following
patch.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp

=== modified file 'src/alloc.c'
*** src/alloc.c	2010-01-22 09:10:04 +0000
--- src/alloc.c	2010-05-29 07:58:30 +0000
*************** returns nil, because real GC can't be do
*** 5088,5093 ****
--- 5088,5097 ----
  
    /* Mark all the special slots that serve as the roots of accessibility.  */
  
+   /* Terminals need to be marked in a special way.  But they can be
+      reachable from other roots and might be marked normally if
+      mark_terminals is called later.  */
+   mark_terminals ();
    for (i = 0; i < staticidx; i++)
      mark_object (*staticvec[i]);
  
*************** returns nil, because real GC can't be do
*** 5096,5102 ****
        mark_object (bind->symbol);
        mark_object (bind->old_value);
      }
-   mark_terminals ();
    mark_kboards ();
    mark_ttys ();
  
--- 5100,5105 ----




This bug report was last modified 14 years and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.