GNU bug report logs - #43202
list-processes--refresh Wrong type argument

Previous Next

Package: emacs;

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

Date: Fri, 4 Sep 2020 13:02:02 UTC

Severity: normal

Tags: fixed, patch

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 43202 in the body.
You can then email your comments to 43202 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#43202; Package emacs. (Fri, 04 Sep 2020 13:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to dick.r.chiang <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 04 Sep 2020 13:02:02 GMT) Full text and rfc822 format available.

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

From: dick.r.chiang <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: patch
Date: Fri, 04 Sep 2020 09:01:08 -0400
[0001-Squashed-commit-of-the-following.patch (text/x-diff, inline)]
From 50446fc44e54a989db0863b5c8c887043e1226f9 Mon Sep 17 00:00:00 2001
From: dickmao <none>
Date: Fri, 4 Sep 2020 08:57:58 -0400
Subject: [PATCH] Squashed commit of the following:

commit 4ceb578a9c9a93ea44f61e7453aae5b8c2ed90e6
Author: dickmao <none>
Date:   Fri Sep 4 08:55:39 2020 -0400

    avoid `Wrong type argument` in `list-processes--refresh`

    Should not expect sequencep from `process-command` for network,
    serial, pipe.

* lisp/simple.el (list-processes--refresh): network, serial, *or pipe*.
* test/src/process-tests.el (process-test-stopped-pipe): add a test.
---
 lisp/simple.el            | 2 +-
 test/src/process-tests.el | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index eedbff2d08..e7eb33b200 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4374,7 +4374,7 @@ list-processes--refresh
 		    ((thread-name (process-thread p)))
 		    (t "--")))
 		  (cmd
-		   (if (memq type '(network serial))
+		   (if (memq type '(network serial pipe))
 		       (let ((contact (process-contact p t t)))
 			 (if (eq type 'network)
 			     (format "(%s %s)"
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e15ad47f96..c45b00a776 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -105,6 +105,15 @@ process-test-stderr-buffer
 	      (goto-char (point-min))
 	      (looking-at "hello stderr!")))))
 
+(ert-deftest process-test-stopped-pipe ()
+  (skip-unless (executable-find "cat"))
+  (with-temp-buffer
+    (let ((proc (make-pipe-process :name "pipe" :buffer (current-buffer)
+                                   :command '("cat") :stop t)))
+      (unwind-protect
+          (should (list-processes--refresh))
+        (delete-process proc)))))
+
 (ert-deftest process-test-stderr-filter ()
   (skip-unless (executable-find "bash"))
   (let* ((sentinel-called nil)
-- 
2.26.2





Changed bug title to 'list-processes--refresh Wrong type argument' from 'patch' Request was from dick <dick.r.chiang <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 04 Sep 2020 13:19:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43202; Package emacs. (Fri, 04 Sep 2020 13:31:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: dick.r.chiang <at> gmail.com
Cc: 43202 <at> debbugs.gnu.org
Subject: Re: bug#43202: patch
Date: Fri, 04 Sep 2020 15:29:56 +0200
dick.r.chiang <at> gmail.com writes:

Looks good.  Some comments:

> * lisp/simple.el (list-processes--refresh): network, serial, *or pipe*.
> * test/src/process-tests.el (process-test-stopped-pipe): add a test.

These aren't really descriptive (and each sentence should start with a
capital letter).

> +(ert-deftest process-test-stopped-pipe ()
> +  (skip-unless (executable-find "cat"))
> +  (with-temp-buffer
> +    (let ((proc (make-pipe-process :name "pipe" :buffer (current-buffer)
> +                                   :command '("cat") :stop t)))
> +      (unwind-protect
> +          (should (list-processes--refresh))
> +        (delete-process proc)))))

I don't think this test is correct -- you're really checking that
list-processes--refresh doesn't bug out; not that it returns non-nil (it
doesn't have a well-defined return value).

So if this is to be checked for (I'm not sure it adds much value as a
test), then it should check whether it errors out or not (and the value
should be disregarded).

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




Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 05 Sep 2020 15:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43202; Package emacs. (Sun, 06 Sep 2020 21:22:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: dick.r.chiang <at> gmail.com
Cc: 43202 <at> debbugs.gnu.org
Subject: Re: bug#43202: patch
Date: Sun, 06 Sep 2020 23:20:42 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I don't think this test is correct -- you're really checking that
> list-processes--refresh doesn't bug out; not that it returns non-nil (it
> doesn't have a well-defined return value).
>
> So if this is to be checked for (I'm not sure it adds much value as a
> test), then it should check whether it errors out or not (and the value
> should be disregarded).

The bug fix itself should definitely go in, though, so I've now applied
that part.

-- 
(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. (Sun, 06 Sep 2020 21:22:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 43202 <at> debbugs.gnu.org and dick.r.chiang <at> gmail.com Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Sep 2020 21:22:02 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. (Mon, 05 Oct 2020 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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