unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#407: gpm server stop making emacs abort()
@ 2008-06-13 20:55 ` Kevin Ryde
  2008-06-13 22:18   ` Stefan Monnier
                     ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Kevin Ryde @ 2008-06-13 20:55 UTC (permalink / raw)
  To: emacs-pretest-bug

[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]

If running with

	(gpm-mouse-mode 1)

and if you stop the gpm server, then emacs dies with

	Fatal error (6)Aborted

Output from "bt full" below; xbacktrace printed nothing at all.


The backtrace shows it at the abort() under the EBADF case in
wait_reading_process_output().  I think when Gpm_GetEvent gets an eof
from the server it closes gpm_fd; maybe that's the bad fd in question.


In GNU Emacs 23.0.60.1 (i586-pc-linux-gnu, GTK+ Version 2.12.10)
 of 2008-06-13 on blah.blah
configured using `configure  'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  gpm-mouse-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t


[-- Attachment #2: bt.txt --]
[-- Type: text/plain, Size: 5662 bytes --]

#0  0xb76728c1 in kill () from /lib/libc.so.6
No symbol table info available.
#1  0x080fbd49 in abort () at /down/emacs/src/emacs.c:427
No locals.
#2  0x0819559a in wait_reading_process_output (time_limit=30, microsecs=0, 
    read_kbd=-1, do_display=1, wait_for_cell=137641241, wait_proc=0x0, 
    just_wait_proc=0) at /down/emacs/src/process.c:4634
	timeout_reduced_for_timers = 0
	channel = 1
	nfds = -1
	Available = {fds_bits = {160, 0 <repeats 31 times>}}
	Connecting = {fds_bits = {0 <repeats 32 times>}}
	check_connect = 0
	check_delay = 0
	no_avail = 0
	xerrno = 9
	proc = 0
	timeout = {tv_sec = 25, tv_usec = 696000}
	end_time = {tv_sec = 1213338499, tv_usec = 981053}
	wait_channel = -1
	got_some_input = 1
#3  0x08056db5 in sit_for (timeout=240, reading=1, do_display=1)
    at /down/emacs/src/dispnew.c:6618
	sec = 30
	usec = 0
#4  0x08107775 in read_char (commandflag=1, nmaps=2, maps=0xbf9e9a60, 
    prev_event=137641241, used_mouse_menu=0xbf9e9ae8, end_time=0x0)
    at /down/emacs/src/keyboard.c:2930
	tem0 = <value optimized out>
	delay_level = 4
	buffer_size = <value optimized out>
	c = 137641241
	local_getcjmp = {{__jmpbuf = {137641241, 138142696, 146700176, 
      -1080124904, 690995329, 887540718}, __mask_was_saved = 0, 
    __saved_mask = {__val = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137667092, 1536, 
        3214842376, 135944962, 137667088, 0, 0, 0, 0, 0, 0, 0, 192, 
        4294967292, 137667088, 0, 137667088, 137667088, 3214842408, 135633649, 
        137667088, 192}}}}
	save_jump = {{__jmpbuf = {0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, 
    __saved_mask = {__val = {0 <repeats 32 times>}}}}
	key_already_recorded = 0
	tem = 146700176
	save = <value optimized out>
	previous_echo_area_message = 137641241
	also_record = 137641241
	reread = 0
	polling_stopped_here = <value optimized out>
	orig_kboard = (struct kboard *) 0x8be7790
#5  0x0810a47a in read_key_sequence (keybuf=0xbf9e9bc4, bufsize=30, 
    prompt=137641241, dont_downcase_last=0, can_return_switch_frame=1, 
    fix_current_buffer=1) at /down/emacs/src/keyboard.c:9443
	interrupted_kboard = (KBOARD *) 0x8be7790
	key = 137706808
	used_mouse_menu = 0
	echo_local_start = 0
	last_real_key_start = 0
	keys_local_start = 0
	local_first_binding = 0
	from_string = 137641241
	count = 2
	t = 0
	echo_start = 0
	keys_start = 0
	nmaps = 2
	nmaps_allocated = 2
	defs = (Lisp_Object * volatile) 0xbf9e9a40
	submaps = (Lisp_Object * volatile) 0xbf9e9a60
	orig_local_map = 147392757
	orig_keymap = 137641241
	localized_local_map = 0
	first_binding = 0
	first_unbound = 31
	mock_input = 0
	fkey = {parent = 137948733, map = 137948733, start = 0, end = 0}
	keytran = {parent = 137634685, map = 137634685, start = 0, end = 0}
	indec = {parent = 137948797, map = 137948797, start = 0, end = 0}
	shift_translated = 0
	delayed_switch_frame = 137641241
	original_uppercase = 137800728
	original_uppercase_position = -1
	starting_buffer = (struct buffer *) 0x834a210
	fake_prefixed_keys = 137641241
#6  0x0810bff0 in command_loop_1 () at /down/emacs/src/keyboard.c:1651
	cmd = <value optimized out>
	lose = 137837243
	nonundocount = 0
	keybuf = {24, 56, 0 <repeats 18 times>, -1080124376, -1080124528, 0, 
  -1080164352, 137641241, 142934753, 138142696, 138142696, 138142712, 
  -1080124344}
	i = 2
	prev_modiff = 11
	prev_buffer = (struct buffer *) 0x834a210
	already_adjusted = 0
#7  0x0815edcb in internal_condition_case (bfun=0x810bd11 <command_loop_1>, 
    handlers=137684385, hfun=0x8106559 <cmd_error>)
    at /down/emacs/src/eval.c:1511
	val = <value optimized out>
	c = {tag = 137641241, val = 137641241, next = 0xbf9e9d70, gcpro = 0x0, 
  jmp = {{__jmpbuf = {138142696, 138142696, 138142712, -1080124104, 691576961, 
        1071307758}, __mask_was_saved = 0, __saved_mask = {__val = {1, 
          3214842728, 3077261132, 3078107488, 3086920636, 3214842752, 
          3078103028, 276967387, 3079470328, 8655230, 48, 3076832444, 
          3214843408, 3214843116, 3214843396, 3214843256, 135346508, 2, 
          3214843268, 3214843116, 0 <repeats 12 times>}}}}, backlist = 0x0, 
  handlerlist = 0x0, lisp_eval_depth = 0, pdlcount = 2, 
  poll_suppress_count = 1, interrupt_input_blocked = 0, byte_stack = 0x0}
	h = {handler = 137684385, var = 137641241, chosen_clause = 0, 
  tag = 0xbf9e9c70, next = 0x0}
#8  0x08105aa2 in command_loop_2 () at /down/emacs/src/keyboard.c:1367
	val = 0
#9  0x0815ee81 in internal_catch (tag=137680361, 
    func=0x8105a7f <command_loop_2>, arg=137641241)
    at /down/emacs/src/eval.c:1247
	c = {tag = 137680361, val = 137641241, next = 0x0, gcpro = 0x0, jmp = {
    {__jmpbuf = {138142696, 138142696, 138142712, -1080123848, 691716225, 
        1071442414}, __mask_was_saved = 0, __saved_mask = {__val = {0, 0, 0, 
          0, 0, 3077261489, 0, 0, 0, 0, 0, 0, 0, 0, 192, 3078107544, 1, 176, 
          22, 0, 137872602, 137869672, 137872600, 3214843432, 135602776, 
          137869673, 137872602, 137641241, 137667088, 137872602, 0, 
          137641265}}}}, backlist = 0x0, handlerlist = 0x0, 
  lisp_eval_depth = 0, pdlcount = 2, poll_suppress_count = 1, 
  interrupt_input_blocked = 0, byte_stack = 0x0}
#10 0x081063d6 in command_loop () at /down/emacs/src/keyboard.c:1346
No locals.
#11 0x081066eb in recursive_edit_1 () at /down/emacs/src/keyboard.c:955
	val = <value optimized out>
#12 0x08106812 in Frecursive_edit () at /down/emacs/src/keyboard.c:1017
	buffer = 137641241
#13 0x080fd61d in main (argc=2, argv=0xbf9ea244)
    at /down/emacs/src/emacs.c:1772
	dummy = 48
	stack_bottom_variable = 7 '\a'
	do_initial_setlocale = 1
	skip_args = 0
	rlim = {rlim_cur = 8388608, rlim_max = 18446744073709551615}
	no_loadup = 0
	junk = 0x0

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

* bug#407: gpm server stop making emacs abort()
  2008-06-13 20:55 ` bug#407: gpm server stop making emacs abort() Kevin Ryde
