emacs-devel
[Top][All Lists]
Advanced

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

Re: Crash of CVS emacs on MacOSX


From: YAMAMOTO Mitsuharu
Subject: Re: Crash of CVS emacs on MacOSX
Date: Tue, 20 Apr 2004 18:12:28 +0900
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Thu, 01 Apr 2004 14:56:12 +0900, YAMAMOTO Mitsuharu <address@hidden> 
>>>>> said:

>>>>> On 17 Mar 2004 12:04:46 +0100, Piet van Oostrum <address@hidden> said:
>> The latest one was when I did 'g' in *Groups* and it just seemed to
>> hang.  So after fetching tea I hit C-g a couple of times and got
>> the following info from gdb. I hope this gives some clue. I had
>> similar crashes with slightly older versions.

> Could you try this patch?  These changes are for making compilation
> with -DUSE_LISP_UNION_TYPE successful.  Most of the modifications do
> not change the behavior in the default configuration, but the one in
> macmenu.c does.

Unfortunately, the above change seems to have nothing to do with the
crash.  So I tried to slightly change the way to handle window events
so that it imitates the behavior of the X11 version without SIGIO
(like the Solaris version does).  Steven Tamm has been considering
more sophisticated event handler, but I think this strategy would be
feasible as a temporary solution if the next release is scheduled.

The following patch is not complete, but can be used to see if the
above strategy remedies the crash.  Maybe several window events should
be processed at one interrupt time to get better response during a
synchronous process is running.

With this patch, some of the redisplaying problems I mentioned in
http://mail.gnu.org/archive/html/emacs-devel/2004-02/msg00459.html are
solved (including "fancy splash screen").  The vertical line problem
still remains.

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/atimer.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/atimer.c,v
retrieving revision 1.14
diff -c -r1.14 atimer.c
*** src/atimer.c        9 Feb 2004 15:39:49 -0000       1.14
--- src/atimer.c        20 Apr 2004 05:39:55 -0000
***************
*** 375,381 ****
  
        t = atimers;
        atimers = atimers->next;
-       t->fn (t);
  
        if (t->type == ATIMER_CONTINUOUS)
        {
--- 375,380 ----
***************
*** 387,392 ****
--- 386,393 ----
          t->next = free_atimers;
          free_atimers = t;
        }
+ 
+       t->fn (t);
  
        EMACS_GET_TIME (now);
      }
Index: src/eval.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/eval.c,v
retrieving revision 1.215
diff -c -r1.215 eval.c
*** src/eval.c  29 Mar 2004 00:51:43 -0000      1.215
--- src/eval.c  20 Apr 2004 05:39:55 -0000
***************
*** 2143,2151 ****
      val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
    backtrace_list = backtrace.next;
  
- #ifdef HAVE_CARBON
-   mac_check_for_quit_char();
- #endif
    return val;
  }
  
--- 2143,2148 ----
Index: src/keyboard.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/keyboard.c,v
retrieving revision 1.770
diff -c -r1.770 keyboard.c
*** src/keyboard.c      16 Apr 2004 21:19:16 -0000      1.770
--- src/keyboard.c      20 Apr 2004 05:39:56 -0000
***************
*** 605,611 ****
  
  /* We are unable to use interrupts if FIONREAD is not available,
     so flush SIGIO so we won't try.  */
! #ifndef FIONREAD
  #ifdef SIGIO
  #undef SIGIO
  #endif
--- 605,611 ----
  
  /* We are unable to use interrupts if FIONREAD is not available,
     so flush SIGIO so we won't try.  */
! #if !defined (FIONREAD) || defined(HAVE_CARBON)
  #ifdef SIGIO
  #undef SIGIO
  #endif
