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 21:10:25 +0300 Message-ID: References: <83a7n9udxv.fsf@gnu.org> <83ftwuq9ii.fsf@gnu.org> <83a7n2q6jb.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540491331 23228 195.159.176.226 (25 Oct 2018 18:15:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 Oct 2018 18:15:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (darwin) Cc: 33050@debbugs.gnu.org, fitzsim@fitzsim.org, alan@idiocy.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 25 20:15:27 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 1gFkAG-0005vd-VJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2018 20:15:25 +0200 Original-Received: from localhost ([::1]:56409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFkCN-0004vP-DI for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2018 14:17:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFk6F-0007D5-RD for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 14:11:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFk6B-0003xV-Fe for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 14:11:15 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38543) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFk62-0003sU-Fv for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 14:11:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gFk62-0003Jz-7R for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2018 14:11:02 -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 18:11:02 +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.154049103312725 (code B ref 33050); Thu, 25 Oct 2018 18:11:02 +0000 Original-Received: (at 33050) by debbugs.gnu.org; 25 Oct 2018 18:10:33 +0000 Original-Received: from localhost ([127.0.0.1]:42801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFk5Y-0003JB-Cb for submit@debbugs.gnu.org; Thu, 25 Oct 2018 14:10:32 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:47145) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFk5W-0003J1-7P for 33050@debbugs.gnu.org; Thu, 25 Oct 2018 14:10:30 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1C245D61; Thu, 25 Oct 2018 14:10:29 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Oct 2018 14:10:29 -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=TsmwRpRGlfpllHSAQaxlncWwE/ HVHpJS72Io2QGCZ5E=; b=SB/wxat8iqjs6eta6QU7AcWDX6W2MFaSmv4Hd4Vb6z L1SGN5TSg5XHnhW7m7/f8IZB5Stp7DMFVL2ookAMBX9sRoEFErhvf7Cuvdem3RwW PpCqDsGdi0dDcNRtXFtzn/oaJmHCVQE3xTz5ZzUYQwbba8mTOvjld9eEz3cHj4Vc QbWev8GKohAqVoh5U4vMbeCsAGYsDf/btIUpmRkUMwEoLrzK6vecjhATZav4LgWh 6AlmF6akay1P26NwpWEp1/op1HDeUgrwsqropTUM9RAg+pRaB/Y0efDXjxStTy3k feLivsHe9qNonl4eeltnkqUas8kx650FxQ1HAjFMsw2w== 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=TsmwRp RGlfpllHSAQaxlncWwE/HVHpJS72Io2QGCZ5E=; b=PvoJM2YrO1Grm8GPHU+Wt9 CXdmMVIMBDZ5DNDpG0YFmmwMI9fT+WLD+ZjzxlBoL9SbZjqMHmssb8utfXwQmUo5 1vXmzrgpJntw1rzInWOcov5JbAH7KIs26GPpq8pcG6tkOyhbohQRarSWqilXPvpx xzw/pGINrQzfNd9mvuFFIy03WcXb/Dez4Z2NSXMCOeESaNfcMOfeUcLCcJE0ueN0 RIHueCt3IaXCrsGjKFrXuG8925Eq+5gWfvNAZTeO3mSgFz4afeipniQC1vxiMssU M3Jegae2K8M4upw3o0TW+j1A7ZvWTNDO536zsbBY92uwhr+vccK+Rnq+cUoSOJIA == 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 3F269102F3; Thu, 25 Oct 2018 14:10:27 -0400 (EDT) In-Reply-To: <83a7n2q6jb.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Oct 2018 20:29:12 +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:151610 Archived-At: On 25/10/2018 20:29 +0300, Eli Zaretskii wrote: >> From: Filipp Gunbin >> Cc: fitzsim@fitzsim.org, 33050@debbugs.gnu.org, alan@idiocy.org >> Date: Thu, 25 Oct 2018 20:10:06 +0300 >> >> > I'm probably missing something: why are you still trying to find a >> > solution, when one was already found? What's wrong with setting >> > process-connection-type non-nil in this case, at least for Darwin? >> >> Yes, setting p-c-t to t worked from the start, but it's just a >> workaround - there's still problem with p-c-t nil. >> >> I'm currently running with this patch, which is based on Alan's fix in >> callproc.c (call_process() had the same problem on Darwin). > > I don't understand why: using nil process-connection-type for programs > that prompt the user is a bug anyway. I think these are separate problems. Here's my explanation of this problem on Darwin: Some time ago, setsid() was called only if (pty_flag). Alan's commit a13eaddce2ddbe3ba0b7f4c81715bc0fcdba99f6 (fixes bug 26397) changes vfork() to fork() for this case - so we never call setsid() after vfork(). Then Paul's commit 5c91ca8f30098cb2593ca375daa82d25aef03ad7 (fixes bug 30762) changes setsid() to be invoked always. So it again became possible that we call setsid() after vfork(), and this I believe is the root case of the current problem. My patch tries to fix that. I don't think it matters here whether we call ldapsearch with correct value of p-c-t or not, it just the case which was missed. And vfork() should perform better than fork(), so it looks like an improvement. Filipp