From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.bugs Subject: bug#33050: 27.0.50; [macOS] Problem with process input with process-connection-type nil Date: Wed, 24 Oct 2018 12:20:31 -0400 Message-ID: References: <83a7n9udxv.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540397790 13953 195.159.176.226 (24 Oct 2018 16:16:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2018 16:16:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33050@debbugs.gnu.org To: Filipp Gunbin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 18:16:26 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 1gFLpY-0003Y5-ST for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2018 18:16:25 +0200 Original-Received: from localhost ([::1]:49323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFLrf-0008UT-75 for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2018 12:18:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFLrN-0008RM-Ss for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:18:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFLqM-0006vD-2I for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:17:19 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36155) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFLq9-0006it-TN for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:17:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gFLq9-0005fe-Jj for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2018 12:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Oct 2018 16:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33050 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33050-submit@debbugs.gnu.org id=B33050.154039776921721 (code B ref 33050); Wed, 24 Oct 2018 16:17:01 +0000 Original-Received: (at 33050) by debbugs.gnu.org; 24 Oct 2018 16:16:09 +0000 Original-Received: from localhost ([127.0.0.1]:40412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFLpI-0005eF-0I for submit@debbugs.gnu.org; Wed, 24 Oct 2018 12:16:09 -0400 Original-Received: from mail-it1-f171.google.com ([209.85.166.171]:40724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFLpF-0005dT-NJ for 33050@debbugs.gnu.org; Wed, 24 Oct 2018 12:16:06 -0400 Original-Received: by mail-it1-f171.google.com with SMTP id i191-v6so7299967iti.5 for <33050@debbugs.gnu.org>; Wed, 24 Oct 2018 09:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fitzsim-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=WpssGnNJhU1e+gdpE1R3JVmei3B1NsTmCCBnC1HQUUE=; b=1AJ/XEZBDhUelqqgpMF9wq7pifFVHtzcoBWfjYVJYQDnMkxMmzC8qSgLppTe9WmwC+ /GX5UqyaEBnpCRWBJjCCGdNQbkqouFIWB6FF9Wbtw6ID//X1DcuudWh8DztDa+F/ZaY9 YXF74tcmuV1T03hgdk8x8TQHyjllZoL0EWwWiOTshszwvPUYALqgXLDfJivQ9AZIBvqD R0cNjNT0XYiM5kuzj25YyaXqZV+eqVhErwlWCEp4x3LNv22jBz1UlGVEQuIOFgLDxSuu 15VGVVaIasD05E1YCFoUpgu/y6rfeAY+qviubeSNugJqxOtuk8A5VnBcGnRTtJAiwrSi dxhw== 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:content-transfer-encoding; bh=WpssGnNJhU1e+gdpE1R3JVmei3B1NsTmCCBnC1HQUUE=; b=PGMERvnmgeVU4lj5CcyrZxaASIFfIOLAIg8zsGIO0geBU82HgRnXzA/XHIzzb4Eb7a prMrcslwCVCSXTE7aLk9uqBkZ3ka4JeDK1GXzCXVUgOAjcYOa4ZNS0//Z4IqzN0bzUZk nzcYfr3JPbL+2njwrbogyRtJk0q/bHhUE/NfAXozxFHVMWQAIZMw3z04+q2f2vv2S1bZ KBdXM08F54QT1UdOB/7iSugTF2VWiv4G3cJvKyVL9Y0Y0xrUc4uagz8DwG8iPU8CPMNQ mQziSkB2CGpT8hIkbgYQjsAcRIGaTc47j1SEOwtJbjf7He7zSk0Rw/MCaeNoENVJGCaQ aleg== X-Gm-Message-State: AGRZ1gIBnKcGRIB85D+1DnTspuGy86JDxltaypihEclHRyMZ1jzN5G9t xjQ3yiF9/b5IYNRf+5G84FZRPG/KRaI= X-Google-Smtp-Source: AJdET5eHXgdPB/UdpyfDy/Bp8vauwzUCoJsMeg1mkqB6mpY8fcS21v9m/ot1g74WntH9FzTXH7U1ng== X-Received: by 2002:a02:9609:: with SMTP id c9-v6mr2291118jai.118.1540397759678; Wed, 24 Oct 2018 09:15:59 -0700 (PDT) Original-Received: from localhost.localdomain (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id p8-v6sm1777387iog.60.2018.10.24.09.15.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 09:15:58 -0700 (PDT) In-Reply-To: (Filipp Gunbin's message of "Wed, 24 Oct 2018 17:05:39 +0300") 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:151555 Archived-At: Filipp Gunbin writes: > This may be the clue to the problem: > > man termios(4): > > If a process is in the foreground process group of its controlling ter= mi- > nal, read operations are allowed. Any attempts by a process in a back- > ground process group to read from its controlling terminal causes a > SIGTTIN signal to be sent to the process's group unless one of the fol- > lowing special cases apply: If the reading process is ignoring or blo= ck- > ing the SIGTTIN signal, or if the process group of the reading process= is > orphaned, the read(2) returns -1 with errno set to EIO and no signal is > sent. The default action of the SIGTTIN signal is to stop the process= to > which it is sent. > > I output the process-attributes of the started process, and note tpgid > (ID of foreground process group on the process=E2=80=99s tty) and tty: > > - p-c-t t > > attrs=3D((etime 0 0 7080 0) (start 23504 29912 167367 0) (nice . 0) > (tpgid . 16419) (tty . ttys001) (pgrp . 16419) (ppid . 98669) (state > . R) (comm . ldapsearch) (group . staff) (egid . 20) (user . fgunbin) > (euid . 501)) > > ldapsearch's pgrp=3D16419, it is using ttys001 for r/w, and it's in > foreground process group on that tty (tpgid . 16419) > > - p-c-t nil > > attrs=3D((etime 0 0 6177 0) (start 23504 29897 662718 0) (nice . 0) > (tpgid . 98669) (tty . ttys000) (pgrp . 16416) (ppid . 98669) (state > . R) (comm . ldapsearch) (group . staff) (egid . 20) (user . fgunbin) > (euid . 501)) > > ldapsearch's pgrp=3D16416, it is using ttys000 for r/w (??), and it is > NOT in foreground process group on that tty - (tpgid . 98669). 98669 > is emacs, and emacs is in foreground - this is ok. > > So the question is - why the process in the second case thinks that it > has a tty? When it tries to use it, it receives SIGTTIN and is stopped, > as termios man page says. My test case with p-c-t nil results in the > processed being stopped, indeed. Try the test case again but with the command "/usr/bin/tty" (with no arguments). For me (GNU/Linux, x86_64): - p-c-t t /dev/pts/51 Process my-process<4> finished - p-c-t nil not a tty Process my-process<4> exited abnormally with code 1 (Meanwhile the test case hangs looking for the expected string until I Ctrl-g it.) Thomas