GNU bug report logs -
#56002
src/process.c; make-process fails to clean up stderr process on early exit
Previous Next
Full log
Message #8 received at 56002 <at> debbugs.gnu.org (full text, mbox):
I have been reading the docs on accepting output again,
and I see that there might be some subtlety here, but in
fact following the examples in the docs should reveal
another way the bug can express itself.
Specifically, in the original example I did not call
accept-process-output on the stderr process as is
suggested by the docs. Unfortunately, the docs are
misleading in this case because I am doing things
inside an unwind-protect cleanup clause and
accepting output from the stderr process causes
the example (below) to hang forever.
I think this happens because the stderr process is not
cleaned up correctly, OR possibly because of some
unexpected interaction due to the use of unwind-protect.
Example:
#+begin_src bash
read -r -d '' example <<'EOF'
(let ((stderr-buffer (generate-new-buffer " rc stderr")))
(unwind-protect
(let ((process
(make-process
:name "process that never actually starts"
:stderr stderr-buffer
:command '("i_fail_before_there_can_be_a_return_code"))))
(message "this will never print because we never get here")
(while (accept-process-output process)))
(while (accept-process-output (get-buffer-process stderr-buffer)))
(kill-buffer stderr-buffer)))
EOF
emacs -Q -batch -eval "${example}"
#+end_src
Docs in question:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Accepting-Output.html
This bug report was last modified 2 years and 314 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.