unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: Filipp Gunbin <fgunbin@fastmail.fm>
Cc: 33050@debbugs.gnu.org
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	[thread overview]
Message-ID: <m34ldbgvu8.fsf@fitzsim.org> (raw)
In-Reply-To: <m2a7n3bft8.fsf@fgunbin.playteam.ru> (Filipp Gunbin's message of "Wed, 24 Oct 2018 17:05:39 +0300")

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> This may be the clue to the problem:
>
> man termios(4):
>
>    If a process is in the foreground process group of its controlling termi-
>    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 block-
>    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’s tty) and tty:
>
> - p-c-t t
>
>   attrs=((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=16419, it is using ttys001 for r/w, and it's in
>  foreground process group on that tty (tpgid . 16419)
>
> - p-c-t nil
>
>   attrs=((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=16416, 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





  reply	other threads:[~2018-10-24 16:20 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 19:03 bug#33050: 27.0.50; [macOS] Problem with process input with process-connection-type nil Filipp Gunbin
2018-10-20 10:09 ` Eli Zaretskii
2018-10-22 15:35   ` Filipp Gunbin
2018-10-23  1:53     ` Thomas Fitzsimmons
2018-10-23 22:41       ` Filipp Gunbin
2018-10-24  1:55         ` Thomas Fitzsimmons
2018-10-24 13:13           ` Filipp Gunbin
2018-10-24 14:05           ` Filipp Gunbin
2018-10-24 16:20             ` Thomas Fitzsimmons [this message]
2018-10-24 19:33               ` Filipp Gunbin
2018-10-24 19:46               ` Filipp Gunbin
2018-10-24 22:07                 ` Thomas Fitzsimmons
2018-10-25 15:51                   ` Filipp Gunbin
2018-10-25 16:24                     ` Eli Zaretskii
2018-10-25 17:10                       ` Filipp Gunbin
2018-10-25 17:29                         ` Eli Zaretskii
2018-10-25 18:10                           ` Filipp Gunbin
2018-10-25 18:20                             ` Eli Zaretskii
2018-10-25 19:36                               ` Filipp Gunbin
2018-10-25 19:40                                 ` Eli Zaretskii
2018-10-25 20:47                                   ` Filipp Gunbin
2018-10-26  6:29                                     ` Eli Zaretskii
2018-10-26  1:41                           ` Thomas Fitzsimmons
2018-10-26  7:00                             ` Eli Zaretskii
2018-10-26 15:41                               ` Thomas Fitzsimmons
2018-10-26 17:20                                 ` Eli Zaretskii
2018-10-27 10:20                                   ` Eli Zaretskii
2018-10-27 13:42                                     ` Thomas Fitzsimmons
2018-10-27 14:53                                       ` Eli Zaretskii
2018-10-27 16:53                                         ` Thomas Fitzsimmons
2018-10-27 18:49                                           ` Eli Zaretskii
2018-10-26 23:12                                 ` Filipp Gunbin
2018-10-27  2:09                                   ` Thomas Fitzsimmons
2018-10-27 14:52                                     ` Filipp Gunbin
2018-10-30  0:49                                       ` Thomas Fitzsimmons
2018-10-30 19:11                                         ` Filipp Gunbin
2018-11-28 23:09                                     ` Filipp Gunbin
2018-11-29  7:21                                       ` Eli Zaretskii
2018-11-29  8:46                                         ` Filipp Gunbin
2018-11-29  9:19                                           ` Eli Zaretskii
2018-11-29  9:51                                             ` Filipp Gunbin
2018-11-29 10:41                                               ` Eli Zaretskii
2018-11-29 14:09                                                 ` Filipp Gunbin
2018-12-03 14:17                                                   ` Thomas Fitzsimmons
2018-12-04 12:37                                                     ` Filipp Gunbin
2018-12-22 15:05                                                       ` Thomas Fitzsimmons
2018-10-27  6:59                                   ` Eli Zaretskii
2018-10-27 14:37                                     ` Filipp Gunbin
2018-10-27 20:28                             ` Charles A. Roelli
2018-10-28 16:00                               ` Eli Zaretskii
2018-10-28 19:53                                 ` Charles A. Roelli
2018-10-25 16:41                     ` Filipp Gunbin

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m34ldbgvu8.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=33050@debbugs.gnu.org \
    --cc=fgunbin@fastmail.fm \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).