emacs-devel
[Top][All Lists]
Advanced

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

Re: Mac OS X - Hang / C-g problem patch


From: Steven Tamm
Subject: Re: Mac OS X - Hang / C-g problem patch
Date: Mon, 9 Dec 2002 10:09:37 -0800

Just remembered something from my async-read patch; read shouldn't call select if the fd is non-blocking (which may or may not be the issue here)
Could you try this patch?


Index: src/mac.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/mac.c,v
retrieving revision 1.11
diff -u -d -b -w -r1.11 mac.c
--- src/mac.c   8 Dec 2002 05:58:34 -0000       1.11
+++ src/mac.c   9 Dec 2002 17:50:45 -0000
@@ -32,6 +32,7 @@
 #include <pwd.h>
 #include <sys/param.h>
 #include <stdlib.h>
+#include <fcntl.h>
 #if __MWERKS__
 #include <unistd.h>
 #endif
@@ -2811,7 +2812,8 @@
   int r;

   /* Use select to block on IO while still checking for quit_char */
-  if (!inhibit_window_system && !noninteractive)
+  if (!inhibit_window_system && !noninteractive &&
+      ! (fcntl(fds, F_GETFL, 0) & O_NONBLOCK))
     {
       FD_ZERO (&rfds);
       FD_SET (fds, &rfds);

==
One other thing: does pressing C-g cause it to quit, or does it just hang?

-Steven

On Monday, December 9, 2002, at 02:13  AM, address@hidden wrote:

* address@hidden [2002-12-08 06:15:21]
[...]

I updated and re-configured, rebuilt, etc.

When attempting to use ERC, emacs reliably hangs in sys_select(), due
to there being no bits set in rfds.  Faking some bits using gdb lets
emacs carry on a little, but it hangs again quite quickly.  The trace
is:

(gdb) where
#0  0x90025cc8 in select ()
#1 0x00117cb0 in sys_select (n=10, rfds=0xbfffdf60, wfds=0x0, efds=0x0, timeout=0x0) at mac.c:2789 #2 0x00117dd8 in sys_read (fds=-1073750176, buf=0x1 <Address 0x1 out of bounds>, nbyte=3221217008) at mac.c:2818 #3 0x0007b520 in emacs_read (fildes=9, buf=0xbfffe0b0 "", nbyte=1024) at sysdep.c:3279 #4 0x00102b80 in read_process_output (proc=1108160672, channel=9) at process.c:4390 #5 0x00102694 in wait_reading_process_input (time_limit=30, microsecs=0, read_kbd=2571592, do_display=1) at process.c:4134 #6 0x0000c454 in sit_for (sec=30, usec=0, reading=1, display=1, initial_display=0) at dispnew.c:6247 #7 0x0006674c in read_char (commandflag=1, nmaps=4, maps=0xbfffefa0, prev_event=274970324, used_mouse_menu=0xbffff0a4) at keyboard.c:2630 #8 0x0006e754 in read_key_sequence (keybuf=0xbffff170, bufsize=33599088, prompt=274970324, dont_downcase_last=2362820, can_return_switch_frame=1, fix_current_buffer=2350356) at keyboard.c:8505
#9  0x0006415c in command_loop_1 () at keyboard.c:1473
#10 0x000c943c in internal_condition_case (bfun=0x63d34 <command_loop_1>, handlers=275016892, hfun=0x636e4 <cmd_error>) at eval.c:1352
#11 0x00063b14 in command_loop_2 () at keyboard.c:1274
#12 0x000c8edc in internal_catch (tag=4, func=0x63ad4 <command_loop_2>, arg=274970324) at eval.c:1112
#13 0x00063a6c in command_loop () at keyboard.c:1253
#14 0x00063480 in recursive_edit_1 () at keyboard.c:969
#15 0x00063608 in Frecursive_edit () at keyboard.c:1025
#16 0x000620dc in main (argc=0, argv=0xbffffdf8) at emacs.c:1647
#17 0x00003c48 in _start (argc=50, argv=0x0, envp=0x23b2b4) at /SourceCache/Csu/Csu-45/crt.c:267
#18 0x00003ac8 in start ()
(gdb) up
#1 0x00117cb0 in sys_select (n=10, rfds=0xbfffdf60, wfds=0x0, efds=0x0, timeout=0x0) at mac.c:2789 2789 if ((r = select (n, rfds, wfds, efds, &one_second)) > 0)
(gdb) print *rfds
$27 = {
  fds_bits = {0 <repeats 32 times>}
}
(gdb)

Has anyone else seen this ?  I'll carry on looking...




_______________________________________________
Emacs-devel mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/emacs-devel




reply via email to

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