From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: editfns.c (Fformat): fix for segfault Date: Mon, 28 Apr 2003 19:38:40 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <851xzo9f2l.fsf@pi.meyering.net> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1051573375 20431 80.91.224.249 (28 Apr 2003 23:42:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2003 23:42:55 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 29 01:42:53 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19AIGr-0005JI-00 for ; Tue, 29 Apr 2003 01:42:53 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19AIPF-0001pp-00 for ; Tue, 29 Apr 2003 01:51:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19AIGE-0003rU-08 for emacs-devel@quimby.gnus.org; Mon, 28 Apr 2003 19:42:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19AIDz-0003VU-00 for emacs-devel@gnu.org; Mon, 28 Apr 2003 19:39:55 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19AIDe-0003Ky-00 for emacs-devel@gnu.org; Mon, 28 Apr 2003 19:39:35 -0400 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19AICm-0002nH-00 for emacs-devel@gnu.org; Mon, 28 Apr 2003 19:38:40 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.10) id 19AICm-0005Qs-00; Mon, 28 Apr 2003 19:38:40 -0400 Original-To: Jim Meyering In-reply-to: <851xzo9f2l.fsf@pi.meyering.net> (message from Jim Meyering on Sun, 27 Apr 2003 16:42:58 +0200) Original-cc: handa@etl.go.jp X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13525 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13525 The only way that the value of format should be so different from format_start, and yet with the same text, is if there was a GC and it moved the string. I don't see what could possibly have caused a GC there. It would have to be something that calls eval. If it was really due to a GC, I have doubts that this change is enough, because the old location of the string could get overwritten with some other string. Perhaps it will happen just a minority of the time, but it can happen. I added a facility to make Emacs abort if it GCs in the middle of that code. That way we will really get to the bottom of this. This is my analysis. In the first scan, Fchar_to_string or Fprint1_to_string are called, and they will relocate a data of a Lisp string (in the current case, args[0]). How can either of these functions cause a GC?