unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs --with-x-toolkit=gtk3 - iconify, move mouse over icon -> crash
@ 2011-10-12 13:01 Adam Sjøgren
  2011-10-12 20:22 ` Adam Sjøgren
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Sjøgren @ 2011-10-12 13:01 UTC (permalink / raw)
  To: emacs-devel

  Hi.


When I compile emacs with gtk3 I get a crash if I iconify the Emacs
window and move the mouse over the icon.

The backtrace is this:

  $ gdb --args ./src/emacs -Q
  GNU gdb (GDB) 7.3-debian
  Copyright (C) 2011 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  For bug reporting instructions, please see:
  <http://www.gnu.org/software/gdb/bugs/>...
  Reading symbols from /usr/src/emacs/git/emacs/src/emacs...done.
  (gdb) run
  Starting program: /usr/src/emacs/git/emacs/src/emacs -Q
  [Thread debugging using libthread_db enabled]
  [New Thread 0x7fffec06e700 (LWP 26771)]
  [New Thread 0x7fffeb665700 (LWP 26772)]
  X protocol error: BadMatch (invalid parameter attributes) on protocol request 42
  When compiled with GTK, Emacs cannot recover from X disconnects.
  This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715
  For details, see etc/PROBLEMS.

  Program received signal SIGABRT, Aborted.
  0x00007ffff1eb76e7 in kill () at ../sysdeps/unix/syscall-template.S:82
  82      ../sysdeps/unix/syscall-template.S: No such file or directory.
          in ../sysdeps/unix/syscall-template.S
  (gdb) bt
  #0  0x00007ffff1eb76e7 in kill () at ../sysdeps/unix/syscall-template.S:82
  #1  0x00000000005616b2 in abort () at emacs.c:386
  #2  0x0000000000506bfb in x_connection_closed (dpy=0xe67200, 
      error_message=0x7fffffffc930 "X protocol error: BadMatch (invalid parameter attributes) on protocol request 42") at xterm.c:7796
  #3  0x000000000050710b in x_error_quitter (display=0xe67200, event=0x7fffffffcbe0) at xterm.c:7884
  #4  0x000000000050706c in x_error_handler (display=0xe67200, event=0x7fffffffcbe0) at xterm.c:7854
  #5  0x00007ffff4eb7263 in _XError () from /usr/lib/x86_64-linux-gnu/libX11.so.6
  #6  0x00007ffff4eb40b1 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
  #7  0x00007ffff4eb40f5 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
  #8  0x00007ffff4eb4b65 in _XEventsQueued () from /usr/lib/x86_64-linux-gnu/libX11.so.6
  #9  0x00007ffff4ea557d in XPending () from /usr/lib/x86_64-linux-gnu/libX11.so.6
  #10 0x00007ffff75935fb in ?? () from /usr/lib/libgdk-3.so.0
  #11 0x00007ffff6372957 in g_main_context_prepare () from /lib/libglib-2.0.so.0
  #12 0x00007ffff6373879 in ?? () from /lib/libglib-2.0.so.0
  #13 0x00007ffff6373e0d in g_main_context_pending () from /lib/libglib-2.0.so.0
  #14 0x00007ffff791553d in gtk_events_pending () from /usr/lib/libgtk-3.so.0
  #15 0x000000000050550d in XTread_socket (terminal=0x1022590, expected=1, hold_quit=0x7fffffffcec0) at xterm.c:7143
  #16 0x000000000057164f in read_avail_input (expected=1) at keyboard.c:6821
  #17 0x0000000000571fa9 in handle_async_input () at keyboard.c:7149
  #18 0x0000000000571fc8 in process_pending_signals () at keyboard.c:7165
  #19 0x000000000065bc5d in wait_reading_process_output (time_limit=0, microsecs=0, read_kbd=-1, do_display=1, wait_for_cell=12769794, wait_proc=0x0, 
      just_wait_proc=0) at process.c:4332
  #20 0x000000000056b416 in kbd_buffer_get_event (kbp=0x7fffffffd4a0, used_mouse_menu=0x7fffffffd9d4, end_time=0x0) at keyboard.c:3850
  #21 0x0000000000568dfa in read_char (commandflag=1, nmaps=2, maps=0x7fffffffd7f0, prev_event=12769794, used_mouse_menu=0x7fffffffd9d4, end_time=0x0)
      at keyboard.c:2796
  #22 0x00000000005766ac in read_key_sequence (keybuf=0x7fffffffdc40, bufsize=30, prompt=12769794, dont_downcase_last=0, can_return_switch_frame=1, 
      fix_current_buffer=1) at keyboard.c:9282
  #23 0x0000000000566206 in command_loop_1 () at keyboard.c:1447
  #24 0x0000000000601ed7 in internal_condition_case (bfun=0x565e21 <command_loop_1>, handlers=12821986, hfun=0x565709 <cmd_error>) at eval.c:1499
  #25 0x0000000000565b10 in command_loop_2 (ignore=12769794) at keyboard.c:1158
  #26 0x0000000000601861 in internal_catch (tag=12817778, func=0x565aea <command_loop_2>, arg=12769794) at eval.c:1256
  #27 0x0000000000565ac3 in command_loop () at keyboard.c:1137
  #28 0x000000000056524d in recursive_edit_1 () at keyboard.c:757
  #29 0x00000000005653f0 in Frecursive_edit () at keyboard.c:821
  #30 0x00000000005634b0 in main (argc=2, argv=0x7fffffffe558) at emacs.c:1706
  (gdb) 

If I use --with-x-toolkit=gtk instead, I do not get a crash.

This is with emacs built from source using (stolen almost verbatim from
Julien Danjou's nice emacs-snapshot packaging; only -O2 removed, I
think):

  CFLAGS="-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g" ./configure --build x86_64-linux-gnu --host x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.0.90/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.0.90/site-lisp:/usr/share/emacs/site-lisp --without-compress-info --with-crt-dir=/usr/lib/x86_64-linux-gnu/ --with-x=yes --with-x-toolkit=gtk3 --with-imagemagick=yes; /usr/bin/make CFLAGS="-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g" LDFLAGS="-g -Wl,--as-needed" bootstrap

on a Debian unstable amd64 system with libgtk-3-0 3.0.12-2 installed. I
use fvwm 1:2.5.30.ds-1 as my window manager.

Let me know if there is any information I can try and provide to aid
debugging.


  Best regards,

    Adam

-- 
 "Gav                                                         Adam Sjøgren
  Strik"                                                 asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Emacs --with-x-toolkit=gtk3 - iconify, move mouse over icon -> crash
  2011-10-12 13:01 Emacs --with-x-toolkit=gtk3 - iconify, move mouse over icon -> crash Adam Sjøgren
@ 2011-10-12 20:22 ` Adam Sjøgren
  2011-10-30 18:09   ` Jan Djärv
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Sjøgren @ 2011-10-12 20:22 UTC (permalink / raw)
  To: emacs-devel; +Cc: gtk-list

On Wed, 12 Oct 2011 15:01:51 +0200, I wrote:

> When I compile emacs with gtk3 I get a crash if I iconify the Emacs
> window and move the mouse over the icon.
[...]

The attached trivial patch avoids the crash for me. I wonder if gtk3
should be catching those X errors as gtk2 seemed to, if Emacs should
handle them itself, or something else?

diff --git a/src/xterm.c b/src/xterm.c
index 4d3b572..c8b6771 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -93,6 +93,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifdef USE_GTK
 #include "gtkutil.h"
+#ifdef HAVE_GTK3
+#include <X11/Xproto.h>
+#endif
 #endif
 
 #ifdef USE_LUCID
@@ -7848,6 +7851,13 @@ static void x_error_quitter (Display *, XErrorEvent *);
 static int
 x_error_handler (Display *display, XErrorEvent *event)
 {
+#ifdef HAVE_GTK3
+  if (event->error_code == BadMatch && event->request_code == X_SetInputFocus && event->minor_code == 0) {
+    fprintf(stderr, "Ignoring XErrorEvent(BadMatch X_SetInputFocus) serial: %ul\n", event->serial);
+    return 0;
+  }
+#endif
+
   if (x_error_message)
     x_error_catcher (display, event);
   else


  Best regards,

     Adam

-- 
 "Gav                                                         Adam Sjøgren
  Strik"                                                 asjo@koldfront.dk




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Emacs --with-x-toolkit=gtk3 - iconify, move mouse over icon -> crash
  2011-10-12 20:22 ` Adam Sjøgren
