From debbugs-submit-bounces@debbugs.gnu.org Sat May 29 11:49:48 2010 Received: (at submit) by debbugs.gnu.org; 29 May 2010 15:49:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIOIF-0001Fb-0P for submit@debbugs.gnu.org; Sat, 29 May 2010 11:49:47 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIOIC-0001FS-RD for submit@debbugs.gnu.org; Sat, 29 May 2010 11:49:45 -0400 Received: from lists.gnu.org ([199.232.76.165]:58030) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OIOI7-0008P5-Os for submit@debbugs.gnu.org; Sat, 29 May 2010 11:49:39 -0400 Received: from [140.186.70.92] (port=49231 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIOI1-0003Tk-Ad for bug-gnu-emacs@gnu.org; Sat, 29 May 2010 11:49:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIHYB-0005cX-PO for bug-gnu-emacs@gnu.org; Sat, 29 May 2010 04:37:48 -0400 Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:50675) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIHYB-0005cC-77 for bug-gnu-emacs@gnu.org; Sat, 29 May 2010 04:37:47 -0400 Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 27769C0557 for ; Sat, 29 May 2010 17:37:43 +0900 (JST) Date: Sat, 29 May 2010 17:37:43 +0900 Message-ID: From: YAMAMOTO Mitsuharu To: bug-gnu-emacs@gnu.org Subject: 23.2.50; GC may lose Lisp objects in the image cache User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) Organization: Faculty of Science, Chiba University MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: NetBSD 3.0 (DF) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) 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@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 ---- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 01:44:25 2010 Received: (at 6301) by debbugs.gnu.org; 11 Oct 2010 05:44:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5BBQ-000552-Vw for submit@debbugs.gnu.org; Mon, 11 Oct 2010 01:44:25 -0400 Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5BBN-00054x-PM for 6301@debbugs.gnu.org; Mon, 11 Oct 2010 01:44:23 -0400 Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id F2F0CC0561 for <6301@debbugs.gnu.org>; Mon, 11 Oct 2010 14:47:41 +0900 (JST) Date: Mon, 11 Oct 2010 14:47:41 +0900 Message-ID: From: YAMAMOTO Mitsuharu To: 6301@debbugs.gnu.org Subject: Re: bug#6301: 23.2.50; GC may lose Lisp objects in the image cache In-Reply-To: References: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) Organization: Faculty of Science, Chiba University MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 6301 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) >>>>> On Sat, 29 May 2010 17:37:43 +0900, YAMAMOTO Mitsuharu said: > 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. On second thought, the following change would be more natural. === modified file 'src/alloc.c' *** src/alloc.c 2010-01-22 09:10:04 +0000 --- src/alloc.c 2010-10-10 01:56:51 +0000 *************** mark_terminals (void) *** 5771,5783 **** for (t = terminal_list; t; t = t->next_terminal) { eassert (t->name != NULL); - if (!VECTOR_MARKED_P (t)) - { #ifdef HAVE_WINDOW_SYSTEM ! mark_image_cache (t->image_cache); #endif /* HAVE_WINDOW_SYSTEM */ ! mark_vectorlike ((struct Lisp_Vector *)t); ! } } } --- 5779,5789 ---- for (t = terminal_list; t; t = t->next_terminal) { eassert (t->name != NULL); #ifdef HAVE_WINDOW_SYSTEM ! mark_image_cache (t->image_cache); #endif /* HAVE_WINDOW_SYSTEM */ ! if (!VECTOR_MARKED_P (t)) ! mark_vectorlike ((struct Lisp_Vector *)t); } } Also, as for stack marking, I noticed that about half of the stack elements have Lisp_Int* tags at least on Mac OS X. Such an element might be either a real Lisp integer or an aligned pointer value. We can omit mem_find calls for them by checking the tag value early. === modified file 'src/alloc.c' *** src/alloc.c 2010-01-22 09:10:04 +0000 --- src/alloc.c 2010-10-10 01:56:51 +0000 *************** static INLINE void *** 4109,4117 **** mark_maybe_object (obj) Lisp_Object obj; { ! void *po = (void *) XPNTR (obj); ! struct mem_node *m = mem_find (po); if (m != MEM_NIL) { int mark_p = 0; --- 4109,4125 ---- mark_maybe_object (obj) Lisp_Object obj; { ! void *po; ! struct mem_node *m; ! ! switch (XTYPE (obj)) ! { ! case_Lisp_Int: ! return; ! } + po = (void *) XPNTR (obj); + m = mem_find (po); if (m != MEM_NIL) { int mark_p = 0; YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 13:18:05 2010 Received: (at 6301) by debbugs.gnu.org; 11 Oct 2010 17:18:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5M0i-0002aL-Rk for submit@debbugs.gnu.org; Mon, 11 Oct 2010 13:18:05 -0400 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5M0g-0002Zz-Hy for 6301@debbugs.gnu.org; Mon, 11 Oct 2010 13:18:03 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 140EE1C00229; Mon, 11 Oct 2010 19:21:25 +0200 (CEST) Received: from igel.home (ppp-88-217-99-133.dynamic.mnet-online.de [88.217.99.133]) by mail.mnet-online.de (Postfix) with ESMTP id B8F261C001FD; Mon, 11 Oct 2010 19:21:25 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 58491CA2A0; Mon, 11 Oct 2010 19:21:25 +0200 (CEST) From: Andreas Schwab To: YAMAMOTO Mitsuharu Subject: Re: bug#6301: 23.2.50; GC may lose Lisp objects in the image cache References: X-Yow: I'm having a MID-WEEK CRISIS! Date: Mon, 11 Oct 2010 19:21:25 +0200 In-Reply-To: (YAMAMOTO Mitsuharu's message of "Mon, 11 Oct 2010 14:47:41 +0900") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 6301 Cc: 6301@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) YAMAMOTO Mitsuharu writes: > --- 4109,4125 ---- > mark_maybe_object (obj) > Lisp_Object obj; > { > ! void *po; > ! struct mem_node *m; > ! > ! switch (XTYPE (obj)) > ! { > ! case_Lisp_Int: > ! return; > ! } aka. if (INTEGERP (obj)) return; Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 20:17:19 2010 Received: (at 6301) by debbugs.gnu.org; 12 Oct 2010 00:17:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5SYR-00068W-3W for submit@debbugs.gnu.org; Mon, 11 Oct 2010 20:17:19 -0400 Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5SYN-00068Q-1S for 6301@debbugs.gnu.org; Mon, 11 Oct 2010 20:17:16 -0400 Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 2DAFEC0561; Tue, 12 Oct 2010 09:20:38 +0900 (JST) Date: Tue, 12 Oct 2010 09:20:38 +0900 Message-ID: From: YAMAMOTO Mitsuharu To: Andreas Schwab Subject: Re: bug#6301: 23.2.50; GC may lose Lisp objects in the image cache In-Reply-To: References: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) Organization: Faculty of Science, Chiba University MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 6301 Cc: 6301@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) >>>>> On Mon, 11 Oct 2010 19:21:25 +0200, Andreas Schwab said: > YAMAMOTO Mitsuharu writes: >> --- 4109,4125 ---- >> mark_maybe_object (obj) >> Lisp_Object obj; >> { >> ! void *po; >> ! struct mem_node *m; >> ! >> ! switch (XTYPE (obj)) >> ! { >> ! case_Lisp_Int: >> ! return; >> ! } > aka. if (INTEGERP (obj)) return; Indeed. And it actually produces a better code on gcc 4.2.1 with -O2. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 21 19:40:11 2010 Received: (at 6301) by debbugs.gnu.org; 22 Nov 2010 00:40:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKKS2-0007FP-SX for submit@debbugs.gnu.org; Sun, 21 Nov 2010 19:40:11 -0500 Received: from pantheon-po42.its.yale.edu ([130.132.50.101]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKKS1-0007FK-I0 for 6301@debbugs.gnu.org; Sun, 21 Nov 2010 19:40:09 -0500 Received: from furball (dhcp128036014014.central.yale.edu [128.36.14.14]) (authenticated bits=0) by pantheon-po42.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id oAM0jMLW018365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 21 Nov 2010 19:45:22 -0500 Received: by furball (Postfix, from userid 1000) id 7A4F31610A5; Sun, 21 Nov 2010 19:45:22 -0500 (EST) From: Chong Yidong To: YAMAMOTO Mitsuharu Subject: Re: 23.2.50; GC may lose Lisp objects in the image cache Date: Sun, 21 Nov 2010 19:45:22 -0500 Message-ID: <874oba5gpp.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 6301 Cc: 6301@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) > 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. > > Also, as for stack marking, I noticed that about half of the stack > elements have Lisp_Int* tags at least on Mac OS X. Such an element > might be either a real Lisp integer or an aligned pointer value. We > can omit mem_find calls for them by checking the tag value early. Thanks. I've committed your patches (the former to emacs-23, the latter to the trunk). Sorry for the long delay. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 21 19:40:25 2010 Received: (at control) by debbugs.gnu.org; 22 Nov 2010 00:40:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKKSH-0007Fa-3d for submit@debbugs.gnu.org; Sun, 21 Nov 2010 19:40:25 -0500 Received: from pantheon-po42.its.yale.edu ([130.132.50.101]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKKSB-0007FV-7L for control@debbugs.gnu.org; Sun, 21 Nov 2010 19:40:19 -0500 Received: from furball (dhcp128036014014.central.yale.edu [128.36.14.14]) (authenticated bits=0) by pantheon-po42.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id oAM0jXcL018378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 21 Nov 2010 19:45:33 -0500 Received: by furball (Postfix, from userid 1000) id E363A1610A5; Sun, 21 Nov 2010 19:45:32 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 6301 Date: Sun, 21 Nov 2010 19:45:32 -0500 Message-ID: <871v6e5gpf.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 6301 thanks From unknown Thu Jun 19 14:17:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Dec 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator