unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Steven Tamm <steventamm@mac.com>
Cc: emacs-devel@gnu.org
Subject: Re: Mac OS X - Hang / C-g problem patch
Date: Mon, 9 Dec 2002 10:09:37 -0800	[thread overview]
Message-ID: <60BC2832-0BA1-11D7-B27B-00039390AB82@mac.com> (raw)
In-Reply-To: <m2adjfo5yo.fsf@chocolate-chip-cookie.dme.org>

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, dme@dme.org wrote:

> * steventamm@mac.com [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
> Emacs-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2002-12-09 18:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-04 18:06 Mac OS X - Hang / C-g problem patch Steven Tamm
2002-12-05  6:48 ` Andrew Choi
2002-12-05 16:32   ` Steven Tamm
2002-12-05 23:47     ` Andrew Choi
2002-12-06 18:15       ` Steven Tamm
2002-12-08  6:15   ` Steven Tamm
2002-12-08 20:51     ` Andrew Choi
2002-12-09 10:13     ` dme
2002-12-09 16:42       ` Andrew Choi
2002-12-09 18:09       ` Steven Tamm [this message]
2002-12-10 12:38         ` dme

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=60BC2832-0BA1-11D7-B27B-00039390AB82@mac.com \
    --to=steventamm@mac.com \
    --cc=emacs-devel@gnu.org \
    /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 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).