From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#51177: 29.0.50; stop-process on pipes Date: Thu, 11 Nov 2021 20:47:57 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51177@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 11 20:49:30 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlG4f-0001UM-04 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 20:49:29 +0100 Original-Received: from localhost ([::1]:56844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlG4d-0006NM-SU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 14:49:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlG4N-0006NC-Af for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 14:49:11 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlG4E-0001RE-EX for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 14:49:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlG4E-0002Df-79 for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 14:49:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Nov 2021 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51177 X-GNU-PR-Package: emacs Original-Received: via spool by 51177-submit@debbugs.gnu.org id=B51177.16366600878458 (code B ref 51177); Thu, 11 Nov 2021 19:49:02 +0000 Original-Received: (at 51177) by debbugs.gnu.org; 11 Nov 2021 19:48:07 +0000 Original-Received: from localhost ([127.0.0.1]:42371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlG3L-0002CM-GP for submit@debbugs.gnu.org; Thu, 11 Nov 2021 14:48:07 -0500 Original-Received: from mail-wr1-f54.google.com ([209.85.221.54]:40603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlG3J-0002Bp-1p for 51177@debbugs.gnu.org; Thu, 11 Nov 2021 14:48:06 -0500 Original-Received: by mail-wr1-f54.google.com with SMTP id r8so11592588wra.7 for <51177@debbugs.gnu.org>; Thu, 11 Nov 2021 11:48:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:user-agent:mime-version; bh=j80JVgGvixyTmTTzAQ2BJybva0tS5z+8pHuDMwHU6wo=; b=ZlzSwDzjtuuPU1+3XvDYAp6uwAajxXIKU1irvxjvd/fBiwiMlAGX8MCEw5e5cOhxln g73UvDqTo8OAzZAgZ6lsXfrRqCMiULbHIrUI6L/G20kEKmb9Tc64B31Hch1msKBivlMC SSkipu7MTIIHYxyhksFFBFdHLR41DDuWiqJpr2lOD1j8NTHm5N3i02vSWf6yUBxlSncx IjVdCdxESofyoD4VQ89itXu+w8zjqFHZpoQFB1vMVMjWgocTSSImYKK3sTd+bwq6HtlI aNV855AoSOVKpKe5FPxRHHUgy5IquyuB+cscstUSQO3tI4fc5LgwVYlFvIKjAsqN5FUV UuTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :mime-version; bh=j80JVgGvixyTmTTzAQ2BJybva0tS5z+8pHuDMwHU6wo=; b=TJInB8tk0s8MGXo9JgM2Q8FdyxY9xeteNnkz9SjVAOb4UrNakMCQ9bOrXs9g94K5xa Qts5Ba9L1IcZFs3u1r091FkA+urYtk0s0AgdmeQ6dA4Ccjwt5pO+VEipRe9s+S/HArhg OnMMNaMyIMMEfCn5RWGYm9+BU+n5lveHsNuuCIc2TJPvgUgypYO3H56K6wpVWRUs5QQP ZYDmo5jP/N2PvxbWd8dgG151F9XMf/TTiMiDgrrfoXD610zhbIl7sdUis4AzwFCZvok9 sTGtz4XKLCjsBepdJmjBZsaHRzo4YBT5ZvTMA8dtQnhVRGpY+miaVdQJTi8Byn7C8RJu w+fg== X-Gm-Message-State: AOAM532GfHt9r5fh9kccJVbbykEtfbmLkgvFnARN99hTmpZAFYk6x+Jj FKArGlveYQfGAtGiz+zZ5+ZrPeAZaUI= X-Google-Smtp-Source: ABdhPJzPA1ID6ZghaN+yH3+LnaeC8Yp9Ca7hy0hBpZBfSvH6xT+qChkq3NjuM4wQxyqGFfoyftszRQ== X-Received: by 2002:a5d:4a44:: with SMTP id v4mr11854985wrs.246.1636660079161; Thu, 11 Nov 2021 11:47:59 -0800 (PST) Original-Received: from caladan ([31.177.117.48]) by smtp.gmail.com with ESMTPSA id u5sm3913566wrg.57.2021.11.11.11.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 11:47:58 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219681 Archived-At: I have another problem with stopped output. In this example: ;;; -*- lexical-binding:t -*- (ert-deftest test-read-after-exit () (let* ((output "") (filter (lambda (p s) (setq output (concat output s)))) (sentinel (lambda (p _) (set-process-filter p filter) (while (accept-process-output p 0)))) (proc (make-process :command '("printf" "foo") :name "test-proc" :filter t :sentinel sentinel :connection-type 'pipe))) (while (process-live-p proc) (accept-process-output proc 0.2)) (set-process-filter proc filter) (while (accept-process-output proc 0)) (should (equal output "foo")))) the filter function is never called. We could say that reading the process's output after the process has terminated is an unreasonable request. However, I would like to propose that, in status_notify, the sentinel function should be called before closing the file descriptors. That way, the sentinel can read the buffered output as suggested in the example. Helmut