all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60144@debbugs.gnu.org, karl@karlotness.com
Subject: bug#60144: 30.0.50; PGTK Emacs crashes after signal
Date: Sun, 18 Dec 2022 20:12:53 +0800	[thread overview]
Message-ID: <871qowgbay.fsf@yahoo.com> (raw)
In-Reply-To: <83fsddey48.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 18 Dec 2022 13:43:03 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: karl@karlotness.com,  60144@debbugs.gnu.org
>> Date: Sun, 18 Dec 2022 17:52:42 +0800
>> 
>> > Why this fragile architecture of reading input events?  Calling
>> > functions of our Lisp machine from context where those functions
>> > cannot signal an error is very dangerous, and cannot work well in
>> > Emacs.  Why cannot we have the reads through GTK only deliver events
>> > to us, which we enqueue to our own event queue, and then we could
>> > process that queue in the safe context of the Lisp machine, as (AFAIK)
>> > we do on other platforms?
>> 
>> No, signalling there is equally unsafe on the other platforms, where
>> note_mouse_highlight is called from the same place(s): read_socket_hook,
>> event_handler_gdk, et cetera.  Just look at the callers of
>> x_note_mouse_movement in xterm.c, or [EmacsView mouseMoved:] in
>> nsterm.m.
>
> Sorry, I'm afraid I don't see the danger on other platforms.  Please
> explain.  AFAIK, read_socket_hook is called from keyboard.c code which
> reads input, and that code has no problem signaling an error.  What am
> I missing?

That code has problems signalling errors, unless it is okay for
unblock_input to signal.

On the regular X build with GTK, handle_one_xevent is called from
event_handler_gdk, which is called by GDK when it detects an event.
handle_one_xevent can also be called from x_dispatch_event inside a
popup menu, and during drag-and-drop.  On NS, [EmacsView mouseMoved:] is
called by the system from Objective-C.

Out of all of those places, the only place where it is safe to signal is
inside the drag-and-drop event loop.  Signalling out of the rest will
either lead to catastrophic blowups (if it happens inside
event_handler_gdk or [EmacsView mouseMoved:]), or to grabs never being
released and resource leaks inside a menu.





  reply	other threads:[~2022-12-18 12:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  3:39 bug#60144: 30.0.50; PGTK Emacs crashes after signal Karl Otness via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-18  2:08 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-18  5:45   ` Eli Zaretskii
2022-12-18  6:22     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-18  8:39       ` Eli Zaretskii
2022-12-18  9:52         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-18 11:43           ` Eli Zaretskii
2022-12-18 12:12             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-18 12:33               ` Eli Zaretskii
2022-12-18 13:45                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-18 17:34                   ` Eli Zaretskii
2022-12-19  1:56                     ` Po Lu
2022-12-19 14:36                       ` Eli Zaretskii
2022-12-20  1:39                         ` Po Lu
2022-12-20 15:16                           ` Eli Zaretskii
2022-12-21  1:01                             ` Po Lu
2022-12-21 13:06                               ` Eli Zaretskii
2022-12-22  1:28                                 ` Po Lu
2022-12-22  9:04                                   ` Eli Zaretskii
2022-12-22  9:57                                     ` Po Lu

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=871qowgbay.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=60144@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=karl@karlotness.com \
    --cc=luangruo@yahoo.com \
    /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.