From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: readevalloop and GC Date: Wed, 16 Nov 2005 13:44:18 -0500 Message-ID: References: <20051114.022503.01367484.horiguti@horiguti.meadowy.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1132166849 2935 80.91.229.2 (16 Nov 2005 18:47:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 Nov 2005 18:47:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 16 19:47:25 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EcSHE-0003Ep-E2 for ged-emacs-devel@m.gmane.org; Wed, 16 Nov 2005 19:45:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EcSHC-0006j5-Ob for ged-emacs-devel@m.gmane.org; Wed, 16 Nov 2005 13:44:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EcSGj-0006iN-DP for emacs-devel@gnu.org; Wed, 16 Nov 2005 13:44:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EcSGg-0006hZ-Aq for emacs-devel@gnu.org; Wed, 16 Nov 2005 13:44:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EcSGg-0006hS-5F for emacs-devel@gnu.org; Wed, 16 Nov 2005 13:44:26 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EcSGf-0004Nj-Hr for emacs-devel@gnu.org; Wed, 16 Nov 2005 13:44:25 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id E99612DE903; Wed, 16 Nov 2005 13:44:22 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 8B3D14AC00A; Wed, 16 Nov 2005 13:44:18 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 7796FE6C22; Wed, 16 Nov 2005 13:44:18 -0500 (EST) Original-To: Kyotaro HORIGUCHI In-Reply-To: <20051114.022503.01367484.horiguti@horiguti.meadowy.org> (Kyotaro HORIGUCHI's message of "Mon, 14 Nov 2005 02:25:03 +0900 (JST)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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=-4.852, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:46103 Archived-At: > In readevalloop() in lread.c creates marker object in every turn > of the loop when start is not nil, and the marker is not > GC-protected. Indeed and neither were `end' and `readfun' GC-protected. I've installed a patch to GCPRO them. Thank you. > So, it may be freed by GC happened in evalfun (is typically > Feval) called just after. Actually, in most configurations nowadays Emacs doesn't use GCPROs any more but uses conservative stack scanning instead, so the problem is limited to some particular (hopefully rare) configs. > This problem was fixed by following patch. I haven't installed the part of the patch which avoids the repeated creation of a marker. Seeing how the build_load_history call at the end distinguishes ints from markers, I feel like this part of the code is buggy (or else, lacks comments) anyway and I'll let someone else think about how it should be fixed. Stefan