@ 2008-06-13 22:18   ` Stefan Monnier
       [not found]   ` <mailman.13216.1213396033.18990.bug-gnu-emacs@gnu.org>
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2008-06-13 22:18 UTC (permalink / raw)
  To: 407

> If running with
> 	(gpm-mouse-mode 1)
> and if you stop the gpm server, then emacs dies with
> 	Fatal error (6)Aborted
> Output from "bt full" below; xbacktrace printed nothing at all.

> The backtrace shows it at the abort() under the EBADF case in
> wait_reading_process_output().  I think when Gpm_GetEvent gets an eof
> from the server it closes gpm_fd; maybe that's the bad fd in question.

I can't test it right now.  Does the patch below help?


        Stefan


--- keyboard.c.~1.959.~	2008-06-03 02:14:30.000000000 -0400
+++ keyboard.c	2008-06-13 18:17:35.000000000 -0400
@@ -7189,6 +7189,8 @@
       while (gpm = Gpm_GetEvent (&event), gpm == 1) {
 	  nread += handle_one_term_event (tty, &event, &hold_quit);
       }
+      if (gpm < 0)
+	delete_gpm_wait_descriptor (gpm_fd);
       if (hold_quit.kind != NO_EVENT)
 	  kbd_buffer_store_event (&hold_quit);
       if (nread)






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

