unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Crash of CVS emacs on MacOSX
@ 2004-03-17 11:04 Piet van Oostrum
  2004-04-01  5:56 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 3+ messages in thread
From: Piet van Oostrum @ 2004-03-17 11:04 UTC (permalink / raw)


I built emacs from cvs on March 15 (the last entry in src/Changelog is:
2004-03-14  Steven Tamm <steventamm@mac.com>

	* Makefile.in (XMENU_OBJ): Do not include xmenu.o if
	HAVE_CARBON is defined.
), and I get crashes with gnus.

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.

gdb -cd ~/Projects/cvs/emacs/src /Applications/Emacs.app/Contents/MacOS/Emacs 
GNU gdb 5.3-20030128 (Apple version gdb-309) (Thu Dec  4 15:41:30 GMT 2003)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin".
Reading symbols for shared libraries ..... done
DISPLAY = localhost
TERM = xterm-color
Breakpoint 1 at 0x9009ec18
(gdb) run
Starting program: /Applications/Emacs.app/Contents/MacOS/Emacs -geometry 80x40+0+0
Reading symbols for shared libraries +.................................................. done
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free
*** malloc[12804]: Deallocation of a pointer not malloced: 0x3578b30; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
*** malloc[12804]: error for object 0x3546dc0: Double free

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
Cannot access memory at address 0x0
Cannot access memory at address 0x0
#1  0x92896f64 in _CallMenuDef(MenuData*, short, Rect*, Point, short*) ()
#2  0x928460ac in SendMenuInit(MenuData*) ()
#3  0x92802320 in MenuData::Initialize(OpaqueEventRef*) ()
#4  0x927f484c in HIObject::HandleClassHIObjectEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) ()
#5  0x927f32a8 in HIObject::EventHook(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) ()
#6  0x927d2384 in DispatchEventToHandlers ()
#7  0x927d25f8 in SendEventToEventTargetInternal ()
#8  0x927d6a60 in SendEventToEventTargetWithOptions ()
#9  0x927eec1c in HIObject::Create(__CFString const*, OpaqueEventRef*, HIObject**) ()
#10 0x927f352c in HIObjectCreate ()
#11 0x92818ea0 in CreateMenuData(MenuDefSpec const*, short, unsigned char const*, unsigned long, unsigned char, MenuData**) ()
#12 0x928c2408 in _NewMenu(short, unsigned char const*) ()
#13 0x928c823c in NewMenu ()
#14 0x001401ec in fill_menubar (wv=0x26a8c90) at macmenu.c:2319
#15 0x0013f58c in set_frame_menubar (f=0xa4a4b0, first_time=55678720, deep_p=-1073752272) at macmenu.c:1523
#16 0x00025cc0 in update_menu_bar (f=0xa4a4b0, save_match_data=3506104) at xdisp.c:8184
#17 0x0002599c in prepare_menu_bars () at xdisp.c:8063
#18 0x000282bc in redisplay_internal (preserve_echo_area=8) at xdisp.c:9729
#19 0x0007d1c4 in read_char (commandflag=1, nmaps=5, maps=0xbfffed30, prev_event=595592192, used_mouse_menu=0xbfffee44) at keyboard.c:2472
#20 0x000857d8 in read_key_sequence (keybuf=0x0, bufsize=3495968, prompt=0, dont_downcase_last=67468, can_return_switch_frame=493055853, fix_current_buffer=778137712) at keyboard.c:8770
#21 0x0007afa0 in command_loop_1 () at keyboard.c:1476
#22 0x000df8e8 in internal_condition_case (bfun=0x7aae4 <command_loop_1>, handlers=595637240, hfun=0x7a4e4 <cmd_error>) at eval.c:1333
#23 0x0007a90c in command_loop_2 () at keyboard.c:1264
#24 0x000df350 in internal_catch (tag=8, func=0x7a8cc <command_loop_2>, arg=595592192) at eval.c:1094
#25 0x0007a864 in command_loop () at keyboard.c:1243
#26 0x0007a280 in recursive_edit_1 () at keyboard.c:959
#27 0x0007a408 in Frecursive_edit () at keyboard.c:1015
#28 0x00078f30 in main (argc=3506104, argv=0x355598) at emacs.c:1683
(gdb) 


-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum@hccnet.nl

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

* Re: Crash of CVS emacs on MacOSX
  2004-03-17 11:04 Crash of CVS emacs on MacOSX Piet van Oostrum
