(Issue reported by armin76 on IRC, opening this bug for documentation purposes.) app-editors/emacs-21.4-r12 (built with USE="-Xaw3d -motif") on ia64 terminates with a segmentation fault in the X menu: Program received signal SIGSEGV, Segmentation fault. 0x4000000000339e50 in XMakeAssoc (dpy=0x60000000004f3c90, table=<value optimized out>, x_id=20971750, data=0x60000000006d6ef0 "0Pm") at XMakeAssoc.c:95 95 XMakeAssoc.c: No such file or directory. in XMakeAssoc.c #0 0x4000000000339e50 in XMakeAssoc (dpy=0x60000000004f3c90, table=<value optimized out>, x_id=20971750, data=0x60000000006d6ef0 "0Pm") at XMakeAssoc.c:95 #1 0x40000000003381a0 in _XMWinQueFlush (display=0x60000000004f3c90, menu=0x60000000006d4ef0, pane=0x60000000006d6ef0, select=7171824) at Internal.c:261 The issue also exists with the stable revision 21.4-r4: Program received signal SIGSEGV, Segmentation fault. 0x4000000000338800 in XMakeAssoc (dpy=0x60000000004f43e0, table=<value optimized out>, x_id=20971750, data=0x6000000000220790 "P\002P") at XMakeAssoc.c:95 95 XMakeAssoc.c: No such file or directory. in XMakeAssoc.c #0 0x4000000000338800 in XMakeAssoc (dpy=0x60000000004f43e0, table=<value optimized out>, x_id=20971750, data=0x6000000000220790 "P\002P") at XMakeAssoc.c:95 #1 0x4000000000336b50 in _XMWinQueFlush (display=0x60000000004f43e0, menu=0x6000000000489e60, pane=0x6000000000220790, select=2230160) at Internal.c:261 ia64-tdep.c:1591: internal-error: ia64_frame_prev_register: Assertion `regnum >= 0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) ia64-tdep.c:1591: internal-error: ia64_frame_prev_register: Assertion `regnum >= 0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n)
Created attachment 120545 [details, diff] emacs-21.4-oldxmenu-malloc.patch Replace xmalloc by plain malloc in function XMakeAssoc.
Difference between malloc and xmalloc is that the latter sandwiches the malloc call between BLOCK_INPUT / UNBLOCK_INPUT (see src/alloc.c and src/blockinput.h) where UNBLOCK_INPUT may send signals to the Emacs process itself. However, it appears safe to call plain malloc in XMakeAssoc. This function is only called via XMenuActivate from xmenu_show (in src/xmenu.c). xmenu_show is itself protected by {,UN}BLOCK_INPUT. Should be fixed in -r12 now.
Reported upstream: <http://news.gmane.org/find-root.php?group=gmane.emacs.bugs&article=15752>
Patch accepted upstream. It is in EMACS_22_BASE, so it will be included in the 22.1 release. emacs-22/oldXMenu/ChangeLog: 2007-05-30 Ulrich Mueller <ulm@gentoo.org> (tiny change) * XMakeAssoc.c (XMakeAssoc): Use malloc rather than xmalloc. [...] 1994-01-03 Richard Stallman (rms@mole.gnu.ai.mit.edu) * XMakeAssoc.c (XMakeAssoc): Use xmalloc.