* bug#407: gpm server stop making emacs abort()
       [not found]   ` <mailman.13216.1213396033.18990.bug-gnu-emacs@gnu.org>
@ 2008-07-01 20:43     ` Sven Joachim
  2008-07-03 22:00       ` Kevin Ryde
  2008-09-12  4:14       ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Sven Joachim @ 2008-07-01 20:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Kevin Ryde, 407

[ Stefan, it seems you inadvertently forgot to CC the bug submitter,
  which is why you did not get an answer from him.]

On 2008-06-14 00:18 +0200, Stefan Monnier wrote:

>> If running with
>> 	(gpm-mouse-mode 1)
>> and if you stop the gpm server, then emacs dies with
>> 	Fatal error (6)Aborted

I also saw that. When gpm was upgraded and restarted, Emacs aborted.

>> Output from "bt full" below; xbacktrace printed nothing at all.
>
>> The backtrace shows it at the abort() under the EBADF case in
>> wait_reading_process_output().  I think when Gpm_GetEvent gets an eof
>> from the server it closes gpm_fd; maybe that's the bad fd in question.
>
> I can't test it right now.  Does the patch below help?
>
>
>         Stefan
>
>
> --- keyboard.c.~1.959.~	2008-06-03 02:14:30.000000000 -0400
> +++ keyboard.c	2008-06-13 18:17:35.000000000 -0400
> @@ -7189,6 +7189,8 @@
>        while (gpm = Gpm_GetEvent (&event), gpm == 1) {
>  	  nread += handle_one_term_event (tty, &event, &hold_quit);
>        }
> +      if (gpm < 0)
> +	delete_gpm_wait_descriptor (gpm_fd);
>        if (hold_quit.kind != NO_EVENT)
>  	  kbd_buffer_store_event (&hold_quit);
>        if (nread)

Works fine for me.

Regards,
        Sven






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

* bug#407: gpm server stop making emacs abort()
  2008-07-01 20:43     ` Sven Joachim
@ 2008-07-03 22:00       ` Kevin Ryde
  2008-09-12  4:14       ` Stefan Monnier
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin Ryde @ 2008-07-03 22:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Sven Joachim, 407

