emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Crash: XSetWMIconName, x_set_name_internal, prepare_menu_bars


From: YAMAMOTO Mitsuharu
Subject: Re: Crash: XSetWMIconName, x_set_name_internal, prepare_menu_bars
Date: Fri, 01 Jun 2007 10:05:41 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shij┼Ź) APEL/10.6 Emacs/22.0.990 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Fri, 01 Jun 2007 00:35:33 +0200, address@hidden (Kim F. Storm) said:

> I had a crash yesterday with the emacs 22 branch (not fully
> up-to-date, but close):

>  GNU Emacs 22.0.990.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20) of
> 2007-05-23 on kfs-lx

> It is built on an up-to-date Debian Stable system.

> Emacs had probably been running for approx. 20 hours, and the last
> command I executed which triggered the crash was C-x 5 b (that's
> ido-switch-buffer-other-frame), selected a buffer from the list, and
> hit RET.

> I think it crashed while creating the new frame; I don't recall
> seeing the frame appear, but I'm not absolutely sure.

I think this is due to string data relocation caused by ENCODE_UTF_8
in x_set_name_internal (GTK+ only).

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/xfns.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfns.c,v
retrieving revision 1.681
diff -c -p -r1.681 xfns.c
*** src/xfns.c  24 Mar 2007 15:40:38 -0000      1.681
--- src/xfns.c  1 Jun 2007 01:00:51 -0000
*************** x_set_name_internal (f, name)
*** 1605,1610 ****
--- 1605,1615 ----
        int bytes, stringp;
          int do_free_icon_value = 0, do_free_text_value = 0;
        Lisp_Object coding_system;
+ #ifdef USE_GTK
+       /* As ENCODE_UTF_8 may cause GC and relocation of string data,
+          we use it before x_encode_text that may return string data.  */
+       Lisp_Object encoded_name = ENCODE_UTF_8 (name);
+ #endif
  
        coding_system = Qcompound_text;
        /* Note: Encoding strategy
*************** x_set_name_internal (f, name)
*** 1645,1651 ****
  
  #ifdef USE_GTK
          gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
!                               (char *) SDATA (ENCODE_UTF_8 (name)));
  #else /* not USE_GTK */
        XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
  #endif /* not USE_GTK */
--- 1650,1656 ----
  
  #ifdef USE_GTK
          gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
!                               (char *) SDATA (encoded_name));
  #else /* not USE_GTK */
        XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
  #endif /* not USE_GTK */




reply via email to

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