From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andrew Choi Newsgroups: gmane.emacs.devel Subject: Re: Fix for Mac OS X Garbage Collection Crashes Date: Wed, 15 Oct 2003 09:45:20 -0600 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1066232955 25832 80.91.224.253 (15 Oct 2003 15:49:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Oct 2003 15:49:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Oct 15 17:49:13 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A9nth-0000pe-00 for ; Wed, 15 Oct 2003 17:49:13 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A9nth-0001BL-00 for ; Wed, 15 Oct 2003 17:49:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A9nry-0007Dj-JS for emacs-devel@quimby.gnus.org; Wed, 15 Oct 2003 11:47:26 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A9nrI-000738-R0 for emacs-devel@gnu.org; Wed, 15 Oct 2003 11:46:44 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A9nq3-0005z7-MR for emacs-devel@gnu.org; Wed, 15 Oct 2003 11:45:58 -0400 Original-Received: from [24.71.223.10] (helo=pd2mo1so.prod.shaw.ca) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A9nq3-0005z4-CH for emacs-devel@gnu.org; Wed, 15 Oct 2003 11:45:27 -0400 Original-Received: from pd6mr3so.prod.shaw.ca (pd6mr3so-qfe3.prod.shaw.ca [10.0.141.218]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HMT00E5P2FQDE@l-daemon> for emacs-devel@gnu.org; Wed, 15 Oct 2003 09:45:26 -0600 (MDT) Original-Received: from pn2ml7so.prod.shaw.ca (pn2ml7so-qfe0.prod.shaw.ca [10.0.121.151]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HMT0049G2FQ1L@l-daemon> for emacs-devel@gnu.org; Wed, 15 Oct 2003 09:45:26 -0600 (MDT) Original-Received: from owlbear.local.shawmail (h68-144-207-94.cg.shawcable.net [68.144.207.94]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HMT00GTP2FP7X@l-daemon> for emacs-devel@gnu.org; Wed, 15 Oct 2003 09:45:26 -0600 (MDT) In-reply-to: Original-To: Stefan Monnier User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 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:17119 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17119 Stefan Monnier writes: > Is this `line 5014' the `if (CONS...)' line in mark_object in the > code below ? > > case Lisp_Cons: > { > register struct Lisp_Cons *ptr = XCONS (obj); > if (CONS_MARKED_P (ptr)) break; > CHECK_ALLOCATED_AND_LIVE (live_cons_p); > > and in the earlier email you mention it's linked to `when > LISP_INT values are on the gcprolist'. What gave you this impression ? > > I understand you don't have time to work on this and I'm better > placed to do the work, but any additional hint can be helpful: this is > otherwise very difficult to track down. Yes, it was very hard to repeat the error. The following shows the top of the call stack in one of my crash logs. Thread 0 Crashed: #0 0x000c6aec in mark_object (alloc.c:5014) #1 0x000c5e20 in Fgarbage_collect (alloc.c:4400) #2 0x000dc710 in Feval (eval.c:1978) #3 0x000d99a0 in Fprogn (eval.c:409) #4 0x000de81c in unbind_to (eval.c:3083) #5 0x0010de14 in Fbyte_code (bytecode.c:893) #6 0x000de1f4 in funcall_lambda (eval.c:2916) #7 0x000ddcb8 in Ffuncall (eval.c:2781) #8 0x0010d70c in Fbyte_code (bytecode.c:691) #9 0x000de1f4 in funcall_lambda (eval.c:2916) ... So the call to mark_object that causes the problem was made from line 4400, in the code here: #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) mark_stack (); #else { register struct gcpro *tail; for (tail = gcprolist; tail; tail = tail->next) for (i = 0; i < tail->nvars; i++) mark_object (tail->var[i]); } #endif That's what gave me the idea that perhaps I should change the definition of GC_MARK_STACK for the OS X build. Then I ran Emacs under gdb and after a long time was able to get the crash again (running Gnus, Tramp, BlogMax, and possibly other stuffs). I discovered that `obj' contains an integer value (0x1fff0000, -32768?, I think) but strangely the case for Lisp_Cons (line 5014) was reached. Unfortunately I don't have that process any more. Perhaps one can try to repeat this on another platform too. It seems that this may not be a Mac-specific problem. Hope this is enough information. The change to alloc.c last month wasn't that big, was it?