From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.bugs Subject: bug#33050: 27.0.50; [macOS] Problem with process input with process-connection-type nil Date: Thu, 25 Oct 2018 18:51:17 +0300 Message-ID: References: <83a7n9udxv.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540483400 22414 195.159.176.226 (25 Oct 2018 16:03:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 Oct 2018 16:03:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (darwin) Cc: 33050@debbugs.gnu.org To: Thomas Fitzsimmons Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 25 18:03:16 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 1gFi6N-0005kC-U5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2018 18:03:16 +0200 Original-Received: from localhost ([::1]:55396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFi8U-0002Dr-DY for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2018 12:05:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFhvZ-0007LC-UO for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 11:52:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFhvW-0007Yd-10 for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 11:52:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38411) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFhvV-0007Wm-RV for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 11:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gFhvV-0004Bh-Ir for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 11:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Oct 2018 15:52: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.154048268716040 (code B ref 33050); Thu, 25 Oct 2018 15:52:01 +0000 Original-Received: (at 33050) by debbugs.gnu.org; 25 Oct 2018 15:51:27 +0000 Original-Received: from localhost ([127.0.0.1]:42666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFhuv-0004Ac-Im for submit@debbugs.gnu.org; Thu, 25 Oct 2018 11:51:26 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:40101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFhut-0004AU-Ge for 33050@debbugs.gnu.org; Thu, 25 Oct 2018 11:51:23 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 44BE2EAE; Thu, 25 Oct 2018 11:51:22 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 25 Oct 2018 11:51:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm1; bh=yGoTzyy0+Ds2V4VE0HbZx/MJdl mFFuuf5wR0zzTDzu0=; b=wlwr6ros3NE1M9JyXrmWlFOOVDxXQJqfULAp2IIX6C 5zGHYBiUlraUEOXelttzPj815QtO4MJszN1XW/EUaNFjk5fU5yj80QaY/C6c+XsI F7DFvWaY1d/LEwTo1gSVNftmRLnbtSz4IJbG93QBm9AEj6Y+noe3ofIvi9HmSMj7 F0wUdTU7JSNlYwbS8L4i2eCHWAaLM91oN2lef+BFmEm6kyiJHv5yZpPOK9mdDb8/ vy8uW1UTURqvAUMHB45jPFN4T3MoFsm0owsLTRO3eS16FQQcC3E9xIJiHOnTzHcp bWe7rAeJqr5cflIIWdonUp+TodzjgoaqbghtPrpf0i5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=yGoTzy y0+Ds2V4VE0HbZx/MJdlmFFuuf5wR0zzTDzu0=; b=q2aEYxM+dPqaC2Mng11EVc wuqS8tSruNRDrzmPsyJTGfHQTKfG991SecTWwjDbI9QyrbGbXcRrdG3eUi2F8A44 iLyk8/nv809H1M9+4Y8u69Yrbf9vdUWctnuYSEWmjp09/TShyUKip71PT/2SZDsF 8quz+jKOEQK/dtSBce9pry/ecY9cm5XHY/rkq8i9ZlOVZA1wHqNWEa3lBqruznYe vukX1znXSGKrH3u4vyEu0We9Jec4WVMl0wbvSx0SoQto1fJQfpV/DiEZwirFLO7r djbcJOZFg8YWUlrQSEttTw450u6Zjm0ciCIQUenMmfQe++E5TCgyfBiScCW6zrcw == X-ME-Sender: X-ME-Proxy: Original-Received: from fgunbin.playteam.ru (unknown [95.161.147.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B90EE47C6; Thu, 25 Oct 2018 11:51:20 -0400 (EDT) In-Reply-To: (Thomas Fitzsimmons's message of "Wed, 24 Oct 2018 18:07:08 -0400") 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:151600 Archived-At: On 24/10/2018 18:07 -0400, Thomas Fitzsimmons wrote: > Hi Filipp, > [...] > However, ttname's value on my system does correspond to the > process-connection-type setting. Yes, so in your case child process doesn't have controlling terminal, while in my case it does. process.c Line 2069: #ifdef DARWIN_OS /* Darwin doesn't let us run setsid after a vfork, so use fork when necessary. Also, reset SIGCHLD handling after a vfork, as apparently macOS can mistakenly deliver SIGCHLD to the child. */ if (pty_flag) pid = fork (); else { pid = vfork (); if (pid == 0) signal (SIGCHLD, SIG_DFL); } #else pid = vfork (); #endif With process-connection-type nil, we call vfork() and then setsid() apparently fails (at least to reset child's controlling terminal). I tried to change the above to just use fork(), and got the correct behavior. If only I knew how to fix this correctly, without reverting to fork() :-) Does anyone have ideas? I'll try to look into this further myself, and will write back. Filipp