emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23.0.50; Emacs seg fault


From: Kim F. Storm
Subject: Re: 23.0.50; Emacs seg fault
Date: Sun, 30 Sep 2007 12:49:08 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Leo <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]