GNU bug report logs - #43834
27.1; [PATCH] Sentinels under X and command line

Previous Next

Package: emacs;

Reported by: dick <dick.r.chiang <at> gmail.com>

Date: Tue, 6 Oct 2020 18:27:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 27.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43834 in the body.
You can then email your comments to 43834 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Tue, 06 Oct 2020 18:27:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to dick <dick.r.chiang <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 06 Oct 2020 18:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: dick <dick.r.chiang <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; [PATCH] Sentinels under X and command line
Date: Tue, 06 Oct 2020 14:25:50 -0400
[Message part 1 (text/plain, inline)]
emacs -Q -l cl-lib \
  --eval "(let* (flag \
                 (proc (apply (function start-process) \"test\" nil \"sleep\" (list \"3\")))) \
            (set-process-sentinel proc (lambda (&rest _args) (setq flag t))) \
            (cl-assert (cl-loop repeat 10 \
                        until flag \
                        do (accept-process-output nil 0.5) \
                        finally return flag)) \
            (message \"good!\"))"

[0001-Process-sentinels-need-to-work-under-X-and-commandli.patch (text/x-diff, inline)]
From cd25ae2e9f8cf1d155084c125dae4058fccb6544 Mon Sep 17 00:00:00 2001
From: dickmao <none>
Date: Tue, 6 Oct 2020 14:21:03 -0400
Subject: [PATCH] Process sentinels need to work under X and commandline

This is also noted in
https://emacs.stackexchange.com/questions/60408/\
process-sentinels-dont-run-during-init-in-gui-emacs

* src/process.c (add_non_keyboard_read_fd): Make this a public function.
(add_process_read_fd): Fold old, static add_non_keyboard_read_fd guts
into here.
* src/xsmfns.c (ice_conn_watch_CB): Call add_non_keyboard_read_fd.
---
 src/process.c | 15 ++++++++-------
 src/process.h |  1 +
 src/xsmfns.c  |  2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/process.c b/src/process.c
index 50c425077a..c7056e49da 100644
--- a/src/process.c
+++ b/src/process.c
@@ -469,8 +469,15 @@ add_read_fd (int fd, fd_callback func, void *data)
   fd_callback_info[fd].data = data;
 }
 
+void
+add_non_keyboard_read_fd (int fd, fd_callback func, void *data)
+{
+  add_read_fd(fd, func, data);
+  fd_callback_info[fd].flags &= ~KEYBOARD_FD;
+}
+
 static void
-add_non_keyboard_read_fd (int fd)
+add_process_read_fd (int fd)
 {
   eassert (fd >= 0 && fd < FD_SETSIZE);
   eassert (fd_callback_info[fd].func == NULL);
@@ -479,12 +486,6 @@ add_non_keyboard_read_fd (int fd)
   fd_callback_info[fd].flags |= FOR_READ;
   if (fd > max_desc)
     max_desc = fd;
-}
-
-static void
-add_process_read_fd (int fd)
-{
-  add_non_keyboard_read_fd (fd);
   fd_callback_info[fd].flags |= PROCESS_FD;
 }
 
diff --git a/src/process.h b/src/process.h
index a783a31cb8..5660270e8f 100644
--- a/src/process.h
+++ b/src/process.h
@@ -284,6 +284,7 @@ pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val)
 typedef void (*fd_callback) (int fd, void *data);
 
 extern void add_read_fd (int fd, fd_callback func, void *data);
+extern void add_non_keyboard_read_fd (int fd, fd_callback func, void *data);
 extern void delete_read_fd (int fd);
 extern void add_write_fd (int fd, fd_callback func, void *data);
 extern void delete_write_fd (int fd);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 203085e24f..2fd1177625 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -357,7 +357,7 @@ ice_conn_watch_CB (IceConn iceConn, IcePointer clientData,
     }
 
   ice_fd = IceConnectionNumber (iceConn);
-  add_read_fd (ice_fd, x_session_check_input, NULL);
+  add_non_keyboard_read_fd (ice_fd, x_session_check_input, NULL);
 }
 
 /* Create the client leader window.  */
-- 
2.26.2

[Message part 3 (text/plain, inline)]


In GNU Emacs 27.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2020-09-20 built on dick
Repository revision: dff02e85245dfbbeea7d57dc1a753a9ba24616d5
Repository branch: gnus-dev-27
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.4 LTS

Recent messages:
#

Mark set [2 times]
Mark saved where search started
Quit
Mark set [2 times]
previous-line: Beginning of buffer [7 times]
Saving file /home/dick/emacs/.git/COMMIT_EDITMSG...
Wrote /home/dick/emacs/.git/COMMIT_EDITMSG
Git finished

