all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Alan Third <alan@idiocy.org>
Cc: 69561@debbugs.gnu.org
Subject: bug#69561: 30.0.50; Freeze from M-x gnus on macOS
Date: Thu, 07 Mar 2024 20:29:44 +0100	[thread overview]
Message-ID: <m2v85xkfh3.fsf@Pro.fritz.box> (raw)
In-Reply-To: <ZeoLvDRrlHEvJzfb@idiocy.org> (Alan Third's message of "Thu, 7 Mar 2024 18:47:24 +0000")

Alan Third <alan@idiocy.org> writes:

> On Thu, Mar 07, 2024 at 06:01:02PM +0100, Gerd Möllmann wrote:
>> Alan Third <alan@idiocy.org> writes:
>> 
>> > On Thu, Mar 07, 2024 at 05:30:28PM +0100, Gerd Möllmann wrote:
>> >> Alan Third <alan@idiocy.org> writes:
>> >> 
>> >> > But keyboard input (ns_read_socket) is handled immediately after that
>> >> > "if (nfds < 0)" block and well before the "if (no_avail...".
>> >> 
>> >> Could you please tell the line number?
>> >
>> > detect_input_pending_run_timers at process.c:5839 calls
>> > get_input_pending which calls gobble_input which calls
>> > t->read_socket_hook.
>> >
>> > There seem to be a lot of ways for it to bail out, though.
>> 
>> Thanks. That's in if (read_kbd), and the first backtrace I sent had
>> 
>>     frame #6: 0x00000001001d94d2
>> emacs`wait_reading_process_output(time_limit=<unavailable>,
>> nsecs=<unavailable>, read_kbd=0, do_display=false,
>> wait_for_cell=(struct Lisp_Symbol *) $123 = 0x00000001007d24b0,
>> wait_proc=0x00007fccffdcc9d8, just_wait_proc=0) at process.c:5484:9
>> [opt]
>> 
>> i.e. read_kbd should be 0.
>> 
>> Maybe that's also an explanation why it doesn't freeze most of time?
>> If it sometimes does detect_input_pending...
>
> So this
>
>    READ_KBD is:
>      0 to ignore keyboard input, or
>      1 to return when input is available, or
>     -1 meaning caller will actually read the input, so don't throw to
>        the quit handler
>
> implies that if read_kbd is zero then we should be able to quit?

I'm afraid I can't answer that. Maybe Eli can, or knows someone who can?

> If that's the case then we need some special handling in nsterm.m for
> C-g, I suppose.
>
> Having dug around in other terms I assume this means setting
> Vquit_flag? So in the keyDown method we should identify C-g and set
> Vquit_flag...?

As far as I understand the code, Vquit_flag will also be set by storing
the event in question with kbd_buffer_store_event_hold. I think that
would be the easiest way. And it's what ns_read_socket already does.

In addition, returning -1 from ns_select if events are in the hold
queue, and not doing anything else, looks super suspicious to me. If
no-one else does an [NSApp run], like in my freeze, I think it's natural
that the system says Emacs is not responding. And what dowensides would
it have to [NSApp run]?

And finally, I would at least question the raise (SIGIO). I don't
understand the reason for that if, for example, keyboard input is the
hold queue. And, of course there is no comment...

But that just my 2 cents as a newcomer :-). 





  reply	other threads:[~2024-03-07 19:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 10:59 bug#69561: 30.0.50; Freeze from M-x gnus on macOS Gerd Möllmann
2024-03-05 11:04 ` Gerd Möllmann
2024-03-05 14:29   ` Gerd Möllmann
2024-03-05 15:46     ` Eli Zaretskii
2024-03-05 16:38       ` Gerd Möllmann
2024-03-05 16:52         ` Eli Zaretskii
2024-03-05 17:54           ` Gerd Möllmann
2024-03-07 15:18     ` Gerd Möllmann
2024-03-07 15:52       ` Gerd Möllmann
2024-03-07 16:05       ` Alan Third
2024-03-07 16:30         ` Gerd Möllmann
2024-03-07 16:49           ` Alan Third
2024-03-07 17:01             ` Gerd Möllmann
2024-03-07 18:47               ` Alan Third
2024-03-07 19:29                 ` Gerd Möllmann [this message]
2024-03-07 20:23                   ` Gerd Möllmann
2024-03-08  4:31                     ` Gerd Möllmann
2024-03-09  7:33                   ` Eli Zaretskii
2024-03-09  9:47                     ` Gerd Möllmann
2024-03-09 10:07                       ` Eli Zaretskii
2024-03-09 11:00                         ` Gerd Möllmann
2024-03-09 11:11                           ` Eli Zaretskii
2024-03-09 11:33                             ` Gerd Möllmann
2024-03-09 13:08                               ` Eli Zaretskii
2024-03-09 13:21                                 ` Gerd Möllmann
2024-03-09 13:27                                   ` Eli Zaretskii
2024-03-09 13:51                                     ` Gerd Möllmann
2024-03-13  6:11                                       ` Gerd Möllmann
2024-03-13 16:53                                         ` Filipp Gunbin
2024-03-13 18:18                                           ` Gerd Möllmann
2024-03-13 18:20                                           ` Gerd Möllmann
2024-03-13 19:20                                             ` Filipp Gunbin
2024-03-13 19:37                                               ` Gerd Möllmann

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

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

  git send-email \
    --in-reply-to=m2v85xkfh3.fsf@Pro.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=69561@debbugs.gnu.org \
    --cc=alan@idiocy.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.