GNU bug report logs - #50166
28.0.50; ECM for possible process-status/sentinel bug

Previous Next

Package: emacs;

Reported by: Adam Porter <adam <at> alphapapa.net>

Date: Sun, 22 Aug 2021 20:09:02 UTC

Severity: normal

Found in version 28.0.50

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Adam Porter <adam <at> alphapapa.net>
Cc: 50166 <at> debbugs.gnu.org
Subject: Re: bug#50166: 28.0.50; ECM for possible process-status/sentinel bug
Date: Mon, 23 Aug 2021 00:18:31 +0200
Adam Porter <adam <at> alphapapa.net> writes:

> According to https://orgmode.org/worg/org-faq.html#ecm:
>
>     This is a French acronym used by some mailing list members; it stands
>     for "Exemple Complet Minimal", or "Complete Minimal   Example".

I see.  :-)

The example wasn't that minimal, though, so I shortened it a bit to
understand it better:

;;;  -*- lexical-binding: t; -*-

(defun start-curls ()
  (interactive)
  (dotimes (i 10)
    (let* ((process-buffer (generate-new-buffer (format "argh-curl-%02d" i)))
           (process (make-process :name "argh-"
                                  :buffer process-buffer
                                  :coding 'binary
                                  :command '("curl"
                                             "--silent"
                                             "--compressed"
                                             "--location"
                                             "--dump-header" "-"
                                             "--config" "-")
                                  :connection-type 'pipe
                                  :sentinel #'argh--sentinel
                                  :stderr process-buffer)))
      (process-send-string process "--url https://httpbin.org/get\n")
      (process-send-eof process)
      process)))

(defun argh--sentinel (process status)
  (with-current-buffer (process-buffer process)
    (when (equal (string-clean-whitespace status) "finished")
      (message "status: %s %s %S" (string-clean-whitespace status)
	       (process-status process) process)
      (kill-buffer (current-buffer)))))


And, indeed, after `M-x start-curls' I'm usually prompted for a

Buffer "argh-curl-09<2>" has a running process; kill it? (yes or no)

However, the status messaged by all those say:

status: finished exit #<process argh-<1>>

So somehow process-status can claim that the status is `exit', but
`kill-buffer' then says that the process is alive...  Most puzzling.

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




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

Previous Next


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