Configured using:
 'configure --prefix=/home/dick/.local --with-rsvg=yes --with-xml2=yes
 PKG_CONFIG_PATH=/home/dick/.local/lib/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY LIBSELINUX
GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE
XIM MODULES THREADS JSON PDUMPER GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Magit

Minor modes in effect:
  beacon-mode: t
  pyvenv-mode: t
  show-paren-mode: t
  global-magit-file-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  flx-ido-mode: t
  projectile-mode: t
  ido-everywhere: t
  override-global-mode: t
  shell-dirtrack-mode: t
  global-hl-line-mode: t
  winner-mode: t
  cl-old-struct-compat-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/dick/ESS/lisp/obsolete/ess-swv hides /home/dick/ESS/lisp/ess-swv
/home/dick/ESS/lisp/obsolete/ess-rutils hides /home/dick/ESS/lisp/ess-rutils
/home/dick/ESS/lisp/obsolete/ess-noweb hides /home/dick/ESS/lisp/ess-noweb
/home/dick/ESS/lisp/obsolete/mouseme hides /home/dick/ESS/lisp/mouseme
/home/dick/ESS/lisp/obsolete/ess-mouse hides /home/dick/ESS/lisp/ess-mouse
/home/dick/ESS/lisp/obsolete/ess-noweb-mode hides /home/dick/ESS/lisp/ess-noweb-mode
/home/dick/ESS/lisp/obsolete/make-regexp hides /home/dick/ESS/lisp/make-regexp
/home/dick/ESS/lisp/obsolete/ess-r-a hides /home/dick/ESS/lisp/ess-r-a
/home/dick/ESS/lisp/obsolete/ess-noweb-font-lock-mode hides /home/dick/ESS/lisp/ess-noweb-font-lock-mode
/home/dick/gomacro-mode/gomacro-mode hides /home/dick/.emacs.d/elpa/gomacro-mode-20200326.1103/gomacro-mode
/home/dick/ESS/lisp/julia-mode-latexsubs hides /home/dick/.emacs.d/elpa/julia-mode-20200717.1915/julia-mode-latexsubs
/home/dick/ESS/lisp/julia-mode hides /home/dick/.emacs.d/elpa/julia-mode-20200717.1915/julia-mode
/home/dick/.emacs.d/elpa/hydra-20170924.2259/lv hides /home/dick/.emacs.d/elpa/lv-20191106.1238/lv
/home/dick/melpa-stats/melpa-stats hides /home/dick/.emacs.d/elpa/melpa-stats-20190720.1833/melpa-stats
/home/dick/.emacs.d/elpa/async-20200113.1745/async-autoloads hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async-autoloads
/home/dick/.emacs.d/elpa/async-20200113.1745/async-bytecomp hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async-bytecomp
/home/dick/.emacs.d/elpa/async-20200113.1745/smtpmail-async hides /home/dick/.local/share/emacs/site-lisp/emacs-async/smtpmail-async
/home/dick/.emacs.d/elpa/async-20200113.1745/dired-async hides /home/dick/.local/share/emacs/site-lisp/emacs-async/dired-async
/home/dick/.emacs.d/elpa/async-20200113.1745/async hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async
/home/dick/.emacs.d/elpa/async-20200113.1745/async-pkg hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async-pkg
/home/dick/.emacs.d/lisp/json hides /home/dick/.local/share/emacs/27.1/lisp/json
/home/dick/.emacs.d/elpa/map-2.1/map hides /home/dick/.local/share/emacs/27.1/lisp/emacs-lisp/map

