From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#33018: 26.1.50; thread starvation with async processes and accept-process-output Date: Sun, 14 Oct 2018 16:17:08 +0100 Message-ID: <878t30h823.fsf@tcd.ie> References: <87r2gwbmma.fsf@tcd.ie> <875zy7cqzd.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1539530169 30538 195.159.176.226 (14 Oct 2018 15:16:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Oct 2018 15:16:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33018@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 14 17:16:04 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBi7g-0007r3-59 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Oct 2018 17:16:04 +0200 Original-Received: from localhost ([::1]:48690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBi9m-0004sx-FJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Oct 2018 11:18:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBi9e-0004sh-Eg for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 11:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBi9a-0004SI-Vg for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 11:18:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBi9a-0004Rw-Pp for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 11:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gBi9a-0000VQ-LY for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 11:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Oct 2018 15:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33018 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33018-submit@debbugs.gnu.org id=B33018.15395302431891 (code B ref 33018); Sun, 14 Oct 2018 15:18:02 +0000 Original-Received: (at 33018) by debbugs.gnu.org; 14 Oct 2018 15:17:23 +0000 Original-Received: from localhost ([127.0.0.1]:49446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBi8x-0000UR-AT for submit@debbugs.gnu.org; Sun, 14 Oct 2018 11:17:23 -0400 Original-Received: from mail-ed1-f46.google.com ([209.85.208.46]:45162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBi8t-0000Tw-JT for 33018@debbugs.gnu.org; Sun, 14 Oct 2018 11:17:19 -0400 Original-Received: by mail-ed1-f46.google.com with SMTP id v18-v6so15520847edq.12 for <33018@debbugs.gnu.org>; Sun, 14 Oct 2018 08:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XppSNzBezTqqCrMm+3mt6E9JaOGxsiIOA2+sRXzxMa0=; b=dd/9zqc34TgwCJ6zyl62zK/bIZA6hRWZc2YbJ9/Mq+ZnlA1Zn1wOyV/jfIiyD9Oikw qFh50TIWKWdSh6qN0BmuBqfGxQemF3cIcv6DFou3UImYRcIYFONn6J1JWowRnDKI4QAs 21cpFwhVyoV1Tp4RBZhfBTbJqL+cG5rdcJk8ZTKGKwBeikOProidQ83aGMVT8DfzVzJN VXdLn3n2Ftr/SPlJvZ2ZYl3pfQlqm5yKShZaM3JG3fdLLdvJknHkC9dI4LLaWFl7f5+4 /A2EZQy5PorEOeRBkF6xjkzXQ7EqyJ4WWiXKgFQG35ENMpHWA/TVRdgjf5OL0qLFi2Pl Jm4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XppSNzBezTqqCrMm+3mt6E9JaOGxsiIOA2+sRXzxMa0=; b=jxejEkiBSuD/h+oQa/dRPDPJPnwJ+HprGdXdZ0bIuuLPAz+ZTtjxblqgPHav6EDIQQ KpN9LrboiNsW45qOfzbhu9BJYpmgEiXbt7NL1HBHrs43tFOLlOjGDvP7pvn020g7TDAK kIuIzJ4Ox3X+IMIZ9Eht/mFBHThMr9IybcaYkXQe/6GEtORLO2IcBxTsnAgWKRhsTRnI uhV2TzMhlacSSlZY0/JRBJYL60M8v8mHRMDLQHPhf8N6kHS7QK0aWC5a+5T245NlN5y1 nvHHl4hRMFVzV4NiVd3LCOQ1Sj5JPoOaR0OFfNWIFLHFa4IZiKG+aNfRSLJKGcuVqbxR n1Mw== X-Gm-Message-State: ABuFfojMXHm98xbYaeGFsXQIImoDV0OaJdo6t7Hujln7N/O7Ho9c/65R cwYVaFPUEq5LkLBe1QjFG7+d1Q== X-Google-Smtp-Source: ACcGV61Cip2pDn0PgGil7FDoUelUrOTr6NWoZNTAdfV5C8O/aWGvQdM3GpQTGUdUceoRfrYLqYTrzg== X-Received: by 2002:a50:fc97:: with SMTP id f23-v6mr19752846edq.276.1539530233933; Sun, 14 Oct 2018 08:17:13 -0700 (PDT) Original-Received: from localhost ([213.233.155.133]) by smtp.gmail.com with ESMTPSA id y47-v6sm3729289edc.27.2018.10.14.08.17.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Oct 2018 08:17:13 -0700 (PDT) In-Reply-To: <875zy7cqzd.fsf@gmx.de> (Michael Albinus's message of "Fri, 12 Oct 2018 14:02:46 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151239 Archived-At: --=-=-= Content-Type: text/plain Michael Albinus writes: > "Basil L. Contovounesios" writes: > >> I attach a sample program test.el whose central function, test-slave, >> invokes wget asynchronously before waiting for the process to exit. >> >> The issue I'm facing is that running test-slave twice in succession, >> each time in a new thread, causes accept-process-output to hang with no >> output (unless a timeout argument is given, in which case the function >> returns nil) the second time around. > > If you want a process to communicate in a given thread, you must call > `set-process-thread'. See the elisp manual. Thanks, this is the first thing I tried when earlier experiments started to hang. I tried both the following redundant but explicit call: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=test.diff diff -u --label /tmp/test.el --label \#\ /tmp/test.el /tmp/buffer-content-hY0EDf --- /tmp/test.el +++ # @@ -24,6 +24,7 @@ :command '("wget" "-qO-" "https://en.wikipedia.org/wiki/Emacs") :connection-type 'pipe :sentinel #'test-sentinel))) + (set-process-thread proc (current-thread)) (while (eq (process-status proc) 'run) (test-debug proc 'accept-output (accept-process-output proc 5))) (test-debug proc 'exit (process-status proc) (process-exit-status proc)))) Diff finished. Sun Oct 14 16:04:48 2018 --=-=-= Content-Type: text/plain as well as replacing (current-thread) with nil, to unlock the process. Adding test-debug calls before and after accept-process-output revealed nothing out of the ordinary, and explicitly un/locking the process didn't fix the hang. Should I be calling set-process-thread elsewhere? -- Basil --=-=-=--