Index: src/mac.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/mac.c,v
retrieving revision 1.18
diff -c -r1.18 mac.c
*** src/mac.c   22 Nov 2003 23:00:59 -0000      1.18
--- src/mac.c   20 Apr 2004 05:39:56 -0000
***************
*** 2782,2793 ****
    SELECT_TYPE *efds;
    struct timeval *timeout;
  {
!   if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))
!     return 1;
!   else if (inhibit_window_system || noninteractive ||
!          (timeout && (EMACS_SECS(*timeout)==0) &&
!           (EMACS_USECS(*timeout)==0)))
!     return select(n, rfds, wfds, efds, timeout);
    else
      {
        EMACS_TIME end_time, now;
--- 2782,2790 ----
    SELECT_TYPE *efds;
    struct timeval *timeout;
  {
!   if (inhibit_window_system || noninteractive
!       || rfds == NULL || !FD_ISSET (0, rfds))
!     return select(n, rfds, wfds, efds, timeout);    
    else
      {
        EMACS_TIME end_time, now;
***************
*** 2796,2826 ****
        if (timeout)
        EMACS_ADD_TIME (end_time, end_time, *timeout);
  
        do
        {
          int r;
!         EMACS_TIME one_second;
!         SELECT_TYPE orfds;
  
!         FD_ZERO (&orfds);
!         if (rfds)
!           {
!             orfds = *rfds;
!           }
! 
!         EMACS_SET_SECS (one_second, 1);
!         EMACS_SET_USECS (one_second, 0);
  
!         if (timeout && EMACS_TIME_LT(*timeout, one_second))
!           one_second = *timeout;
  
!         if ((r = select (n, &orfds, wfds, efds, &one_second)) > 0)
            {
              *rfds = orfds;
              return r;
            }
! 
!         mac_check_for_quit_char();
  
          EMACS_GET_TIME (now);
          EMACS_SUB_TIME (now, end_time, now);
--- 2793,2830 ----
        if (timeout)
        EMACS_ADD_TIME (end_time, end_time, *timeout);
  
+       FD_CLR (0, rfds);
        do
        {
+         EMACS_TIME select_timeout;
+         SELECT_TYPE orfds = *rfds;
          int r;
!         OSErr err;
  
!         EMACS_SET_SECS (select_timeout, 0);
!         EMACS_SET_USECS (select_timeout, 100);
  
!         if (timeout && EMACS_TIME_LT (*timeout, select_timeout))
!           select_timeout = *timeout;
  
!         r = select (n, &orfds, wfds, efds, &select_timeout);
!         err = ReceiveNextEvent (0, NULL, kEventDurationNoWait, false, NULL);
!         if (r > 0)
            {
              *rfds = orfds;
+             if (err == noErr)
+               {
+                 FD_SET (0, rfds);
+                 r++;
+               }
              return r;
            }
!         else if (err == noErr)
!           {
!             FD_ZERO (rfds);
!             FD_SET (0, rfds);
!             return 1;
!           }
  
          EMACS_GET_TIME (now);
          EMACS_SUB_TIME (now, end_time, now);
Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.64
diff -c -r1.64 macterm.c
*** src/macterm.c       11 Mar 2004 22:43:32 -0000      1.64
--- src/macterm.c       20 Apr 2004 05:39:56 -0000
***************
*** 5297,5303 ****
  
    XFlush (FRAME_MAC_DISPLAY (f));
  
- #if 0 /* MAC_TODO */
    /* Synchronize to ensure Emacs knows the frame is visible
       before we do anything else.  We do this loop with input not blocked
       so that incoming events are handled.  */
--- 5297,5302 ----
***************
*** 5341,5349 ****
        FRAME_SAMPLE_VISIBILITY (f);
        }
    }
- #else
-   UNBLOCK_INPUT;
- #endif /* MAC_TODO */
  }
  
  /* Change from mapped state to withdrawn state.  */
--- 5340,5345 ----
Index: src/process.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/process.c,v
retrieving revision 1.424
diff -c -r1.424 process.c
*** src/process.c       6 Feb 2004 23:52:09 -0000       1.424
--- src/process.c       20 Apr 2004 05:39:57 -0000
***************
*** 4183,4196 ****
          SELECT_TYPE Atemp, Ctemp;
  
          Atemp = input_wait_mask;
- #ifdef MAC_OSX
-           /* On Mac OS X, the SELECT system call always says input is
-              present (for reading) at stdin, even when none is.  This
-              causes the call to SELECT below to return 1 and
-              status_notify not to be called.  As a result output of
-              subprocesses are incorrectly discarded.  */
-           FD_CLR (0, &Atemp);
- #endif
          Ctemp = connect_wait_mask;
          EMACS_SET_SECS_USECS (timeout, 0, 0);
          if ((select (max (max_process_desc, max_keyboard_desc) + 1,
--- 4183,4188 ----




reply via email to

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