Features:
(shadow sort flyspell ispell footnote mail-extr emacsbug whitespace term
disp-table ehelp debbugs-gnu debbugs soap-client rng-xsd xsd-regexp ivy delsel
colir ivy-overlay dumb-jump f google-c-style package-x magit-gitignore
magit-subtree mode-local nntwitter benchmark gnus-bcklg finder tar-mode
arc-mode archive-mode pkg-info epl sh-script executable nntwitter-api
shr-color eww deuglify gnus-async gnus-cite gnus-cus gnus-demon gnus-diary
nndiary gnus-draft gnus-agent nnvirtual nntp gnus-cache nndraft nnmh gnus-dup
gnus-fun gnus-html url-queue mm-url gnus-kill gnus-logic gnus-mh mh-comp
mh-scan mh-gnus mh-e mh-compat mh-buffers mh-loaddefs gnus-registry registry
gnus-salt gnus-score score-mode gnus-srvr gnus-topic gnus-uu yenc gnus-vm
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig sendmail nnir
gnus-sum shr svg gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc gnus-spec gnus-int gnus-range gnus-win nnoo windmove vc
vc-dispatcher make-mode rect apropos edebug webjump define-word rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode dom nxml-util
nxml-enc xmltok jsonnet-mode pulse novice poly-rst rst ag vc-svn find-dired
tabify beacon autoload lisp-mnt mm-archive network-stream url-cache
magit-extras mule-util flycheck jka-compr let-alist go-eldoc gomacro-mode
cl-print debug backtrace misearch multi-isearch company-oddmuse
company-keywords company-etags company-gtags company-dabbrev-code
company-dabbrev company-files company-cmake company-xcode company-eclim
company-css company-nxml company-bbdb company-go go-mode find-file ffap
company-template company-c-headers es-mode yasnippet-snippets yasnippet
company-capf elpy elpy-rpc pyvenv eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util elpy-shell elpy-profile
elpy-django s elpy-refactor ein-markdown-mode timezone url-http url-auth
url-gw nsm js ein-ipynb-mode ein-process ein-jupyter exec-path-from-shell
ein-dev ein-notebook python tramp-sh tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat parse-time iso8601 ls-lisp ein-gat
ein-python-send ein-traceback ein-shared-output ein-pytools ein-pager view
ein-completer ein-notification ein-scratchsheet ein-worksheet poly-ein
display-line-numbers polymode poly-lock polymode-base polymode-weave
polymode-export polymode-compat polymode-methods polymode-core
polymode-classes eieio-custom eieio-base color ein-kill-ring ein-cell
ein-output-area ein-kernelinfo ein-kernel ein-ipdb ein-events ein-websocket
websocket bindat ein-file ein-node ewoc ein-notebooklist eieio-opt speedbar
sb-image ezimage dframe find-func help-fns radix-tree ein-contents-api
ein-query ein-log ein-classes ein-core request ein-utils deferred cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs ein bug-reference face-remap paredit-ext paredit dired-x inf-ruby
ruby-mode smie melpa-stats ht dash-functional anaphora a pp sx key-combo
company haskell-interactive-mode haskell-presentation-mode haskell-process
haskell-session haskell-compile haskell-mode haskell-cabal haskell-utils
haskell-font-lock haskell-indentation haskell-string haskell-sort-imports
haskell-lexeme rx haskell-align-imports haskell-complete-module
haskell-ghc-support etags fileloop generator dabbrev haskell-customize hydra
lv use-package-ensure paren magit-patch-changelog magit-patch magit-submodule
magit-obsolete magit-popup magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch
magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode
magit-core magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process magit-mode git-commit transient magit-git magit-section
magit-utils crm log-edit message rmc dired dired-loaddefs rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader pcvs-util add-log with-editor async-bytecomp async pcase server
dash flx-ido flx solarized-theme solarized-definitions projectile ibuf-ext
ibuffer ibuffer-loaddefs grep gnus nnheader gnus-util rmail rmail-loaddefs
rfc2047 rfc2045 ietf-drums text-property-search time-date mail-utils mm-util
mail-prsvr google-translate-default-ui google-translate-core-ui ido
google-translate-core google-translate-tk google-translate-backend
use-package-bind-key bind-key auto-complete popup cus-edit cus-start cus-load
wid-edit ess-r-mode ess-r-flymake flymake-proc flymake warnings thingatpt
ess-r-xref xref ess-trns ess-r-package shell pcomplete ess-r-completion
ess-roxy ess-r-syntax ess-rd noutline outline easy-mmode hideshow ess-s-lang
ess-help ess-mode ess-inf project format-spec ess-tracebug ess ess-utils
ess-custom compile comint ansi-color emms-player-mplayer emms-player-simple
emms emms-compat twittering-mode epa derived epg epg-config tls gnutls puny
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap advice xml cl fzf cl-extra help-mode
use-package-core hl-line winner ring finder-inf howdoyou-autoloads
json-reformat-autoloads json-snatcher-autoloads edmacro kmacro
sml-mode-autoloads tornado-template-mode-autoloads info package easymenu
browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win
x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button
faces cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote threads
dbusbind inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 2880413 334546)
 (symbols 48 65209 1)
 (strings 32 391673 78473)
 (string-bytes 1 10934304)
 (vectors 16 194278)
 (vector-slots 8 4212639 383542)
 (floats 8 1323 4153)
 (intervals 56 303446 16134)
 (buffers 1000 269))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Tue, 06 Oct 2020 18:58:02 GMT) Full text and rfc822 format available.

