Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 180142
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: GNU Emacs Team <emacs@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Ulrich Müller <ulm@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
emacs-21.4-oldxmenu-malloc.patch emacs-21.4-oldxmenu-malloc.patch patch Ulrich Müller 2007-05-28 20:48 0000 519 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 180142 depends on: Show dependency tree
Bug 180142 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-05-28 20:42 0000
(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 From Ulrich Müller 2007-05-28 20:48:41 0000 -------
Created an attachment (id=120545) [details]
emacs-21.4-oldxmenu-malloc.patch

Replace xmalloc by plain malloc in function XMakeAssoc.

------- Comment #2 From Ulrich Müller 2007-05-28 21:13:13 0000 -------
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 From Ulrich Müller 2007-05-29 15:34:44 0000 -------
Reported upstream:
<http://news.gmane.org/find-root.php?group=gmane.emacs.bugs&article=15752>

------- Comment #4 From Ulrich Müller 2007-05-30 06:38:23 0000 -------
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.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug