all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
To: Leo <sdl.web@gmail.com>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: 23.0.50; Emacs seg fault
Date: Sun, 30 Sep 2007 12:49:08 +0200	[thread overview]
Message-ID: <87abr4a0nv.fsf@kfs-lx.testafd.dk> (raw)
In-Reply-To: <m2ve9tqitp.fsf@cam.ac.uk> (Leo's message of "Sat\, 29 Sep 2007 22\:10\:10 +0100")

Leo <sdl.web@gmail.com> writes:

> #1  0x08194676 in wait_reading_process_output (time_limit=30, microsecs=0, read_kbd=-1, do_display=1, wait_for_cell=137551137, 
>     wait_proc=0x0, just_wait_proc=0) at process.c:4880

I doubt that is the right line number due to compiler optimizations.
Compile with CFLAGS="-g -O0" to get max debugging info.

Since xerrno = 9  (EBADF), I suspect it actually traps in
process.c line 4651 

This means that one of the bits in the Available mask does not
correspond to a valid file descriptor.

Looking at the code, I see that this piece of code is executed
between setting up the Available mask and the call to select.

      /* If frame size has changed or the window is newly mapped,
	 redisplay now, before we start to wait.  There is a race
	 condition here; if a SIGIO arrives between now and the select
	 and indicates that a frame is trashed, the select may block
	 displaying a trashed screen.  */
      if (frame_garbaged && do_display)
	{
	  clear_waiting_for_input ();
	  redisplay_preserve_echo_area (11);
	  if (read_kbd < 0)
	    set_waiting_for_input (&timeout);
	}

This looks dangerous to me.

Could you try this patch and see if it fixes the problem:

*** process.c	20 Sep 2007 12:50:59 +0200	1.520
--- process.c	30 Sep 2007 12:45:50 +0200	
***************
*** 4509,4514 ****
--- 4509,4527 ----
  	  break;
  	}
  
+       /* If frame size has changed or the window is newly mapped,
+ 	 redisplay now, before we start to wait.  There is a race
+ 	 condition here; if a SIGIO arrives between now and the select
+ 	 and indicates that a frame is trashed, the select may block
+ 	 displaying a trashed screen.  */
+       if (frame_garbaged && do_display)
+ 	{
+ 	  clear_waiting_for_input ();
+ 	  redisplay_preserve_echo_area (11);
+ 	  if (read_kbd < 0)
+ 	    set_waiting_for_input (&timeout);
+ 	}
+ 
        /* Wait till there is something to do */
  
        if (wait_proc && just_wait_proc)
***************
*** 4535,4553 ****
   	  check_delay = wait_channel >= 0 ? 0 : process_output_delay_count;
  	}
  
-       /* If frame size has changed or the window is newly mapped,
- 	 redisplay now, before we start to wait.  There is a race
- 	 condition here; if a SIGIO arrives between now and the select
- 	 and indicates that a frame is trashed, the select may block
- 	 displaying a trashed screen.  */
-       if (frame_garbaged && do_display)
- 	{
- 	  clear_waiting_for_input ();
- 	  redisplay_preserve_echo_area (11);
- 	  if (read_kbd < 0)
- 	    set_waiting_for_input (&timeout);
- 	}
- 
        no_avail = 0;
        if (read_kbd && detect_input_pending ())
  	{
--- 4548,4553 ----


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2007-09-30 10:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-29 21:10 23.0.50; Emacs seg fault Leo
2007-09-30  2:56 ` Stefan Monnier
2007-09-30  6:09   ` Leo
2007-09-30 12:55   ` Richard Stallman
2007-09-30 10:49 ` Kim F. Storm [this message]
2007-09-30 11:07   ` David Kastrup
2007-09-30 15:44   ` Leo
2007-10-01 17:41     ` Richard Stallman
2007-10-05 19:29       ` Leo
2007-09-30 16:10   ` Eli Zaretskii
2007-10-05 19:28   ` Leo
2007-10-06 22:41     ` Kim F. Storm
2007-10-07  7:34       ` Leo
2007-10-07 21:35         ` Kim F. Storm
2007-10-08  0:19           ` Leo
2007-10-08 13:01             ` Kim F. Storm
2007-10-08 16:09               ` Dan Nicolaescu
2007-10-08 19:13                 ` Leo
2007-10-08 20:15                   ` Dan Nicolaescu
2007-10-10  5:54                     ` Leo
2007-10-10  8:08                       ` Dan Nicolaescu
2007-10-10  9:35                         ` Leo
2007-10-10 23:53                           ` Dan Nicolaescu
2007-10-11 17:31                             ` Leo
2007-10-11 21:31                               ` Dan Nicolaescu
2007-10-10  5:59               ` Leo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87abr4a0nv.fsf@kfs-lx.testafd.dk \
    --to=storm@cua.dk \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.