Message #8 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: dick <dick.r.chiang <at> gmail.com>
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Tue, 06 Oct 2020 21:57:49 +0300
> From: dick <dick.r.chiang <at> gmail.com>
> Date: Tue, 06 Oct 2020 14:25:50 -0400
> 
> emacs -Q -l cl-lib \
>   --eval "(let* (flag \
>                  (proc (apply (function start-process) \"test\" nil \"sleep\" (list \"3\")))) \
>             (set-process-sentinel proc (lambda (&rest _args) (setq flag t))) \
>             (cl-assert (cl-loop repeat 10 \
>                         until flag \
>                         do (accept-process-output nil 0.5) \
>                         finally return flag)) \
>             (message \"good!\"))"
> 
> >From cd25ae2e9f8cf1d155084c125dae4058fccb6544 Mon Sep 17 00:00:00 2001
> From: dickmao <none>
> Date: Tue, 6 Oct 2020 14:21:03 -0400
> Subject: [PATCH] Process sentinels need to work under X and commandline
> 
> This is also noted in
> https://emacs.stackexchange.com/questions/60408/\
> process-sentinels-dont-run-during-init-in-gui-emacs
> 
> * src/process.c (add_non_keyboard_read_fd): Make this a public function.
> (add_process_read_fd): Fold old, static add_non_keyboard_read_fd guts
> into here.
> * src/xsmfns.c (ice_conn_watch_CB): Call add_non_keyboard_read_fd.

I'm probably missing something, because I don't understand the
rationale for your changes.  Can you please elaborate on the
rationale?  Also, are your changes supposed to fix the problem
reported at stackexchange, and if so, please also elaborate on that.

Thanks.

P.S. I'd prefer not to change the add_*_fd unless strictly necessary.
It's okay to make a static function be extern, but can we please avoid
other reshuffling?  If necessary (but I'd like to understand why), I'd
even prefer introducing a new function, rather than changing the
existing ones.  Specifically, I'd like to avoid the change of the
semantics of add_non_keyboard_read_fd.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Tue, 06 Oct 2020 19:17:01 GMT) Full text and rfc822 format available.

Message #11 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: dick.r.chiang <at> gmail.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Tue, 06 Oct 2020 15:16:13 -0400
Maintainer(s),

The `emacs -Q` invocation demonstrates the process sentinel never fires upon
the completion of the sleep `start-process`.  Note this failure only occurs
under X and when evaluating from the command line via `--eval` or `--funcall`.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Wed, 07 Oct 2020 06:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: dick.r.chiang <at> gmail.com
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Wed, 07 Oct 2020 09:39:28 +0300
> From: dick.r.chiang <at> gmail.com
> Cc: 43834 <at> debbugs.gnu.org
> Date: Tue, 06 Oct 2020 15:16:13 -0400
> 
> Maintainer(s),
> 
> The `emacs -Q` invocation demonstrates the process sentinel never fires upon
> the completion of the sleep `start-process`.  Note this failure only occurs
> under X and when evaluating from the command line via `--eval` or `--funcall`.

Thanks, I figured out that much.  What I was asking for was a more
detailed explanation why you propose to make the specific changes in
your patches to fix that problem.  IOW, how is the change in xsmfns.c
supposed to remedy the problem you describe above?

TIA




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Wed, 07 Oct 2020 11:33:01 GMT) Full text and rfc822 format available.

Message #17 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: dick.r.chiang <at> gmail.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Wed, 07 Oct 2020 07:32:39 -0400
xsmfns.c adds a "keyboard" read descriptor for /tmp/.ICE-unix which process.c
won't see when it calls compute_non_keyboard_wait_mask() in
wait_reading_process_output().  So make that read descriptor "non keyboard",
and it will no longer block status_notify() from running.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Wed, 07 Oct 2020 12:19:01 GMT) Full text and rfc822 format available.

Message #20 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: dick.r.chiang <at> gmail.com
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Wed, 07 Oct 2020 15:18:47 +0300
> From: dick.r.chiang <at> gmail.com
> Cc: 43834 <at> debbugs.gnu.org
> Date: Wed, 07 Oct 2020 07:32:39 -0400
> 
> xsmfns.c adds a "keyboard" read descriptor for /tmp/.ICE-unix which process.c
> won't see when it calls compute_non_keyboard_wait_mask() in
> wait_reading_process_output().  So make that read descriptor "non keyboard",
> and it will no longer block status_notify() from running.

Thank you.

Can you explain how the descriptor for /tmp/.ICE-unix is related to
running arbitrary subprocesses at startup?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Wed, 07 Oct 2020 12:34:01 GMT) Full text and rfc822 format available.

