[Bug 1186341] New: emacs-gtk crashes when hitting Ctrl-<space>
https://bugzilla.suse.com/show_bug.cgi?id=1186341 Bug ID: 1186341 Summary: emacs-gtk crashes when hitting Ctrl-<space> Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development Assignee: screening-team-bugs@suse.de Reporter: martin.wilck@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- When hitting ctrl-space (set-mark-command), emacs reproducibly crashes. #0 XVisualIDFromVisual (visual=0x0) at Misc.c:60 #1 0x00007f8ef5a4e2de in gdk_x11_window_foreign_new_for_display (display=0x22220e0 [GdkX11Display], window=90177538) at x11/gdkwindow-x11.c:1270 #2 0x00007f8ef5a39478 in gdk_x11_display_translate_event (translator=<optimized out>, display=0x22220e0 [GdkX11Display], event=0x2238be0, xevent=0xa7e3b0 <old_fcntl_owner+1168>) at x11/gdkdisplay-x11.c:1116 #3 0x00007f8ef5a3acc1 in _gdk_x11_event_translator_translate (translator=0x22220e0, display=0x22220e0 [GdkX11Display], xevent=xevent@entry=0xa7e3b0 <old_fcntl_owner+1168>) at x11/gdkeventtranslator.c:51 #4 0x00007f8ef5a3e800 in gdk_event_source_translate_event (xevent=0xa7e3b0 <old_fcntl_owner+1168>, event_source=0x2239a30) at x11/gdkeventsource.c:243 #5 _gdk_x11_display_queue_events (display=0x22220e0 [GdkX11Display]) at x11/gdkeventsource.c:341 #6 0x00007f8ef5a056a9 in gdk_display_get_event (display=0x22220e0 [GdkX11Display]) at gdkdisplay.c:442 #7 0x00007f8ef5a3ea22 in gdk_event_source_dispatch (source=source@entry=0x2239a30, callback=<optimized out>, user_data=<optimized out>) at x11/gdkeventsource.c:363 #8 0x00007f8ef54288b7 in g_main_dispatch (context=0x2239b20) at ../glib/gmain.c:3337 #9 g_main_context_dispatch (context=0x2239b20) at ../glib/gmain.c:4055 #10 0x00007f8ef5428c38 in g_main_context_iterate (context=context@entry=0x2239b20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4131 #11 0x00007f8ef5428cef in g_main_context_iteration (context=0x2239b20, context@entry=0x0, may_block=may_block@entry=1) at ../glib/gmain.c:4196 #12 0x00007f8ef5d19385 in gtk_main_iteration () at gtkmain.c:1433 #13 0x00000000004ed0c3 in XTread_socket (terminal=<optimized out>, hold_quit=0xa7e620 <old_fcntl_owner+1792>) at xterm.c:9396 #14 0x0000000000514312 in gobble_input () at keyboard.c:6892 #15 0x00000000005865a5 in handle_async_input () at keyboard.c:7129 #16 process_pending_signals () at keyboard.c:7143 -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c1 Martin Wilck <martin.wilck@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|screening-team-bugs@suse.de |werner@suse.com --- Comment #1 from Martin Wilck <martin.wilck@suse.com> --- Bugzilla won't let me create attachments today. Anyway, supportconfig and dump are available at https://w3.suse.de/~mwilck/Bugs/1186341/ -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c2 --- Comment #2 from Martin Wilck <martin.wilck@suse.com> --- Just found that click-and-drag (for selecting text) crashes emacs, too. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 Roger Whittaker <roger.whittaker@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |roger.whittaker@suse.com -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c3 --- Comment #3 from Martin Wilck <martin.wilck@suse.com> --- when I saw this first, emacs-x11 had been updated from 27.2-1.1 to 27.2-1.2, and libgtk-3 from 3.24.27-1.1 to 3.24.29-1.1. So I suppose it's more likely to be an libgtk-3 problem. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c5 --- Comment #5 from Martin Wilck <martin.wilck@suse.com> --- @Werner: I asked on the #emacs channel in RC, and nobody else seems to see this. From the core dump: The GdkEvent is: selection = { type = GDK_SELECTION_REQUEST, window = 0x2222900 [GdkX11Window], send_event = 0 '\000', selection = 0x1, target = 0x8d, property = 0x94, time = 0, requestor = 0x0 problem in gdk_x11_window_foreign_new_for_display():
1270 win->visual = gdk_x11_screen_lookup_visual (screen, 1271 XVisualIDFromVisual (attrs.visual));
(gdb) p attrs $29 = { x = -100, y = -100, width = 1, height = 1, border_width = 0, depth = 32, visual = 0x0, <= visual ptr is NULL root = 422, class = 1, bit_gravity = 1, win_gravity = 1, backing_store = 0, backing_planes = 4294967295, backing_pixel = 0, save_under = 1, colormap = 90177537, map_installed = 0, map_state = 0, all_event_masks = 4423808, your_event_mask = 0, do_not_propagate_mask = 0, override_redirect = 1, screen = 0x22056b0 } attrs had been derived here:
1248 result = XGetWindowAttributes (display_x11->xdisplay, window, &attrs);
-- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c6 --- Comment #6 from Martin Wilck <martin.wilck@suse.com> --- The entire "attrs" above looks suspicious. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c8 --- Comment #8 from Martin Wilck <martin.wilck@suse.com> --- You nailed it! XLIB_SKIP_ARGB_VISUALS=1 is the one that causes the breakage. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c9 --- Comment #9 from Martin Wilck <martin.wilck@suse.com> --- https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html 5.3. Composite exposes extra visuals When the Composite extension is enabled via xorg.conf or the command line, a new visual is created. This visual is different from the other visuals used by X applications in that it includes an alpha component. It is used by the compositing manager and other Composite aware applications. Most X applications ignore this visual since it is not useful to them; however some applications mistakenly try to use it, which will cause them to fail. An environment variable, XLIB_SKIP_ARGB_VISUALS, was added to the X11 library to hide this visual from applications that mistakenly try to use it. If an application fails only when the Composite is enabled, try setting this environment variable before starting the application. Since Composite is not enabled by default, it is not expected that this issue will be visible to most users. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c10 --- Comment #10 from Martin Wilck <martin.wilck@suse.com> --- Apparently setting this variable used to be necessary formerly in order to *avoid* emacs crashing, and nowadays, it's the other way around. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c11 --- Comment #11 from Martin Wilck <martin.wilck@suse.com> --- FTR, references for the original bug: https://github.com/emacs-mirror/emacs/blob/master/etc/PROBLEMS This file lists several Gtk issues: ** When Emacs is compiled with Gtk+, closing a display kills Emacs. There is a long-standing bug in GTK that prevents it from recovering from disconnects: https://gitlab.gnome.org/GNOME/gtk/issues/221 Thus, for instance, when Emacs is run as a server on a text terminal, and an X frame is created, and the X server for that frame crashes or exits unexpectedly, Emacs must exit to prevent a GTK error that would result in an endless loop. ** Emacs compiled with GTK+ 3 crashes when run under some X servers. This happens when the X server does not provide certain display features that the underlying GTK+ 3 toolkit assumes. For example, this issue has been seen with remote X servers like X2Go. The symptoms are an Emacs crash, possibly triggered by the mouse entering the Emacs window, or an attempt to resize the Emacs window. The crash backtrace contains a call to XQueryPointer. This issue was fixed in the GTK+ 3 toolkit in commit 4b1c0256 in February 2018. If your GTK+ 3 is still affected, you can avoid the issue by recompiling Emacs with a different X toolkit, eg --with-toolkit=gtk2. References: https://gitlab.gnome.org/GNOME/gtk/commit/4b1c02560f0d8097bf5a11932e52fb72f3... https://debbugs.gnu.org/24280 https://bugs.debian.org/901038 https://bugzilla.redhat.com/1483942 https://access.redhat.com/solutions/3410101 https://bugzilla.gnome.org/show_bug.cgi?id=85715 https://gitlab.gnome.org/GNOME/gtk/-/issues/221 ** Emacs compiled with GTK crashes at startup due to X protocol error. This is known to happen on elementary OS GNU/Linux systems. The error message is: X protocol error: BadMatch (invalid parameter attributes) on protocol request 140 When compiled with GTK, Emacs cannot recover from X disconnects. This is a GTK bug: https://gitlab.gnome.org/GNOME/gtk/issues/221 For details, see etc/PROBLEMS. Fatal error 6: Aborted followed by a C backtrace. (Sometimes the offending protocol request number is 139.) The relevant bug report is here: https://bugs.launchpad.net/elementaryos/+bug/1355274 A workaround is to set XLIB_SKIP_ARGB_VISUALS=1 in the environment before starting Emacs, or run Emacs as root. So it'd seem that XLIB_SKIP_ARGB_VISUALS=1 was introduced because of the 3rd issue, where the error message printed by emacs refers to the 1st issue. This alone is confusing. So, is the problem that was the reason for setting this environment variable solved for good? I don't quite think so. So, if we hit another crash now when we do set this variable, we're in a dilemma... -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c13 --- Comment #13 from Martin Wilck <martin.wilck@suse.com> --- Do you see any evidence that the original issue which lead to the recommendation "XLIB_SKIP_ARGB_VISUALS=1" is fixed in GTK3 (I did not, neither in the PROBLEMS file nor in any of the bugs I scanned over). Anyway, it seems that I'm still the only affected user, so maybe something's broken in my setup... I'm asking again on RC. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c15 --- Comment #15 from Martin Wilck <martin.wilck@suse.com> --- I've got GNOME/X11. And no NVidia, just plain Intel grahics on my laptop. xdpyinfo says: name of display: :0 version number: 11.0 vendor string: The X.Org Foundation vendor release number: 12011000 X.Org version: 1.20.11 maximum request size: 16777212 bytes motion buffer size: 256 bitmap unit, bit order, padding: 32, LSBFirst, 32 image byte order: LSBFirst number of supported pixmap formats: 7 supported pixmap formats: depth 1, bits_per_pixel 1, scanline_pad 32 depth 4, bits_per_pixel 8, scanline_pad 32 depth 8, bits_per_pixel 8, scanline_pad 32 depth 15, bits_per_pixel 16, scanline_pad 32 depth 16, bits_per_pixel 16, scanline_pad 32 depth 24, bits_per_pixel 32, scanline_pad 32 depth 32, bits_per_pixel 32, scanline_pad 32 keycode range: minimum 8, maximum 255 focus: window 0x280000b, revert to Parent number of extensions: 27 BIG-REQUESTS Composite DAMAGE DOUBLE-BUFFER DPMS DRI2 GLX Generic Event Extension MIT-SCREEN-SAVER MIT-SHM Present RANDR RECORD RENDER SECURITY SHAPE SYNC X-Resource XC-MISC XFIXES XFree86-DGA XFree86-VidModeExtension XINERAMA XInputExtension XKEYBOARD XTEST XVideo number of screens: 1 screen #0: dimensions: 3648x1920 pixels (965x508 millimeters) resolution: 96x96 dots per inch depths (7): 24, 1, 4, 8, 15, 16, 32 root window id: 0x1a6 depth of root window: 24 planes number of colormaps: minimum 1, maximum 1 default colormap: 0x22 default number of colormap cells: 256 preallocated pixels: black 0, white 16777215 options: backing-store WHEN MAPPED, save-unders NO largest cursor: 256x256 current input event mask: 0xda0003 KeyPressMask KeyReleaseMask StructureNotifyMask SubstructureNotifyMask SubstructureRedirectMask PropertyChangeMask ColormapChangeMask number of visuals: 122 default visual id: 0x20 visual: visual id: 0x20 class: TrueColor depth: 24 planes available colormap entries: 256 per subfield red, green, blue masks: 0xff0000, 0xff00, 0xff significant bits in color specification: 8 bits ... and many more visuals -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c16 Martin Wilck <martin.wilck@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #16 from Martin Wilck <martin.wilck@suse.com> --- I made another TW update today, and so far I haven't been able to reproduce the issue, even though I reverted the workaround from comment 8. Last Friday I could reproduce it immediately. There's nothing GTK-related in today's update list, but some X11 libraries:
2021-05-25 09:44:13|install|libX11-6-32bit|1.7.1-1.1|x86_64||repo-oss|d9843802627cb932be333fd7e7a3623380c0a7a01da458340a2f9e77b9afae56| 2021-05-25 09:44:14|install|libX11-data|1.7.1-1.1|noarch||repo-oss|60dfdd38662c06ca06ba43c2d0f7fad94b5ca34621b77263e6bd9c1e31db7f46| 2021-05-25 09:44:14|install|libX11-xcb1-32bit|1.7.1-1.1|x86_64||repo-oss|70f409ad35a6899270d7730d42d7208b5f0420a159fe4c2c952c3d5b5b2c973c| 2021-05-25 09:45:05|install|libX11-xcb1|1.7.1-1.1|x86_64||repo-oss|22df9d02fcd3f75e398988918d9a1c8bd8551f0575a0f651cbc1289413c6bb78| 2021-05-25 09:45:05|install|libX11-6|1.7.1-1.1|x86_64||repo-oss|cd43edd1677f138334707c44527ecb73c073d20bfc9fecbf489052860deca65a| 2021-05-25 09:45:29|install|libX11-devel|1.7.1-1.1|x86_64||repo-oss|5098a67677a58857fd2fc99b2da463d2ae911b088f563f9b3d1c736f115370cc|
I'm closing this for now. Will reopen if I reencounter the issue. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c17 --- Comment #17 from Martin Wilck <martin.wilck@suse.com> --- Fun! Today, emacs crashes again, same situation as before. No updates since yesterday. The behavior seems to depend on relative humidity, or moon phase. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c18 Martin Wilck <martin.wilck@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WORKSFORME |--- --- Comment #18 from Martin Wilck <martin.wilck@suse.com> --- Reopening per comment 17. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c21 --- Comment #21 from Martin Wilck <martin.wilck@suse.com> --- I'm using the GTK client, too. For you, it crashes without XLIB_SKIP_ARGB_VISUALS=1, whereas I need to remove this to *avoid* it crashing. Both of us are using latest TW, I suppose. I'm in a GNOME/X11 environment with a 3-monitor setup (no idea if that matters), otherwise everything is pretty straightforward. Is there anything special in your environment? At the same time, there seem to be others who aren't affected by the issue either way. It's getting mysterious. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c22 Martin Wilck <martin.wilck@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags| |needinfo?(maurizio.galli@gm | |ail.com) --- Comment #22 from Martin Wilck <martin.wilck@suse.com> --- (In reply to Maurizio Galli from comment #20)
Created attachment 850085 [details] error
This stack is not helpful. Please install libdebuginfod1 run "coredumpctl gdb $PID", and try to provide a stack with some symbols (as in comment 0). -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c23 --- Comment #23 from Maurizio Galli <maurizio.galli@gmail.com> --- (In reply to Martin Wilck from comment #21)
I'm using the GTK client, too. For you, it crashes without XLIB_SKIP_ARGB_VISUALS=1, whereas I need to remove this to *avoid* it crashing. Both of us are using latest TW, I suppose. I'm in a GNOME/X11 environment with a 3-monitor setup (no idea if that matters), otherwise everything is pretty straightforward. Is there anything special in your environment?
At the same time, there seem to be others who aren't affected by the issue either way. It's getting mysterious.
My setup is nothing exotic. Tumbleweed laptop with external monitor. I'm in Xfce 4.16 X11. I spoke to at least one person running KDE who confirmed the crashes without XLIB_SKIP_ARGB_VISUALS=1 -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c24 --- Comment #24 from Maurizio Galli <maurizio.galli@gmail.com> --- (In reply to Martin Wilck from comment #22)
(In reply to Maurizio Galli from comment #20)
Created attachment 850085 [details] error
This stack is not helpful. Please install libdebuginfod1 run "coredumpctl gdb $PID", and try to provide a stack with some symbols (as in comment 0).
sorry I'll try to provide a better one later today -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c26 Martin Wilck <martin.wilck@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fcrozat@suse.com Flags| |needinfo?(fcrozat@suse.com) --- Comment #26 from Martin Wilck <martin.wilck@suse.com> --- @fcrozat, do you have an idea who could help here? -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c27 Frederic Crozat <fcrozat@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|os.gnome.maintainers@gmail. |gnome-bugs@suse.de |com | Flags|needinfo?(fcrozat@suse.com) | --- Comment #27 from Frederic Crozat <fcrozat@suse.com> --- (In reply to Martin Wilck from comment #26)
@fcrozat, do you have an idea who could help here?
adding the right bugowners might help.. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c28 --- Comment #28 from Michael Gorse <mgorse@suse.com> --- I can't seem to reproduce this (is there something else that I need to do before hitting control-space?) I looked through the gtk3 commit log and don't see anything obviously relevant. I did find one X11 DnD-related commit: https://gitlab.gnome.org/GNOME/gtk/commit/39db78470452cf0b1a7d1ee196de3f20ee... I just created a package in home:mgorse:branches:GNOME:Factory with that commit reverted if anyone would like to test it, although I don't really think that that is the change that introduced it. Regardless, simply reverting it isn't really the right thing to do, since it was introduced to fix another crash. It might help for someone to git bisect the gtk3 changes between 2.24.27 and 2.24.29. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c29 --- Comment #29 from Michael Gorse <mgorse@suse.com> --- Oops; obviously I meant gtk 3.24, not 2.24. Also, I forgot to mention that I uncommented the relevant lines in /usr/bin/emacs to set the environment variables. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c30 --- Comment #30 from Martin Wilck <martin.wilck@suse.com> --- Latest TW update, enabled setting XLIB_SKIP_ARGB_VISUALS=1, I can *not* reproduce this any more, like before in comment 16. emacs-x11-27.2-2.1.x86_64 libgtk-3-0-3.24.29-1.3.x86_64 libX11-6-1.7.1-2.1.x86_64 xdpyinfo shows no differences wrt comment 15. Last time this happened, I saw the issue again one day later... I guess for now the change commenting out XLIB_SKIP_ARGB_VISUALS=1 should be reverted, and I'll re-open if I see this again (hopefully that won't happen). -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c31 --- Comment #31 from Martin Wilck <martin.wilck@suse.com> --- Uncommented the entire block, setting LC_NUMERIC=POSIX XLIB_SKIP_ARGB_VISUALS=1 GDK_RGBA=0 export LC_NUMERIC XLIB_SKIP_ARGB_VISUALS GDK_RGBA still bug not reproduced. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1186341 https://bugzilla.suse.com/show_bug.cgi?id=1186341#c37 --- Comment #37 from Martin Wilck <martin.wilck@suse.com> --- Arun, this bug is closed. Please follow up in bug 1191517. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com