GNU bug report logs - #51177
29.0.50; stop-process on pipes

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Wed, 13 Oct 2021 09:21:02 UTC

Severity: normal

Found in version 29.0.50

Full log


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

From: Helmut Eller <eller.helmut <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 51177 <at> debbugs.gnu.org
Subject: Re: bug#51177: 29.0.50; stop-process on pipes
Date: Fri, 12 Nov 2021 14:26:59 +0100
On Fri, Nov 12 2021, Eli Zaretskii wrote:

> Thanks.  Can you show a recipe for testing this?

Create a file with this code:

(ert-deftest test-read-after-exit ()
  (let* ((output "")
	 (filter (lambda (p s) (setq output (concat output s))))
	 (sentinel (lambda (p _)
		     (set-process-filter p filter)
		     (while (accept-process-output p 0))))
	 (proc (make-process :command '("printf" "foo")
			     :name "test-proc"
			     :filter t
			     :sentinel sentinel)))
    (while (process-live-p proc)
      (accept-process-output proc 0.2))
    (should (equal output "foo"))))

and execute: emacs -Q --batch -l test.el -f ert-run-tests-batch-and-exit

However, if delete-process is called from the sentinel like so

(ert-deftest test-delete-proces ()
  (let* ((output "")
	 (filter (lambda (p s) (setq output (concat output s))))
	 (sentinel (lambda (p _)
		     (set-process-filter p filter)
		     (while (accept-process-output p 0))
		     (delete-process p)))
	 (proc (make-process :command '("printf" "foo")
			     :name "test-proc"
			     :filter t
			     :sentinel sentinel)))
    (while (process-live-p proc)
      (accept-process-output proc 0.2))
    (should (equal output "foo"))))


then it produces an endless loop.

Helmut




This bug report was last modified 3 years and 312 days ago.

Previous Next


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