Message #23 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: dick.r.chiang <at> gmail.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Wed, 07 Oct 2020 08:33:17 -0400
It is related insofar as any read descriptor waiting to be flushed will
prevent status_notify() from running (this is why global-auto-revert-mode is a
bad idea as it introduces multiple inotify descriptors which, in your words,
can bring emacs "to its knees [and become] extremely unresponsive."

>>>>> Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: dick.r.chiang <at> gmail.com
>> Cc: 43834 <at> debbugs.gnu.org
>> Date: Wed, 07 Oct 2020 07:32:39 -0400
>> 
>> xsmfns.c adds a "keyboard" read descriptor for /tmp/.ICE-unix which process.c
>> won't see when it calls compute_non_keyboard_wait_mask() in
>> wait_reading_process_output().  So make that read descriptor "non keyboard",
>> and it will no longer block status_notify() from running.

> Thank you.

> Can you explain how the descriptor for /tmp/.ICE-unix is related to running
> arbitrary subprocesses at startup?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Wed, 07 Oct 2020 13:20:02 GMT) Full text and rfc822 format available.

Message #26 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: dick.r.chiang <at> gmail.com
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Wed, 07 Oct 2020 16:19:30 +0300
> From: dick.r.chiang <at> gmail.com
> Cc: 43834 <at> debbugs.gnu.org
> Date: Wed, 07 Oct 2020 08:33:17 -0400
> 
> It is related insofar as any read descriptor waiting to be flushed will
> prevent status_notify() from running

OK, so how does this get fixed later in the session, since
status_notify does run, and process sentinels do get called in
general?  IOW, which code does flush the descriptor whose watch is
installed by ice_conn_watch_CB, and which event triggers that?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Wed, 07 Oct 2020 13:45:02 GMT) Full text and rfc822 format available.

Message #29 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: dick.r.chiang <at> gmail.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Wed, 07 Oct 2020 09:44:16 -0400
I don't know.  As soon as control enters the read-eval-print loop, that ICE
descriptor no longer gets in the way.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Wed, 07 Oct 2020 14:18:02 GMT) Full text and rfc822 format available.

Message #32 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: dick.r.chiang <at> gmail.com
Cc: 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Wed, 07 Oct 2020 17:17:05 +0300
> From: dick.r.chiang <at> gmail.com
> Cc: 43834 <at> debbugs.gnu.org
> Date: Wed, 07 Oct 2020 09:44:16 -0400
> 
> I don't know.  As soon as control enters the read-eval-print loop, that ICE
> descriptor no longer gets in the way.

OK, thanks.  I think this is enough to figure the rest out.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Thu, 13 May 2021 10:53:01 GMT) Full text and rfc822 format available.

Message #35 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dick.r.chiang <at> gmail.com, 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Thu, 13 May 2021 12:52:30 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I don't know.  As soon as control enters the read-eval-print loop, that ICE
>> descriptor no longer gets in the way.
>
> OK, thanks.  I think this is enough to figure the rest out.

Eli, did you have any further comments here?  I've tried the test case,
and the current trunk still fails (and Dick's patch fixes the issue).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Thu, 13 May 2021 12:23:02 GMT) Full text and rfc822 format available.

Message #38 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: dick.r.chiang <at> gmail.com, 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Thu, 13 May 2021 15:22:31 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: dick.r.chiang <at> gmail.com,  43834 <at> debbugs.gnu.org
> Date: Thu, 13 May 2021 12:52:30 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> I don't know.  As soon as control enters the read-eval-print loop, that ICE
> >> descriptor no longer gets in the way.
> >
> > OK, thanks.  I think this is enough to figure the rest out.
> 
> Eli, did you have any further comments here?  I've tried the test case,
> and the current trunk still fails (and Dick's patch fixes the issue).

No, I have nothing more to contribute here, so if the change looks OK
to you, feel free to install it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43834; Package emacs. (Thu, 13 May 2021 13:23:02 GMT) Full text and rfc822 format available.

Message #41 received at 43834 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dick.r.chiang <at> gmail.com, 43834 <at> debbugs.gnu.org
Subject: Re: bug#43834: 27.1; [PATCH] Sentinels under X and command line
Date: Thu, 13 May 2021 15:22:21 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> No, I have nothing more to contribute here, so if the change looks OK
> to you, feel free to install it.

It makes sense to me, so I've now pushed it to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 13 May 2021 13:23:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 43834 <at> debbugs.gnu.org and dick <dick.r.chiang <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 13 May 2021 13:23:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 Jun 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.