@ 2004-04-01  5:56 ` YAMAMOTO Mitsuharu
  2004-04-20  9:12   ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 3+ messages in thread
From: YAMAMOTO Mitsuharu @ 2004-04-01  5:56 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On 17 Mar 2004 12:04:46 +0100, Piet van Oostrum <piet@cs.uu.nl> 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.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

Index: src/lisp.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/lisp.h,v
retrieving revision 1.483
diff -c -r1.483 lisp.h
*** src/lisp.h	11 Mar 2004 00:27:33 -0000	1.483
--- src/lisp.h	1 Apr 2004 05:46:03 -0000
***************
*** 2850,2855 ****
--- 2850,2857 ----
  extern void syms_of_indent P_ ((void));
  
  /* defined in frame.c */
+ extern Lisp_Object Vx_resource_name;
+ extern Lisp_Object Vx_resource_class;
  extern Lisp_Object Qvisible;
  extern void store_frame_param P_ ((struct frame *, Lisp_Object, Lisp_Object));
  extern void store_in_alist P_ ((Lisp_Object *, Lisp_Object, Lisp_Object));
***************
*** 3070,3080 ****
  #ifdef HAVE_X_WINDOWS
  /* Defined in xfns.c */
  extern void syms_of_xfns P_ ((void));
! extern Lisp_Object Vx_resource_name;
! extern Lisp_Object Vx_resource_class;
  EXFUN (Fxw_display_color_p, 1);
  EXFUN (Fx_file_dialog, 4);
! #endif /* HAVE_X_WINDOWS */
  
  /* Defined in xsmfns.c */
  extern void syms_of_xsmfns P_ ((void));
--- 3072,3083 ----
  #ifdef HAVE_X_WINDOWS
  /* Defined in xfns.c */
  extern void syms_of_xfns P_ ((void));
! #endif /* HAVE_X_WINDOWS */
! #ifdef HAVE_WINDOW_SYSTEM
! /* Defined in xfns.c, w32fns.c, or macfns.c */
  EXFUN (Fxw_display_color_p, 1);
  EXFUN (Fx_file_dialog, 4);
! #endif /* HAVE_WINDOW_SYSTEM */
  
  /* Defined in xsmfns.c */
  extern void syms_of_xsmfns P_ ((void));
Index: src/macfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macfns.c,v
retrieving revision 1.31
diff -c -r1.31 macfns.c
*** src/macfns.c	11 Mar 2004 22:43:18 -0000	1.31
--- src/macfns.c	1 Apr 2004 05:46:03 -0000
***************
*** 2598,2604 ****
  
    if (!NILP (parent))
      {
!       f->output_data.mac->parent_desc = (Window) parent;
        f->output_data.mac->explicit_parent = 1;
      }
    else
--- 2598,2604 ----
  
    if (!NILP (parent))
      {
!       f->output_data.mac->parent_desc = (Window) XFASTINT (parent);
        f->output_data.mac->explicit_parent = 1;
      }
    else
Index: src/macmenu.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macmenu.c,v
retrieving revision 1.13
diff -c -r1.13 macmenu.c
*** src/macmenu.c	26 Feb 2004 17:46:47 -0000	1.13
--- src/macmenu.c	1 Apr 2004 05:46:03 -0000
***************
*** 1424,1430 ****
  
        for (i = 0; i < previous_menu_items_used; i++)
  	if (menu_items_used == i
! 	    || (!Fequal (previous_items[i], XVECTOR (menu_items)->contents[i])))
  	  break;
        if (i == menu_items_used && i == previous_menu_items_used && i != 0)
  	{
--- 1424,1430 ----
  
        for (i = 0; i < previous_menu_items_used; i++)
  	if (menu_items_used == i
! 	    || (NILP (Fequal (previous_items[i], XVECTOR (menu_items)->contents[i]))))
  	  break;
        if (i == menu_items_used && i == previous_menu_items_used && i != 0)
  	{
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	1 Apr 2004 05:46:03 -0000
***************
*** 6982,6989 ****
  mac_get_emulated_btn ( UInt32 modifiers )
  {
    int result = 0;
!   if (Vmac_emulate_three_button_mouse != Qnil) {
!     int cmdIs3 = (Vmac_emulate_three_button_mouse != Qreverse);
      if (modifiers & controlKey)
        result = cmdIs3 ? 2 : 1;
      else if (modifiers & optionKey)
--- 6982,6989 ----
  mac_get_emulated_btn ( UInt32 modifiers )
  {
    int result = 0;
!   if (!NILP (Vmac_emulate_three_button_mouse)) {
!     int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
      if (modifiers & controlKey)
        result = cmdIs3 ? 2 : 1;
      else if (modifiers & optionKey)
***************
*** 7001,7007 ****
    UInt32 mods = 0;
    GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
  		    sizeof (UInt32), NULL, &mods);
!   if (Vmac_emulate_three_button_mouse != Qnil &&
        GetEventClass(eventRef) == kEventClassMouse)
      {
        mods &= ~(optionKey & cmdKey);
--- 7001,7007 ----
    UInt32 mods = 0;
    GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
  		    sizeof (UInt32), NULL, &mods);
!   if (!NILP (Vmac_emulate_three_button_mouse) &&
        GetEventClass(eventRef) == kEventClassMouse)
      {
        mods &= ~(optionKey & cmdKey);
***************
*** 7020,7026 ****
    switch (result)
      {
      case kEventMouseButtonPrimary:
!       if (Vmac_emulate_three_button_mouse == Qnil) 
  	return 0;
        else {
  	UInt32 mods = 0;
--- 7020,7026 ----
    switch (result)
      {
      case kEventMouseButtonPrimary:
!       if (NILP (Vmac_emulate_three_button_mouse))
  	return 0;
        else {
  	UInt32 mods = 0;
***************
*** 8176,8182 ****
  	      inev.timestamp = er.when * (1000 / 60);
  	        /* ticks to milliseconds */
  
!               XSETINT (inev.x, tracked_scroll_bar->left + 2);
                XSETINT (inev.y, mouse_loc.v - 24);
                tracked_scroll_bar->dragging = Qnil;
                mouse_tracking_in_progress = mouse_tracking_none;
--- 8176,8182 ----
  	      inev.timestamp = er.when * (1000 / 60);
  	        /* ticks to milliseconds */
  
!               XSETINT (inev.x, XFASTINT (tracked_scroll_bar->left) + 2);
                XSETINT (inev.y, mouse_loc.v - 24);
                tracked_scroll_bar->dragging = Qnil;
                mouse_tracking_in_progress = mouse_tracking_none;
***************
*** 8268,8281 ****
  			  = mouse_tracking_mouse_movement;
  		      else
  			mouse_tracking_in_progress = mouse_tracking_none;
! 		      window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1);
  		      
  		      if (EQ (window, mwp->mFP->tool_bar_window))
  			{
  			  if (er.what == mouseDown)
! 			    handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 1, 0);
  			  else
! 			    handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 0,
  #if USE_CARBON_EVENTS
  						   mac_event_to_emacs_modifiers (eventRef)
  #else
--- 8268,8286 ----
  			  = mouse_tracking_mouse_movement;
  		      else
  			mouse_tracking_in_progress = mouse_tracking_none;
! 		      window = window_from_coordinates (mwp->mFP,
! 							mouse_loc.h,
! 							mouse_loc.v,
! 							0, 0, 0, 1);
  		      
  		      if (EQ (window, mwp->mFP->tool_bar_window))
  			{
  			  if (er.what == mouseDown)
! 			    handle_tool_bar_click (mwp->mFP, mouse_loc.h,
! 						   mouse_loc.v, 1, 0);
  			  else
! 			    handle_tool_bar_click (mwp->mFP, mouse_loc.h,
! 						   mouse_loc.v, 0,
  #if USE_CARBON_EVENTS
  						   mac_event_to_emacs_modifiers (eventRef)
  #else
***************
*** 8971,8977 ****
        EVENT_INIT (e);
        e.kind = ASCII_KEYSTROKE_EVENT;
        e.code = quit_char;
!       e.arg = NULL;
        e.modifiers = NULL;
        e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60);
        XSETFRAME (e.frame_or_window, mwp->mFP);
--- 8976,8982 ----
        EVENT_INIT (e);
        e.kind = ASCII_KEYSTROKE_EVENT;
        e.code = quit_char;
!       e.arg = Qnil;
        e.modifiers = NULL;
        e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60);
        XSETFRAME (e.frame_or_window, mwp->mFP);
Index: src/macterm.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.h,v
retrieving revision 1.13
diff -c -r1.13 macterm.h
*** src/macterm.h	11 Mar 2004 22:43:49 -0000	1.13
--- src/macterm.h	1 Apr 2004 05:46:03 -0000
***************
*** 566,572 ****
  #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
  
  
! struct frame * check_x_frame (Lisp_Object);
  
  void activate_scroll_bars (FRAME_PTR);
  void deactivate_scroll_bars (FRAME_PTR);
--- 566,583 ----
  #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
  
  
! struct frame;
! struct face;
! struct image;
! 
! Lisp_Object display_x_get_resource P_ ((struct x_display_info *,
! 					Lisp_Object, Lisp_Object,
! 					Lisp_Object, Lisp_Object));
! struct frame *check_x_frame P_ ((Lisp_Object));
! EXFUN (Fx_display_color_p, 1);
! EXFUN (Fx_display_grayscale_p, 1);
! int image_ascent P_ ((struct image *, struct face *));
! extern void x_free_gcs P_ ((struct frame *));
  
  void activate_scroll_bars (FRAME_PTR);
  void deactivate_scroll_bars (FRAME_PTR);

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

* Re: Crash of CVS emacs on MacOSX
  2004-04-01  5:56 ` YAMAMOTO Mitsuharu
@ 2004-04-20  9:12   ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 3+ messages in thread
From: YAMAMOTO Mitsuharu @ 2004-04-20  9:12 UTC (permalink / raw)


>>>>> On Thu, 01 Apr 2004 14:56:12 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:

>>>>> On 17 Mar 2004 12:04:46 +0100, Piet van Oostrum <piet@cs.uu.nl> 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
				mituharu@math.s.chiba-u.ac.jp

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;
  }
  \f
--- 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 ----

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

end of thread, other threads:[~2004-04-20  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-17 11:04 Crash of CVS emacs on MacOSX Piet van Oostrum
2004-04-01  5:56 ` YAMAMOTO Mitsuharu
2004-04-20  9:12   ` YAMAMOTO Mitsuharu

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