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: Tom Gillespie <tgbugs@gmail.com>
Cc: 56487@debbugs.gnu.org
Subject: bug#56487: xgselect race condition leading to abort when USE_GTK not defined
Date: Mon, 11 Jul 2022 11:13:04 +0800	[thread overview]
Message-ID: <87v8s4z6in.fsf@yahoo.com> (raw)
In-Reply-To: <CA+G3_PP-xUHs-XtoiV_xvnFVydY7-LQqTSL3BUGj_Vg=iWaCmg@mail.gmail.com> (Tom Gillespie's message of "Sun, 10 Jul 2022 19:50:08 -0700")

Tom Gillespie <tgbugs@gmail.com> writes:

> -#ifdef USE_GTK
>    bool already_has_events;
> -#endif
>  
>    if (xg_select_suppress_count)
>      return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask);
> @@ -126,8 +132,8 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
>    context = g_main_context_default ();
>    acquire_select_lock (context);
>  
> -#ifdef USE_GTK
>    already_has_events = g_main_context_pending (context);
> +#ifdef USE_GTK
>  #ifndef HAVE_PGTK
>    already_has_events = already_has_events && x_gtk_use_native_input;
>  #endif
> @@ -179,12 +185,6 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
>  	tmop = &tmo;
>      }
>  
> -#ifndef USE_GTK
> -  fds_lim = max_fds + 1;
> -  nfds = thread_select (pselect, fds_lim,
> -			&all_rfds, have_wfds ? &all_wfds : NULL, efds,
> -			tmop, sigmask);
> -#else
>    /* On PGTK, when you type a key, the key press event are received,
>       and one more key press event seems to be received internally.
>  
> @@ -217,7 +217,6 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
>  	FD_ZERO (efds);
>        our_fds++;
>      }
> -#endif
>  
>    if (nfds < 0)
>      retval = nfds;
> @@ -248,11 +247,7 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
>  
>    /* If Gtk+ is in use eventually gtk_main_iteration will be called,
>       unless retval is zero.  */
> -#ifdef USE_GTK
>    need_to_dispatch = retval == 0;
> -#else
> -  need_to_dispatch = true;
> -#endif
>  
>    /* xwidgets make heavy use of GLib subprocesses, which add their own
>       SIGCHLD handler at arbitrary locations.  That doesn't play well

Thanks.  Why did the code previously under !USE_GTK have to be removed?





  reply	other threads:[~2022-07-11  3:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 21:05 bug#56487: xgselect race condition leading to abort when USE_GTK not defined Tom Gillespie
2022-07-11  1:53 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-11  2:50   ` Tom Gillespie
2022-07-11  3:13     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-07-11  3:40       ` Tom Gillespie
2022-07-11 10:16         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-11 16:09           ` Tom Gillespie
2022-07-12  2:03             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-12  2:20               ` Tom Gillespie
2022-07-12 12:44                 ` Eli Zaretskii
2022-07-15  5:09                   ` Tom Gillespie
2023-09-07 18:30                   ` Stefan Kangas

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=87v8s4z6in.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=56487@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=tgbugs@gmail.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).