GNU bug report logs - #30460
27.0.50; `process-command' of a stopped process is t

Previous Next

Package: emacs;

Reported by: p.stephani2 <at> gmail.com

Date: Wed, 14 Feb 2018 22:01:02 UTC

Severity: normal

Found in version 27.0.50

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

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 30460 in the body.
You can then email your comments to 30460 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#30460; Package emacs. (Wed, 14 Feb 2018 22:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to p.stephani2 <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 14 Feb 2018 22:01:02 GMT) Full text and rfc822 format available.

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

From: p.stephani2 <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; `process-command' of a stopped process is t
Date: Wed, 14 Feb 2018 23:00:26 +0100
(process-command
  (make-process :name "sleep" :command '("sleep" "1h") :stop t))

returns t.

This is not documented (the docstring and the manual say that this
should only happen for a pipe, network, or serial connection), and
breaks M-x list-processes, which assumes that the return value of
`process-command' is a list for an ordinary process.


In GNU Emacs 27.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version 3.22.24)
 of 2018-02-14 built on localhost
Repository revision: 298275c595f6ca9e77f8131d34dda2b58fe1faa5
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description: Debian GNU/Linux buster/sid

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --without-threads --enable-gcc-warnings=3Dwarn-only
 --enable-gtk-deprecation-warnings --without-pop --with-mailutils
 --enable-checking --enable-check-lisp-object-type --with-modules
 'CFLAGS=3D-O0 -ggdb3''

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS NOTIFY GNUTLS FREETYPE XFT
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES JSON

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

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-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
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date
mule-util 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 menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame 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 minibuffer
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 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 95245 7945)
 (symbols 48 20245 1)
 (miscs 40 40 121)
 (strings 32 28327 2301)
 (string-bytes 1 757257)
 (vectors 16 14137)
 (vector-slots 8 499280 14010)
 (floats 8 50 67)
 (intervals 56 223 0)
 (buffers 992 12))

--=20
Google Germany GmbH
Erika-Mann-Stra=C3=9Fe 33
80636 M=C3=BCnchen

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado

If you received this communication by mistake, please don=E2=80=99t forward=
 it to
anyone else (it may contain confidential or privileged information), please
erase all copies of it, including all attachments, and please let the sender
know it went to the wrong person.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30460; Package emacs. (Sat, 17 Feb 2018 13:26:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: p.stephani2 <at> gmail.com
Cc: 30460 <at> debbugs.gnu.org
Subject: Re: bug#30460: 27.0.50; `process-command' of a stopped process is t
Date: Sat, 17 Feb 2018 15:25:50 +0200
> Date: Wed, 14 Feb 2018 23:00:26 +0100
> From: p.stephani2 <at> gmail.com
> 
> 
> (process-command
>    (make-process :name "sleep" :command '("sleep" "1h") :stop t))
> 
> returns t.
> 
> This is not documented (the docstring and the manual say that this
> should only happen for a pipe, network, or serial connection), and
> breaks M-x list-processes, which assumes that the return value of
> `process-command' is a list for an ordinary process.

":stop t" currently has no effect on a "real" process running a
command, because it is not generally possible to start a process in a
stopped state.  So it's a Good Thing list-processes fails for such
bogus "processes" ;-)

We could fix this by either ignoring :stop in make-process, or by
signaling an error.  The simplest change is just delete this snipper
from Fmake_process:

  if (tem = Fplist_get (contact, QCstop), !NILP (tem))
    pset_command (XPROCESS (proc), Qt);

The correct command was already set by that time, so the above just
overwrites the correct expected value.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30460; Package emacs. (Fri, 19 Apr 2019 11:07:02 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 30460 <at> debbugs.gnu.org
Subject: Re: bug#30460: 27.0.50; `process-command' of a stopped process is t
Date: Fri, 19 Apr 2019 13:05:44 +0200
Am Sa., 17. Feb. 2018 um 14:25 Uhr schrieb Eli Zaretskii <eliz <at> gnu.org>:
>
> > Date: Wed, 14 Feb 2018 23:00:26 +0100
> > From: p.stephani2 <at> gmail.com
> >
> >
> > (process-command
> >    (make-process :name "sleep" :command '("sleep" "1h") :stop t))
> >
> > returns t.
> >
> > This is not documented (the docstring and the manual say that this
> > should only happen for a pipe, network, or serial connection), and
> > breaks M-x list-processes, which assumes that the return value of
> > `process-command' is a list for an ordinary process.
>
> ":stop t" currently has no effect on a "real" process running a
> command, because it is not generally possible to start a process in a
> stopped state.  So it's a Good Thing list-processes fails for such
> bogus "processes" ;-)
>
> We could fix this by either ignoring :stop in make-process, or by
> signaling an error.

I prefer the second option for clarity and will send a patch in a moment.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30460; Package emacs. (Fri, 19 Apr 2019 11:08:01 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: eliz <at> gnu.org
Cc: Philipp Stephani <phst <at> google.com>, 30460 <at> debbugs.gnu.org
Subject: [PATCH] Remove :stop key from make-process.
Date: Fri, 19 Apr 2019 13:06:43 +0200
This has never worked and caused issues such as Bug#30460.

* src/process.c (Fmake_process): Don't accept :stop key any more.
(syms_of_process): Define needed symbol 'null'.

* test/src/process-tests.el (make-process/stop): New unit test.

* doc/lispref/processes.texi (Asynchronous Processes): Remove :stop
key from manual.
---
 doc/lispref/processes.texi |  4 ----
 etc/NEWS                   |  3 +++
 src/process.c              | 13 ++++++-------
 test/src/process-tests.el  |  9 +++++++++
 4 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 6be311b563..e9f9d64cc3 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -677,10 +677,6 @@ Asynchronous Processes
 Initialize the process query flag to @var{query-flag}.
 @xref{Query Before Exit}.
 
-@item :stop @var{stopped}
-If @var{stopped} is non-@code{nil}, start the process in the
-stopped state.
-
 @item :filter @var{filter}
 Initialize the process filter to @var{filter}.  If not specified, a
 default filter will be provided, which can be overridden later.
diff --git a/etc/NEWS b/etc/NEWS
index 3e3454bd93..4d76143b13 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1515,6 +1515,9 @@ The global value of 'indent-line-function', which defaults to
 To get back the old behavior, add a function to 'text-mode-hook' which
 performs (setq-local indent-line-function #'indent-relative).
 
+** 'make-process' no longer accepts a non-nil ':stop' key.  This has
+never worked reliably, and now causes an error.
+
 
 * Lisp Changes in Emacs 27.1
 
diff --git a/src/process.c b/src/process.c
index 0c44037162..412ced58de 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1643,11 +1643,6 @@ ENCODING is used for writing.
 :noquery BOOL -- When exiting Emacs, query the user if BOOL is nil and
 the process is running.  If BOOL is not given, query before exiting.
 
-:stop BOOL -- Start process in the `stopped' state if BOOL non-nil.
-In the stopped state, a process does not accept incoming data, but you
-can send outgoing data.  The stopped state is cleared by
-`continue-process' and set by `stop-process'.
-
 :connection-type TYPE -- TYPE is control type of device used to
 communicate with subprocesses.  Values are `pipe' to use a pipe, `pty'
 to use a pty, or nil to use the default specified through
@@ -1746,8 +1741,10 @@ usage: (make-process &rest ARGS)  */)
 
   if (!query_on_exit)
     XPROCESS (proc)->kill_without_query = 1;
-  if (tem = Fplist_get (contact, QCstop), !NILP (tem))
-    pset_command (XPROCESS (proc), Qt);
+  tem = Fplist_get (contact, QCstop);
+  /* Normal processes can't be started in a stopped state, see
+     Bug#30460.  */
+  CHECK_TYPE (NILP (tem), Qnull, tem);
 
   tem = Fplist_get (contact, QCconnection_type);
   if (EQ (tem, Qpty))
@@ -8300,6 +8297,8 @@ returns non-`nil'.  */);
 	  "internal-default-interrupt-process");
   DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions");
 
+  DEFSYM (Qnull, "null");
+
   defsubr (&Sprocessp);
   defsubr (&Sget_process);
   defsubr (&Sdelete_process);
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 0bb7ebe50a..b853f77946 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -284,5 +284,14 @@ process-tests--file-handler
 (put #'process-tests--file-handler 'operations
      '(unhandled-file-name-directory make-process))
 
+(ert-deftest make-process/stop ()
+  "Check that `make-process' doesn't accept a `:stop' key.
+See Bug#30460."
+  (should-error
+   (make-process :name "test"
+                 :command (list (expand-file-name invocation-name
+                                                  invocation-directory))
+                 :stop t)))
+
 (provide 'process-tests)
 ;; process-tests.el ends here.
-- 
2.20.1 (Apple Git-117)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30460; Package emacs. (Fri, 19 Apr 2019 11:28:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: phst <at> google.com, 30460 <at> debbugs.gnu.org
Subject: Re: [PATCH] Remove :stop key from make-process.
Date: Fri, 19 Apr 2019 14:26:59 +0300
> From: Philipp Stephani <p.stephani2 <at> gmail.com>
> Cc: 30460 <at> debbugs.gnu.org,
> 	Philipp Stephani <phst <at> google.com>
> Date: Fri, 19 Apr 2019 13:06:43 +0200
> 
> This has never worked and caused issues such as Bug#30460.
> 
> * src/process.c (Fmake_process): Don't accept :stop key any more.
> (syms_of_process): Define needed symbol 'null'.
> 
> * test/src/process-tests.el (make-process/stop): New unit test.
> 
> * doc/lispref/processes.texi (Asynchronous Processes): Remove :stop
> key from manual.

Please don't remove that, but instead document that it's an error to
use that keyword.




Reply sent to Philipp Stephani <p.stephani2 <at> gmail.com>:
You have taken responsibility. (Fri, 19 Apr 2019 12:16:02 GMT) Full text and rfc822 format available.

Notification sent to p.stephani2 <at> gmail.com:
bug acknowledged by developer. (Fri, 19 Apr 2019 12:16:02 GMT) Full text and rfc822 format available.

Message #22 received at 30460-done <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Philipp Stephani <phst <at> google.com>, 30460-done <at> debbugs.gnu.org
Subject: Re: [PATCH] Remove :stop key from make-process.
Date: Fri, 19 Apr 2019 14:15:10 +0200
Am Fr., 19. Apr. 2019 um 13:27 Uhr schrieb Eli Zaretskii <eliz <at> gnu.org>:
>
> > From: Philipp Stephani <p.stephani2 <at> gmail.com>
> > Cc: 30460 <at> debbugs.gnu.org,
> >       Philipp Stephani <phst <at> google.com>
> > Date: Fri, 19 Apr 2019 13:06:43 +0200
> >
> > This has never worked and caused issues such as Bug#30460.
> >
> > * src/process.c (Fmake_process): Don't accept :stop key any more.
> > (syms_of_process): Define needed symbol 'null'.
> >
> > * test/src/process-tests.el (make-process/stop): New unit test.
> >
> > * doc/lispref/processes.texi (Asynchronous Processes): Remove :stop
> > key from manual.
>
> Please don't remove that, but instead document that it's an error to
> use that keyword.

OK, I've reworded it a bit and pushed as 5c5e309527.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 May 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 316 days ago.

Previous Next


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