> On 2008-06-14 00:18 +0200, Stefan Monnier wrote:
>
>> Does the patch below help?

Yep.  But should it clear gpm_tty too?  It seems to need a
"(gpm-mouse-mode 0)" before a fresh "(gpm-mouse-mode 1)" will take
effect when the server is running again.






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

* bug#407: gpm server stop making emacs abort()
  2008-07-01 20:43     ` Sven Joachim
  2008-07-03 22:00       ` Kevin Ryde
@ 2008-09-12  4:14       ` Stefan Monnier
  2008-09-12  5:54         ` Sven Joachim
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2008-09-12  4:14 UTC (permalink / raw)
  To: Sven Joachim; +Cc: Kevin Ryde, 407

>> +      if (gpm < 0)
>> +	delete_gpm_wait_descriptor (gpm_fd);
>> if (hold_quit.kind != NO_EVENT)
>> kbd_buffer_store_event (&hold_quit);
>> if (nread)

> Works fine for me.

I've installed a similar patch.  It does not do (gpm-mouse-mode 0)
because I don't think it is safe at this point.  So there's probably
room for improvement, but it hopefully fixes the crashes.


        Stefan







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

* bug#407: gpm server stop making emacs abort()
  2008-09-12  4:14       ` Stefan Monnier
@ 2008-09-12  5:54         ` Sven Joachim
  2008-09-12 17:08           ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Sven Joachim @ 2008-09-12  5:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Kevin Ryde, 407

On 2008-09-12 06:14 +0200, Stefan Monnier wrote:

>>> +      if (gpm < 0)
>>> +	delete_gpm_wait_descriptor (gpm_fd);
>>> if (hold_quit.kind != NO_EVENT)
>>> kbd_buffer_store_event (&hold_quit);
>>> if (nread)
>
>> Works fine for me.
>
> I've installed a similar patch.  It does not do (gpm-mouse-mode 0)
> because I don't think it is safe at this point.  So there's probably
> room for improvement, but it hopefully fixes the crashes.

