all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Vitalie Spinu <spinuvit@gmail.com>
Cc: 13475@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	[thread overview]
Message-ID: <87eeztg2s9.fsf@gnus.org> (raw)
In-Reply-To: <87boco3sqi.fsf@gmail.com> (Vitalie Spinu's message of "Thu, 17 Jan 2013 13:21:25 +0100")

Vitalie Spinu <spinuvit@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





  reply	other threads:[~2019-10-03 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 12:21 bug#13475: 24.2.91; accept-process-output hangs emacs on killed sub-process Vitalie Spinu
2019-10-03 17:24 ` Lars Ingebrigtsen [this message]
2019-10-04 14:49   ` Dmitry Gutov
2019-10-07  3:19     ` Lars Ingebrigtsen
2019-10-07 10:14       ` Dmitry Gutov
2019-10-08 16:37         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eeztg2s9.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=13475@debbugs.gnu.org \
    --cc=spinuvit@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.