GNU bug report logs - #33050
27.0.50; [macOS] Problem with process input with process-connection-type nil

Previous Next

Package: emacs;

Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>

Date: Mon, 15 Oct 2018 19:04:02 UTC

Severity: normal

Found in version 27.0.50

Done: Filipp Gunbin <fgunbin <at> fastmail.fm>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 33050 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 33050 <at> debbugs.gnu.org
Subject: Re: bug#33050: 27.0.50;
 [macOS] Problem with process input with process-connection-type nil
Date: Thu, 25 Oct 2018 18:51:17 +0300
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




This bug report was last modified 6 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.