unofficial mirror of bug-gnu-emacs@gnu.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 21:45:38 +0800	[thread overview]
Message-ID: <87wn6oesfx.fsf@yahoo.com> (raw)
In-Reply-To: <83bko0gact.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 18 Dec 2022 14:33:22 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> That code has problems signalling errors, unless it is okay for
>> unblock_input to signal.
>
> I don't understand this part.  Why and how is unblock_input part of
> the picture?

Because unblock_input can call process_pending_signals, and in doing so
handle_async_input, which calls gobble_input (and thus the
read_socket_hook.)  As a result, it is not safe for any read_socket_hook
to signal as long as it is not ok for unblock_input to signal as well.

> So in the X/GTK build we have the same problem as with PGTK?  If so,
> why not change that as well, to work as I described, i.e. enqueue
> events to our own event queue, which we will then read and process in
> safe context?
>
> AFAIU, w32 already works like that.  Does it not?

It doesn't, see how w32_note_mouse_movement is called from
w32_read_socket.

> Yes, understood.  But it just tells me that we need to change the
> architecture so that the events delivered by the window-system are not
> processed in callbacks we install to be called by the window-system,
> they should be processed in our own safe context.

The problem is note_mouse_highlight is simply not supposed to signal.
It is a function called directly while handling async input as far back
as Emacs 19, much like expose_frame.  (IIRC back then there was a
slightly different implementation in each of the *term.c files.)

Moving note_mouse_highlight out of handle_one_xevent would lead to other
bugs, since mouse movement must be processed in order wrt to other X
events.  For example, if an XI_Motion event arrives and is queued, and
then a subsequent XI_Leave event arrives before that event has a chance
to be processed ``in our own safe context'', note_mouse_highlight will
be called after the mouse has left the frame, leading to stuck mouse
highlight.





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

Thread overview: 11+ 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
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 [this message]
2022-12-18 17:34                   ` Eli Zaretskii

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=87wn6oesfx.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 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).