GNU bug report logs - #13475
24.2.91; accept-process-output hangs emacs on killed sub-process

Previous Next

Package: emacs;

Reported by: Vitalie Spinu <spinuvit <at> gmail.com>

Date: Thu, 17 Jan 2013 12:39:02 UTC

Severity: normal

Tags: confirmed

Found in versions 24.2.91, 25.0.95

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Vitalie Spinu <spinuvit <at> gmail.com>
Cc: 13475 <at> debbugs.gnu.org
Subject: bug#13475: 24.2.91; accept-process-output hangs emacs on killed sub-process
Date: Thu, 03 Oct 2019 19:24:54 +0200
Vitalie Spinu <spinuvit <at> gmail.com> writes:

> Accept-process-output, when run with WAIT argument, hangs emacs when the
> underlying sub-process was killed. When WAIT is nil this problem does
> not occur.
>
> Start M-x shell and execute:
>
>    (let ((proc (get-process "shell")))
>      (process-send-string proc "sleep 60\n")
>      (while (not (accept-process-output proc .01))))
>
> This puts emacs in a loop as expected. Now kill the bash process from
> outside emacs and you will see that emacs is still hanged.
>
> This problem does not occur when WAIT argument is nil. For example on
> the execution of the following code, emacs successfully exits the waiting
> loop after the bash process has been killed:
>
>    (let ((proc (get-process "shell")))
>      (accept-process-output proc))

(I'm going through old Emacs bug reports that unfortunately got no
response at the time.)

I'm don't think this is a bug -- as you say, if PROC is dead, then we
just heed the timeout, so in a loop like this, you should check whether
PROC is alive before calling `accept-process-output'.

So I'm closing this bug report.  I somebody things that Emacs should be
changed to make accept-process-output to return immediately (with a
non-nil return value?) if PROC is dead, please reopen.

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




This bug report was last modified 5 years and 230 days ago.

Previous Next


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