Indeed it fixes the crashes, but the room for improvement is rather
large, as gpm-mouse-mode does not work at all now. :-(

Sven







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

* bug#407: gpm server stop making emacs abort()
  2008-09-12  5:54         ` Sven Joachim
@ 2008-09-12 17:08           ` Stefan Monnier
  2008-10-30 22:11             ` Kevin Ryde
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2008-09-12 17:08 UTC (permalink / raw)
  To: Nick Roberts, Sven Joachim; +Cc: Kevin Ryde, 407

>>>> +      if (gpm < 0)
>>>> +	delete_gpm_wait_descriptor (gpm_fd);
>>>> if (hold_quit.kind != NO_EVENT)
>>>> kbd_buffer_store_event (&hold_quit);
>>>> if (nread)
>> 
>>> Works fine for me.
>> 
>> I've installed a similar patch.  It does not do (gpm-mouse-mode 0)
>> because I don't think it is safe at this point.  So there's probably
>> room for improvement, but it hopefully fixes the crashes.

> Indeed it fixes the crashes, but the room for improvement is rather
> large, as gpm-mouse-mode does not work at all now. :-(

Huh!  Indeed!  The condition "gpm < 0" is encountered all the time, so
my patch ends up turning gpm off right away.  But now I'm lost: I don't
understand what delete_gpm_wait_descriptor and add_gpm_wait_descriptor
do, because if I remove the call to add_gpm_wait_descriptor, the gpm
support seems to still work just fine.

Nick, do you have an idea what's going on?


        Stefan






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

* bug#407: gpm server stop making emacs abort()
  2008-09-12 17:08           ` Stefan Monnier
@ 2008-10-30 22:11             ` Kevin Ryde
  0 siblings, 0 replies; 10+ messages in thread
From: Kevin Ryde @ 2008-10-30 22:11 UTC (permalink / raw)
  To: 407

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> Huh!  Indeed!  The condition "gpm < 0" is encountered all the time,

Yes, EWOULDBLOCK.  gpm==0 is eof from the server.

gpm==-1 is a protocol error as well as EWOULDBLOCK, but it might be ok
to quietly ignore that.  It probably only happens if libgpm.so and the
running daemon are incompatible versions.

I get some joy from the change below.  I think the add/delete descriptor
calls might be right, but I'm not terrifically confident.

One thing I notice not done is to turn off the gpm-mouse-mode minor mode
variable when stopping like this.  Maybe that's good enough.  It won't
stop normally, so as long as emacs doesn't abort that could be enough.
(You can M-x gpm-mouse-mode twice to toggle it back on.)



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: keyboard.c.gpm.diff --]
[-- Type: text/x-diff, Size: 1430 bytes --]

*** keyboard.c	31 Oct 2008 08:25:09 +1100	1.977
--- keyboard.c	31 Oct 2008 08:25:19 +1100	
***************
*** 7102,7118 ****
    {
        Gpm_Event event;
        struct input_event hold_quit;
!       int gpm;
  
        EVENT_INIT (hold_quit);
        hold_quit.kind = NO_EVENT;
  
        while (gpm = Gpm_GetEvent (&event), gpm == 1) {
  	  nread += handle_one_term_event (tty, &event, &hold_quit);
        }
!       if (gpm < 0)
! 	/* Presumably the GPM daemon has closed the connection.  */
! 	close_gpm ();
        if (hold_quit.kind != NO_EVENT)
  	  kbd_buffer_store_event (&hold_quit);
        if (nread)
--- 7102,7123 ----
    {
        Gpm_Event event;
        struct input_event hold_quit;
!       int gpm, fd;
  
        EVENT_INIT (hold_quit);
        hold_quit.kind = NO_EVENT;
  
+       /* gpm==1 if event received.
+          gpm==0 if the GPM daemon has closed the connection, in which case
+                 Gpm_GetEvent closes gpm_fd and clears it to -1, so save that
+                 for close_gpm() to remove from the select masks.
+          gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */
+       fd = gpm_fd;
        while (gpm = Gpm_GetEvent (&event), gpm == 1) {
  	  nread += handle_one_term_event (tty, &event, &hold_quit);
        }
!       if (gpm == 0)
! 	close_gpm (fd);
        if (hold_quit.kind != NO_EVENT)
  	  kbd_buffer_store_event (&hold_quit);
        if (nread)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: term.c.gpm.diff --]
[-- Type: text/x-diff, Size: 904 bytes --]

*** term.c	31 Oct 2008 08:23:59 +1100	1.229
--- term.c	31 Oct 2008 08:24:05 +1100	
***************
*** 3129,3138 ****
  }
  
  void
! close_gpm ()
  {
!   if (gpm_fd >= 0)
!     delete_gpm_wait_descriptor (gpm_fd);
    while (Gpm_Close()); /* close all the stack */
    gpm_tty = NULL;
  }
--- 3129,3139 ----
  }
  
  void
! close_gpm (fd)
!      int fd;
  {
!   if (fd >= 0)
!     delete_gpm_wait_descriptor (fd);
    while (Gpm_Close()); /* close all the stack */
    gpm_tty = NULL;
  }
***************
*** 3150,3156 ****
    if (!tty || gpm_tty != tty)
      return Qnil;       /* Not activated on this terminal, nothing to do.  */
  
!   close_gpm ();
    return Qnil;
  }
  #endif /* HAVE_GPM */
--- 3151,3157 ----
    if (!tty || gpm_tty != tty)
      return Qnil;       /* Not activated on this terminal, nothing to do.  */
  
!   close_gpm (gpm_fd);
    return Qnil;
  }
  #endif /* HAVE_GPM */

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: termhooks.h.gpm.diff --]
[-- Type: text/x-diff, Size: 468 bytes --]

*** termhooks.h	13 Sep 2008 07:34:28 +1000	1.98
--- termhooks.h	30 Oct 2008 18:54:52 +1100	
***************
*** 644,650 ****
  extern struct terminal *initial_terminal;
  
  #ifdef HAVE_GPM
! extern void close_gpm (void);
  #endif
  
  /* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d
--- 644,650 ----
  extern struct terminal *initial_terminal;
  
  #ifdef HAVE_GPM
! extern void close_gpm P_ ((int));
  #endif
  
  /* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d

[-- Attachment #5: Type: text/plain, Size: 120 bytes --]


-- 
The sigfile one-line movie review series:
"Cold Fever" -- easily the best Japanese-Icelandic road movie ever made.

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

* bug#407: marked as done (gpm server stop making emacs abort())
  2008-06-13 20:55 ` bug#407: gpm server stop making emacs abort() Kevin Ryde
  2008-06-13 22:18   ` Stefan Monnier
       [not found]   ` <mailman.13216.1213396033.18990.bug-gnu-emacs@gnu.org>
@ 2009-03-27 16:25   ` Emacs bug Tracking System
       [not found]   ` <handler.407.D407.123817070925838.notifdone@emacsbugs.donarmstrong.com>
  3 siblings, 0 replies; 10+ messages in thread
From: Emacs bug Tracking System @ 2009-03-27 16:25 UTC (permalink / raw)
  To: Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 872 bytes --]


