GNU bug report logs -
#17561
24.4.50; Emacs can forget processes
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 30 May 2014 14:29:36 -0700
with message-id <5388F840.3090909 <at> cs.ucla.edu>
and subject line Re: bug#17561: Emacs can forget processes
has caused the debbugs.gnu.org bug report #17561,
regarding 24.4.50; Emacs can forget processes
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
17561: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17561
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From time to time, my Emacs tends to become very slow. I have tracked
this down to a weird interaction with certain processes.
Sometimes, when a process dies (e.g. after its buffer is killed), Emacs
apparently does not clean up correctly. The sentinel is called, the
process itself receives a termination signal, but the process object
still shows up in M-x list-processes, and there is a zombie process in
ps.
When this happens, Emacs is in a tight loop trying to read from the dead
process(es):
21:24:00.948071 pselect6(12, [3 4 9 11], [], NULL, {0, 1376013},
{NULL, 8}) = 2 (in [9 11], left {0, 1373467})
<0.000011>
21:24:00.948529 read(9, "", 4096) = 0 <0.000009>
21:24:00.948564 read(11, "", 4096) = 0 <0.000008>
Killing the processes in M-x list-processes using
`process-menu-delete-process' returns Emacs to a usable state, albeit
the zombie processes stay around.
I have been able to reliably reproduce the behavior using this snippet:
(with-temp-buffer
(let ((process-connection-type t))
(set-process-query-on-exit-flag
(start-process "cat" (current-buffer) "cat")
nil)))
I.e. create a buffer, associate a process with it, remove the query on
exit flag, and kill the buffer. The `process-connection-type' nil is the
relevant part. With t, it works correctly.
The snippet does *not* work on a freshly-started Emacs. A random time
after the bug shows up, Emacs also cleans up the zombie processes and
the bug can not be triggered anymore. Until a whole while later, it
shows up again.
I have seen this happen in 24.3.50, 24.3.91 (pretest 2), and current
trunk.
[Message part 3 (message/rfc822, inline)]
On 05/30/2014 01:41 PM, Jorgen Schaefer wrote:
> So I would assume that this bug is fixed, and if I come across weird
> behavior again, I'll create a new report or re-open this one.
Thanks, closing the bug.
> Possibly related, while trying to reproduce the bug, I have noticed
> some other strange behavior. I managed to reduce it to the following
> reproduction code:
>
> (with-temp-buffer
> (let ((proc (start-process "test" (current-buffer) "bash" "-c"
> "echo foo ; sleep 5")))
> (set-process-query-on-exit-flag proc nil)
> (accept-process-output nil 2)))
>
> This hangs my normal Emacs for 2 seconds. A newly-started Emacs returns
> immediately. I*suspect* that this is a timing issue, and strace
> *seems* to concur - Emacs reads the "foo" from the subprocess before
> running accept-process-output, and then just hangs for the two second
> timeout, instead of noticing that there already was some output. Should
> I create a new bug report for this?
Yes, please. It'd be nice to get an strace of Emacs, particularly where
it goes wrong (which may be well before the symptoms start being visible).
This bug report was last modified 10 years and 351 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.