all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: davor.cubranic@alumni.cs.ubc.ca, 21972@debbugs.gnu.org
Subject: bug#21972: 24.5; Running 'bash -i -c' via shell-command hangs on FreeBSD
Date: Mon, 14 Oct 2019 23:09:28 +0300	[thread overview]
Message-ID: <837e57hyx3.fsf@gnu.org> (raw)
In-Reply-To: <CADwFkmmd7DNZd-Sne81TGqvYwmNvjhXhVAfF_h8gUppwXyv4mg@mail.gmail.com> (message from Stefan Kangas on Mon, 14 Oct 2019 21:55:22 +0200)

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 14 Oct 2019 21:55:22 +0200
> Cc: 21972@debbugs.gnu.org
> 
> Davor Cubranic <davor.cubranic@alumni.cs.ubc.ca> 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?





  reply	other threads:[~2019-10-14 20:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 14:20 bug#21972: 24.5; Running 'bash -i -c' via shell-command hangs on FreeBSD Davor Cubranic
2019-10-14 19:55 ` Stefan Kangas
2019-10-14 20:09   ` Eli Zaretskii [this message]
2019-10-14 20:50     ` Stefan Kangas
2019-10-17  4:47       ` Davor Cubranic
2019-10-17 11:36         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837e57hyx3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21972@debbugs.gnu.org \
    --cc=davor.cubranic@alumni.cs.ubc.ca \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.