From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: All platforms fail with Unicode in menus. Date: Mon, 30 Aug 2004 12:28:38 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <5ADE9B02-FA6F-11D8-8A82-000D93505B76@swipnet.se> References: <412E2C34.8070905@swipnet.se> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1093863236 22398 80.91.224.253 (30 Aug 2004 10:53:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 30 Aug 2004 10:53:56 +0000 (UTC) Cc: reiner.steib@gmx.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 30 12:53:47 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C1jnG-0001zg-00 for ; Mon, 30 Aug 2004 12:53:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C1js5-0007T6-6E for ged-emacs-devel@m.gmane.org; Mon, 30 Aug 2004 06:58:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C1jrh-0007Oa-Lp for emacs-devel@gnu.org; Mon, 30 Aug 2004 06:58:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C1jrf-0007NV-85 for emacs-devel@gnu.org; Mon, 30 Aug 2004 06:58:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C1jrf-0007Mx-4t for emacs-devel@gnu.org; Mon, 30 Aug 2004 06:58:19 -0400 Original-Received: from [195.54.107.79] (helo=mxfep04.bredband.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C1jmb-0003sy-TQ for emacs-devel@gnu.org; Mon, 30 Aug 2004 06:53:06 -0400 Original-Received: from coolsville.localdomain ([213.115.26.74] [213.115.26.74]) by mxfep01.bredband.com with ESMTP id <20040830102858.UVMW5206.mxfep01.bredband.com@coolsville.localdomain>; Mon, 30 Aug 2004 12:28:58 +0200 In-Reply-To: Original-To: YAMAMOTO Mitsuharu X-Mailer: Apple Mail (2.619) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26618 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26618 >> It seems that the string returned by ENCODE_UTF_8 gets collected >> during GC, resulting in passing garbage to the GTK menu code. > > In this case, the Lisp Object returned by ENCODE_UTF_8 is reachable > from the root set via `menu_items', which is staticpro-ed. I think > the problem is that ENCODE_UTF_8 may cause GC, and that leads to > relocation of string contents by the compaction of small strings. > Without the call of inhibit_garbage_collection, the buffer list in the > "Buffers" menu is also corrupted if "Math" menu is present. Yes, you are correct. The problem is that the menu code saves a pointer to the strings in the menus, not the Lisp value, in its internal data structure. As it reaches the "Math" menu, the compaction of small strings makes the previously saved pointers point to garbage as the strings has been moved. This problem has been considered in the code when the inhibit_garbage_collection was removed. The pointers to the strings are not stored until after the whole data structure is done, and no GC can happen. But it is only done properly for the top level (i.e. menu bar) entries. Fixing the others should be easy, I'll do it within a day or two. Jan D.