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: More info on sporadic OS/X crash
Date: Mon, 26 Apr 2004 09:27:52 -0700	[thread overview]
Message-ID: <AA4871C5-979E-11D8-BE11-00039390AB82@mac.com> (raw)
In-Reply-To: <20040426.221527.198676483.mituharu@math.s.chiba-u.ac.jp>

The reason for all of the polling nonsense in the first place is to 
deal with runaway processes.
For example, compile this program and run it using (shell-command) or 
M-!
#include <stdio.h>
int main(int argc, char** argv) {
   while (1)
     ;
}
If C-g interrupts it, then it still works.  With carbon emacs as it is 
now, this works.

The other example would be to setup an infinite loop *inside* emacs; 
i.e. not as a subprocesses.  The simplest being:
(while t t)
Right now, with Carbon Emacs, this causes the beachball of death and 
C-g does nothing.  This is why the "mac_check_for_quit_char" is 
peppered throughout the code; but in this instance it doesn't work.  Of 
course if you send a SIGINT to the process it works...  And (while t 
(eval t)), a more realistic example, C-g does work.

I filed a bug with Apple a year and a half ago asking if an application 
could setup a key that causes a signal, but I can't seem to find the 
resolution for it.

-Steven

On Apr 26, 2004, at 6:15 AM, YAMAMOTO Mitsuharu wrote:

>>>>>> On Sun, 25 Apr 2004 10:49:07 -0700, Steven Tamm 
>>>>>> <steventamm@mac.com> said:
>
>> The patch seemed to make sense to be, except for the FD_CLR
>> (i.e. the bug in select from 10.1) I forgot to ask, have you tried
>> that patch on 10.2 or just 10.3?
>
> I just tried the patch on both 10.1.5 and 10.2.8, but I could not find
> any problems by a few tests on subprocesses.  If you have a specific
> example, maybe I can test it.
>
>> And with the non-carbon build?
>
> For the X11 build, fd 0 is excluded from input_wait_mask with
> add_keyboard_wait_descriptor in x_term_init.  For the Carbon build, fd
> 0 is never consulted in sys_select (in mac.c with the patch), but the
> window event queue is consulted instead.
>
> A comment in mac.c says:
>
>    When Emacs is started from the Finder, SELECT always immediately
>    returns as if input is present when file descriptor 0 is polled for
>    input.  Strangely, when Emacs is run as a GUI application from the
>    command line, it blocks in the same situation.  This `wrapper' of
>    the system call SELECT corrects this discrepancy.
>
> According to the output of lsof, fd 0 is bound to /dev/null for the
> former case, whereas it is bound to the tty from which Emacs is
> invoked for the latter case.  That would explain the above phenomena.
>
> 				     YAMAMOTO Mitsuharu
> 				mituharu@math.s.chiba-u.ac.jp

  reply	other threads:[~2004-04-26 16:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-15 23:15 More info on sporadic OS/X crash John Wiegley
2004-04-23 11:41 ` John Wiegley
2004-04-24  1:15   ` YAMAMOTO Mitsuharu
2004-04-25 17:49     ` Steven Tamm
2004-04-26 13:15       ` YAMAMOTO Mitsuharu
2004-04-26 16:27         ` Steven Tamm [this message]
2004-04-27  9:52           ` YAMAMOTO Mitsuharu
2004-04-27 15:24       ` Piet van Oostrum
2004-04-28  6:37         ` Eli Zaretskii
2004-04-28 11:14           ` Piet van Oostrum
2004-04-28 18:53             ` Eli Zaretskii
2004-04-29 12:10               ` Piet van Oostrum
2004-04-29 16:32                 ` Kim F. Storm
2004-04-29 22:24                   ` Steven Tamm
2004-04-29 22:25                   ` Piet van Oostrum
2004-05-01 11:32         ` YAMAMOTO Mitsuharu
2004-04-26 18:08     ` John Wiegley
2004-04-27  9:59       ` YAMAMOTO Mitsuharu
2004-04-29 22:08         ` John Wiegley
2004-05-01 11:09           ` YAMAMOTO Mitsuharu
2004-05-07  1:24             ` John Wiegley
2004-05-10  6:02             ` John Wiegley

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=AA4871C5-979E-11D8-BE11-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).