[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: All platforms fail with Unicode in menus.

From: Jan D.
Subject: Re: All platforms fail with Unicode in menus.
Date: Mon, 30 Aug 2004 12:28:38 +0200

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

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

        Jan D.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]