Subject: bug#4879: Crash in xmenu_show

From: Stefan Monnier <[email-masked]>
Date: Sat, 07 Nov 2009 22:43:01 -0500

>>>>> "Chong" == Chong Yidong <[email-masked]> writes:

>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread 0x7fb3746be7a0 (LWP 19530)]
>> 0x00000000004701c7 in xmenu_show (f=0x11c46e0, x=227, y=29, for_click=1, keymaps=1, title=12708355, error=0x7fff7c6ed8c0) at xmenu.c:2735
>> 2735                  bcopy (SDATA (item_name), item_data,

> The problem is that

>    XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];

> is now a symbol, but the code (here and in a couple of other places in
> xmenu.c, and maybe elsewhere) assumes that it's a string or nil.

> It's simple to "fix" by adding an additional check for symbols as menu
> descriptors, but we need to understand why the situation has changed.

> Stefan, I'm 99% sure this was caused by your keymap changes around
> 2009-09-11.  Could you please debug them?

Hmm... not sure how it relates, but I see one possible trouble spot.
Does the patch below help?

        Stefan

--- keyboard.c.~1.1016.~	2009-10-24 22:39:01.000000000 -0400
+++ keyboard.c	2009-11-07 22:41:50.000000000 -0500
@@ -8118,6 +8118,8 @@
 	  tem = concat2 (build_string ("  "), tem);
 	  /* tem = concat3 (build_string ("  ("), tem, build_string (")")); */
 	}
+      else
+	tem = Qnil;
     }