Your message dated Fri, 27 Mar 2009 12:18:19 -0400
with message-id <jwvocvndjs1.fsf-monnier+emacsbugreports@gnu.org>
and subject line gpm server stop making emacs abort()
has caused the Emacs bug report #407,
regarding gpm server stop making emacs abort()
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
407: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=407
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 9230 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1252 bytes --]

If running with

	(gpm-mouse-mode 1)

and if you stop the gpm server, then emacs dies with

	Fatal error (6)Aborted

Output from "bt full" below; xbacktrace printed nothing at all.


The backtrace shows it at the abort() under the EBADF case in
wait_reading_process_output().  I think when Gpm_GetEvent gets an eof
from the server it closes gpm_fd; maybe that's the bad fd in question.


In GNU Emacs 23.0.60.1 (i586-pc-linux-gnu, GTK+ Version 2.12.10)
 of 2008-06-13 on blah.blah
configured using `configure  'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  gpm-mouse-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t


[-- Attachment #2.1.2: bt.txt --]
[-- Type: text/plain, Size: 5662 bytes --]

#0  0xb76728c1 in kill () from /lib/libc.so.6
No symbol table info available.
#1  0x080fbd49 in abort () at /down/emacs/src/emacs.c:427
No locals.
#2  0x0819559a in wait_reading_process_output (time_limit=30, microsecs=0, 
    read_kbd=-1, do_display=1, wait_for_cell=137641241, wait_proc=0x0, 
    just_wait_proc=0) at /down/emacs/src/process.c:4634
	timeout_reduced_for_timers = 0
	channel = 1
	nfds = -1
	Available = {fds_bits = {160, 0 <repeats 31 times>}}
	Connecting = {fds_bits = {0 <repeats 32 times>}}
	check_connect = 0
	check_delay = 0
	no_avail = 0
	xerrno = 9
	proc = 0
	timeout = {tv_sec = 25, tv_usec = 696000}
	end_time = {tv_sec = 1213338499, tv_usec = 981053}
	wait_channel = -1
	got_some_input = 1
#3  0x08056db5 in sit_for (timeout=240, reading=1, do_display=1)
    at /down/emacs/src/dispnew.c:6618
	sec = 30
	usec = 0
#4  0x08107775 in read_char (commandflag=1, nmaps=2, maps=0xbf9e9a60, 
    prev_event=137641241, used_mouse_menu=0xbf9e9ae8, end_time=0x0)
    at /down/emacs/src/keyboard.c:2930
	tem0 = <value optimized out>
	delay_level = 4
	buffer_size = <value optimized out>
	c = 137641241
	local_getcjmp = {{__jmpbuf = {137641241, 138142696, 146700176, 
      -1080124904, 690995329, 887540718}, __mask_was_saved = 0, 
    __saved_mask = {__val = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137667092, 1536, 
        3214842376, 135944962, 137667088, 0, 0, 0, 0, 0, 0, 0, 192, 
        4294967292, 137667088, 0, 137667088, 137667088, 3214842408, 135633649, 
        137667088, 192}}}}
	save_jump = {{__jmpbuf = {0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, 
    __saved_mask = {__val = {0 <repeats 32 times>}}}}
	key_already_recorded = 0
	tem = 146700176
	save = <value optimized out>
	previous_echo_area_message = 137641241
	also_record = 137641241
	reread = 0
	polling_stopped_here = <value optimized out>
	orig_kboard = (struct kboard *) 0x8be7790
#5  0x0810a47a in read_key_sequence (keybuf=0xbf9e9bc4, bufsize=30, 
    prompt=137641241, dont_downcase_last=0, can_return_switch_frame=1, 
    fix_current_buffer=1) at /down/emacs/src/keyboard.c:9443
	interrupted_kboard = (KBOARD *) 0x8be7790
	key = 137706808
	used_mouse_menu = 0
	echo_local_start = 0
	last_real_key_start = 0
	keys_local_start = 0
	local_first_binding = 0
	from_string = 137641241
	count = 2
	t = 0
	echo_start = 0
	keys_start = 0
	nmaps = 2
	nmaps_allocated = 2
	defs = (Lisp_Object * volatile) 0xbf9e9a40
	submaps = (Lisp_Object * volatile) 0xbf9e9a60
	orig_local_map = 147392757
	orig_keymap = 137641241
	localized_local_map = 0
	first_binding = 0
	first_unbound = 31
	mock_input = 0
	fkey = {parent = 137948733, map = 137948733, start = 0, end = 0}
	keytran = {parent = 137634685, map = 137634685, start = 0, end = 0}
	indec = {parent = 137948797, map = 137948797, start = 0, end = 0}
	shift_translated = 0
	delayed_switch_frame = 137641241
	original_uppercase = 137800728
	original_uppercase_position = -1
	starting_buffer = (struct buffer *) 0x834a210
	fake_prefixed_keys = 137641241
#6  0x0810bff0 in command_loop_1 () at /down/emacs/src/keyboard.c:1651
	cmd = <value optimized out>
	lose = 137837243
	nonundocount = 0
	keybuf = {24, 56, 0 <repeats 18 times>, -1080124376, -1080124528, 0, 
  -1080164352, 137641241, 142934753, 138142696, 138142696, 138142712, 
  -1080124344}
	i = 2
	prev_modiff = 11
	prev_buffer = (struct buffer *) 0x834a210
	already_adjusted = 0
#7  0x0815edcb in internal_condition_case (bfun=0x810bd11 <command_loop_1>, 
    handlers=137684385, hfun=0x8106559 <cmd_error>)
    at /down/emacs/src/eval.c:1511
	val = <value optimized out>
	c = {tag = 137641241, val = 137641241, next = 0xbf9e9d70, gcpro = 0x0, 
  jmp = {{__jmpbuf = {138142696, 138142696, 138142712, -1080124104, 691576961, 
        1071307758}, __mask_was_saved = 0, __saved_mask = {__val = {1, 
          3214842728, 3077261132, 3078107488, 3086920636, 3214842752, 
          3078103028, 276967387, 3079470328, 8655230, 48, 3076832444, 
          3214843408, 3214843116, 3214843396, 3214843256, 135346508, 2, 
          3214843268, 3214843116, 0 <repeats 12 times>}}}}, backlist = 0x0, 
  handlerlist = 0x0, lisp_eval_depth = 0, pdlcount = 2, 
  poll_suppress_count = 1, interrupt_input_blocked = 0, byte_stack = 0x0}
	h = {handler = 137684385, var = 137641241, chosen_clause = 0, 
  tag = 0xbf9e9c70, next = 0x0}
#8  0x08105aa2 in command_loop_2 () at /down/emacs/src/keyboard.c:1367
	val = 0
#9  0x0815ee81 in internal_catch (tag=137680361, 
    func=0x8105a7f <command_loop_2>, arg=137641241)
    at /down/emacs/src/eval.c:1247
	c = {tag = 137680361, val = 137641241, next = 0x0, gcpro = 0x0, jmp = {
    {__jmpbuf = {138142696, 138142696, 138142712, -1080123848, 691716225, 
        1071442414}, __mask_was_saved = 0, __saved_mask = {__val = {0, 0, 0, 
          0, 0, 3077261489, 0, 0, 0, 0, 0, 0, 0, 0, 192, 3078107544, 1, 176, 
          22, 0, 137872602, 137869672, 137872600, 3214843432, 135602776, 
          137869673, 137872602, 137641241, 137667088, 137872602, 0, 
          137641265}}}}, backlist = 0x0, handlerlist = 0x0, 
  lisp_eval_depth = 0, pdlcount = 2, poll_suppress_count = 1, 
  interrupt_input_blocked = 0, byte_stack = 0x0}
#10 0x081063d6 in command_loop () at /down/emacs/src/keyboard.c:1346
No locals.
#11 0x081066eb in recursive_edit_1 () at /down/emacs/src/keyboard.c:955
	val = <value optimized out>
#12 0x08106812 in Frecursive_edit () at /down/emacs/src/keyboard.c:1017
	buffer = 137641241
#13 0x080fd61d in main (argc=2, argv=0xbf9ea244)
    at /down/emacs/src/emacs.c:1772
	dummy = 48
	stack_bottom_variable = 7 '\a'
	do_initial_setlocale = 1
	skip_args = 0
	rlim = {rlim_cur = 8388608, rlim_max = 18446744073709551615}
	no_loadup = 0
	junk = 0x0

[-- Attachment #3: Type: message/rfc822, Size: 1675 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: 407-done@emacsbugs.donarmstrong.com
Subject: gpm server stop making emacs abort()
Date: Fri, 27 Mar 2009 12:18:19 -0400
Message-ID: <jwvocvndjs1.fsf-monnier+emacsbugreports@gnu.org>

Thanks Kevin for your patch.  I've tried it out and it seems to be fine,
so I installed it (at long last).
We're really relying too much on undocumented parts of the GPM API, tho.


        Stefan


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

* bug#407: closed by Stefan Monnier <monnier@iro.umontreal.ca> (gpm server stop making emacs abort())
       [not found]   ` <handler.407.D407.123817070925838.notifdone@emacsbugs.donarmstrong.com>
