From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21972: 24.5; Running 'bash -i -c' via shell-command hangs on FreeBSD Date: Mon, 14 Oct 2019 23:09:28 +0300 Message-ID: <837e57hyx3.fsf@gnu.org> References: <86twof1ljp.fsf@telus.net> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="156192"; mail-complaints-to="usenet@blaine.gmane.org" Cc: davor.cubranic@alumni.cs.ubc.ca, 21972@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 14 22:10:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iK6fU-000eWw-0e for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2019 22:10:12 +0200 Original-Received: from localhost ([::1]:57222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iK6fS-0000U7-MS for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2019 16:10:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49399) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iK6fL-0000RN-65 for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 16:10:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iK6fK-0004n4-4D for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 16:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32998) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iK6fK-0004mw-0k for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 16:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iK6fJ-0001cl-OP for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2019 16:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Oct 2019 20:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21972 X-GNU-PR-Package: emacs Original-Received: via spool by 21972-submit@debbugs.gnu.org id=B21972.15710837846196 (code B ref 21972); Mon, 14 Oct 2019 20:10:01 +0000 Original-Received: (at 21972) by debbugs.gnu.org; 14 Oct 2019 20:09:44 +0000 Original-Received: from localhost ([127.0.0.1]:41816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iK6f1-0001bs-Su for submit@debbugs.gnu.org; Mon, 14 Oct 2019 16:09:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iK6ex-0001bZ-LM for 21972@debbugs.gnu.org; Mon, 14 Oct 2019 16:09:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iK6es-0004bF-2B; Mon, 14 Oct 2019 16:09:34 -0400 Original-Received: from [176.228.60.248] (port=4128 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iK6er-0001me-Go; Mon, 14 Oct 2019 16:09:33 -0400 In-reply-to: (message from Stefan Kangas on Mon, 14 Oct 2019 21:55:22 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 209.51.188.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:169303 Archived-At: > From: Stefan Kangas > Date: Mon, 14 Oct 2019 21:55:22 +0200 > Cc: 21972@debbugs.gnu.org > > Davor Cubranic writes: > > > On FreeBSD, running: > > > > M-x shell-command > > /usr/local/bin/bash -i -c "echo hello" > > On GNU/Linux, the above gives me: > > bash: cannot set terminal process group (-1): Inappropriate ioctl for device > bash: no job control in this shell > hello > > > hangs until you press C-g (twice). I can see the bash process running at > > 100% via `top` until C-g kills it. > > > > Adding `--norc --noprofile` to the command still hangs, so it's not > > anything about the shell initialization files. The `-i` option is the > > key: without it, everything works fine. > > > > Running the same command via `async-shell-command` does not hang: Bash > > outputs "hello" in the "*Async Shell Command*" buffer and exits. > > > > Both Emacs and Bash are standard FreeBSD 10 binary packages installed > > via `pkg`. (emacs24-24.5_1,3 and bash-4.3.42, respectively). > > If bash hangs, shouldn't that be reported as a bug in bash instead? It's possible that your Bash is newer, and this bug was fixed since then. In general, it sounds like Bash tries to read from its stdin, and in call-process that is... what? By contrast, by default we communicate with async subprocess via PTYs (on Posix hosts), which is what Bash expects in an interactive session. IOW, I cannot understand why would someone call "bash -i" in a non-interactive command. > Or should Emacs somehow do better with a hanging process? Like what?