@ 2011-10-30 18:09   ` Jan Djärv
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Djärv @ 2011-10-30 18:09 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: gtk-list, emacs-devel

Hello.

I installed the patch with tiny modifications.

	Jan D.

12 okt 2011 kl. 22:22 skrev Adam Sjøgren:

> On Wed, 12 Oct 2011 15:01:51 +0200, I wrote:
> 
>> When I compile emacs with gtk3 I get a crash if I iconify the Emacs
>> window and move the mouse over the icon.
> [...]
> 
> The attached trivial patch avoids the crash for me. I wonder if gtk3
> should be catching those X errors as gtk2 seemed to, if Emacs should
> handle them itself, or something else?
> 
> diff --git a/src/xterm.c b/src/xterm.c
> index 4d3b572..c8b6771 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -93,6 +93,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
> 
> #ifdef USE_GTK
> #include "gtkutil.h"
> +#ifdef HAVE_GTK3
> +#include <X11/Xproto.h>
> +#endif
> #endif
> 
> #ifdef USE_LUCID
> @@ -7848,6 +7851,13 @@ static void x_error_quitter (Display *, XErrorEvent *);
> static int
> x_error_handler (Display *display, XErrorEvent *event)
> {
> +#ifdef HAVE_GTK3
> +  if (event->error_code == BadMatch && event->request_code == X_SetInputFocus && event->minor_code == 0) {
> +    fprintf(stderr, "Ignoring XErrorEvent(BadMatch X_SetInputFocus) serial: %ul\n", event->serial);
> +    return 0;
> +  }
> +#endif
> +
>   if (x_error_message)
>     x_error_catcher (display, event);
>   else
> 
> 
>  Best regards,
> 
>     Adam
> 
> -- 
> "Gav                                                         Adam Sjøgren
>  Strik"                                                 asjo@koldfront.dk
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-30 18:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-12 13:01 Emacs --with-x-toolkit=gtk3 - iconify, move mouse over icon -> crash Adam Sjøgren
2011-10-12 20:22 ` Adam Sjøgren
2011-10-30 18:09   ` Jan Djärv

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).