Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180142 - app-editors/emacs-21.4-r12 with USE="-Xaw3d -motif" segfaults in X menu
Summary: app-editors/emacs-21.4-r12 with USE="-Xaw3d -motif" segfaults in X menu
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: IA64 Linux
: High normal (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-28 20:42 UTC by Ulrich Müller
Modified: 2007-05-30 06:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emacs-21.4-oldxmenu-malloc.patch (emacs-21.4-oldxmenu-malloc.patch,519 bytes, patch)
2007-05-28 20:48 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2007-05-28 20:42:57 UTC
(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)
Comment 1 Ulrich Müller gentoo-dev 2007-05-28 20:48:41 UTC
Created attachment 120545 [details, diff]
emacs-21.4-oldxmenu-malloc.patch

Replace xmalloc by plain malloc in function XMakeAssoc.
Comment 2 Ulrich Müller gentoo-dev 2007-05-28 21:13:13 UTC
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.
Comment 3 Ulrich Müller gentoo-dev 2007-05-29 15:34:44 UTC
Reported upstream:
<http://news.gmane.org/find-root.php?group=gmane.emacs.bugs&article=15752>
Comment 4 Ulrich Müller gentoo-dev 2007-05-30 06:38:23 UTC
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.