@ 2009-03-28  0:46     ` Kevin Ryde
  0 siblings, 0 replies; 10+ messages in thread
From: Kevin Ryde @ 2009-03-28  0:46 UTC (permalink / raw)
  To: 407

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> I've tried it out and it seems to be fine, so I installed it (at long
> last).

I'd wondered if it suffered some bit-rot in the interim (changes to
other stuff somewhere), but yes it seems to go.

> We're really relying too much on undocumented parts of the GPM API, tho.

I suspect it may be slightly geared towards a program that uses gpm all
the time and will exit if it goes away, so normally you don't care much
about a shutdown/disconnect.






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

end of thread, other threads:[~2009-03-28  0:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <jwvocvndjs1.fsf-monnier+emacsbugreports@gnu.org>
2008-06-13 20:55 ` bug#407: gpm server stop making emacs abort() Kevin Ryde
2008-06-13 22:18   ` Stefan Monnier
     [not found]   ` <mailman.13216.1213396033.18990.bug-gnu-emacs@gnu.org>
2008-07-01 20:43     ` Sven Joachim
2008-07-03 22:00       ` Kevin Ryde
2008-09-12  4:14       ` Stefan Monnier
2008-09-12  5:54         ` Sven Joachim
2008-09-12 17:08           ` Stefan Monnier
2008-10-30 22:11             ` Kevin Ryde
2009-03-27 16:25   ` bug#407: marked as done (gpm server stop making emacs abort()) Emacs bug Tracking System
     [not found]   ` <handler.407.D407.123817070925838.notifdone@emacsbugs.donarmstrong.com>
2009-03-28  0:46     ` bug#407: closed by Stefan Monnier <monnier@iro.umontreal.ca> " Kevin Ryde

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).