unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* OS X: C-g does not break out of infinite loop
@ 2004-07-14 16:54 John Owens
  2004-07-15 13:17 ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: John Owens @ 2004-07-14 16:54 UTC (permalink / raw)


When sending a large email via FLIM, I could not break
out of the send using C-g. I thought this was a FLIM
problem, but Yoichi Nakayama ably identified it as a
emacs problem (on OS X specifically). The problem is
described in more detail here:

http://article.gmane.org/gmane.mail.wanderlust.general/632

with Yoichi's response (together with a test case that
I can reproduce: C-g on OS X cannot recover from
evaling any of the following three:

1. (condition-case nil (while 1) (error (error "catch
error")) (quit (error "catch quit")))
2. (condition-case nil (while 1) (error (error "catch
error")))
3. (while 1)

) at:

http://article.gmane.org/gmane.mail.wanderlust.general/635

(He verified this with GNU Emacs 21.3.50.1
(powerpc-apple-darwin7.3.0) of 2004-05-08; I also
verified it with GNU Emacs 21.3.50.1
(powerpc-apple-darwin7.4.0) of 2004-07-07.)

He also points out that C-g has had historical
problems in OS X:

http://article.gmane.org/gmane.emacs.macintosh.devel/46

Given that the above message indicates that the 10.2
OS X release allowed support for handling C-g
properly, maybe now's a good time to do so?

JDO


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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

* Re: OS X: C-g does not break out of infinite loop
  2004-07-14 16:54 OS X: C-g does not break out of infinite loop John Owens
@ 2004-07-15 13:17 ` Richard Stallman
  2004-07-15 13:57   ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2004-07-15 13:17 UTC (permalink / raw)
  Cc: emacs-devel

    with Yoichi's response (together with a test case that
    I can reproduce: C-g on OS X cannot recover from
    evaling any of the following three:

    1. (condition-case nil (while 1) (error (error "catch
    error")) (quit (error "catch quit")))
    2. (condition-case nil (while 1) (error (error "catch
    error")))
    3. (while 1)

It sounds like the mechanism for detecting C-g may need a redesign.
Is there any Lisp program you can successfully interrupt with C-g?

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

* Re: OS X: C-g does not break out of infinite loop
  2004-07-15 13:17 ` Richard Stallman
@ 2004-07-15 13:57   ` YAMAMOTO Mitsuharu
  2004-07-15 20:25     ` John Owens
       [not found]     ` <202E9468-D93E-11D8-A9B1-00039390AB82@mac.com>
  0 siblings, 2 replies; 6+ messages in thread
From: YAMAMOTO Mitsuharu @ 2004-07-15 13:57 UTC (permalink / raw)
  Cc: John Owens

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

>>>>> On Thu, 15 Jul 2004 09:17:36 -0400, Richard Stallman <rms@gnu.org> said:

>> with Yoichi's response (together with a test case that I can
>> reproduce: C-g on OS X cannot recover from evaling any of the
>> following three:

>> 1. (condition-case nil (while 1) (error (error "catch error"))
>> (quit (error "catch quit")))
>> 2. (condition-case nil (while 1) (error (error "catch error")))
>> 3. (while 1)

> It sounds like the mechanism for detecting C-g may need a redesign.
> Is there any Lisp program you can successfully interrupt with C-g?

That problem was mentioned three months ago, but maybe obscured by
other urgent problems.

http://lists.gnu.org/archive/html/emacs-devel/2004-04/msg00783.html
http://lists.gnu.org/archive/html/emacs-devel/2004-04/msg01072.html

The attached is a patch for the latest CVS.  With this patch, all the
above examples can be quit by C-g on OS X (Carbon).

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

[-- Attachment #2: diff-event.gz --]
[-- Type: application/octet-stream, Size: 2888 bytes --]

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

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

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

* Re: OS X: C-g does not break out of infinite loop
  2004-07-15 13:57   ` YAMAMOTO Mitsuharu
@ 2004-07-15 20:25     ` John Owens
       [not found]     ` <202E9468-D93E-11D8-A9B1-00039390AB82@mac.com>
  1 sibling, 0 replies; 6+ messages in thread
From: John Owens @ 2004-07-15 20:25 UTC (permalink / raw)
  Cc: John Owens

--- YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
wrote:
> The attached is a patch for the latest CVS.  With
> this patch, all the
> above examples can be quit by C-g on OS X (Carbon).

I confirm that with the latest CVS, Mitsuharu's patch
both fixes all three test cases from Yoichi and also
allows me to C-g out of a send. Fantastic! Thanks for
the quick patch.

JDO



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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

* Re: OS X: C-g does not break out of infinite loop
       [not found]       ` <wlk6x0h6y5.wl@church.math.s.chiba-u.ac.jp>
@ 2004-07-19  6:38         ` Steven Tamm
  2004-07-19  7:13           ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Tamm @ 2004-07-19  6:38 UTC (permalink / raw)
  Cc: emacs-devel

On Jul 18, 2004, at 11:00 PM, YAMAMOTO Mitsuharu wrote:

> Hi,
> I thought I've explained that in the following message:
>
> http://lists.gnu.org/archive/html/emacs-devel/2004-04/msg01015.html
>
> Maybe your concern is another issue?  Anyway, I can test with Mac OS X
> 10.1.5 if you give me an example that may cause some problems.

I missed that explanation during my prolonged illness.  It makes sense, 
given the rewrite of sys_select (Due to the "why didn't i think of 
that" part of using ReceiveNextEvent with the timeout instead of 
unnecessary selects).

So I guess the only thing I need to keep reverifying after each OS 
release is the vfork problem.

>> However, I will check it in and let the 10.1 people complain because
>> the polling appears to work .
> Seems like the old patch is applied.  It may cause a hang because of
> lack of BLOCK_INPUT/UNBLOCK_INPUT for ReceiveNextEvent, which I
> mentioned in
> http://lists.gnu.org/archive/html/emacs-devel/2004-05/msg00016.html
> Could you apply the attached patch over the current CVS?

Done.  I have noticed that responding to blocked subcommands still 
takes a second to respond, which seems odd since it should be 200ms.  
Have you noticed this as well?

-Steven

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

* Re: OS X: C-g does not break out of infinite loop
  2004-07-19  6:38         ` Steven Tamm
@ 2004-07-19  7:13           ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 6+ messages in thread
From: YAMAMOTO Mitsuharu @ 2004-07-19  7:13 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Sun, 18 Jul 2004 23:38:19 -0700, Steven Tamm <steventamm@mac.com> said:

> I have noticed that responding to blocked subcommands still takes a
> second to respond, which seems odd since it should be 200ms.  Have
> you noticed this as well?

That is what I intended, and normal for the systems where SIGIO can't
be used for notification of input events.  The documentation of
`polling-period' says:

  *Interval between polling for input during Lisp execution.
  The reason for polling is to make C-g work to stop a running program.
  Polling is needed only when using X windows and SIGIO does not work.
  Polling is automatically disabled in all other cases.

During Lisp or synchronous subprocess execution, window events
(including keyboard ones) are inspected every `polling-period' (2 by
default) seconds.  The timeout `200ms' (I think you meant 20ms =
20000ns in mac.c) is just for multiplexing the inspection of window
events by ReceiveNextEvent and that of process I/O by select.

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

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

end of thread, other threads:[~2004-07-19  7:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-14 16:54 OS X: C-g does not break out of infinite loop John Owens
2004-07-15 13:17 ` Richard Stallman
2004-07-15 13:57   ` YAMAMOTO Mitsuharu
2004-07-15 20:25     ` John Owens
     [not found]     ` <202E9468-D93E-11D8-A9B1-00039390AB82@mac.com>
     [not found]       ` <wlk6x0h6y5.wl@church.math.s.chiba-u.ac.jp>
2004-07-19  6:38         ` Steven Tamm
2004-07-19  7:13           ` 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).