unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 33154@debbugs.gnu.org, Filipp Gunbin <fgunbin@fastmail.fm>
Subject: bug#33154: 27.0.50; create_process on Darwin should not invoke setsid() after vfork() [PATCH]
Date: Fri, 9 Nov 2018 00:07:41 +0000	[thread overview]
Message-ID: <20181109000741.GA15142@breton.holly.idiocy.org> (raw)
In-Reply-To: <fc9123bf-e9fb-fa89-73a5-a79db13372f9@cs.ucla.edu>

On Tue, Nov 06, 2018 at 11:41:46PM -0800, Paul Eggert wrote:
> Filipp Gunbin wrote:
> > In your patch, we don't detach from current (Emacs's) controlling
> > terminal before doing TIOCSCTTY.
> 
> Ah, OK. I see also that vfork won't work on Darwin if pty mode is used,
> since Emacs wants to create a new session and Darwin setsid always fails in
> a vforked child that has not yet execed.
> 
> However, your patch introduces another duplicate of the open/TIOCNOTTY/close
> fallback code, making three duplicates in all. How about if we coalesce
> these duplicates into a function and then call that function? Also, I think
> we can call the function from just two places (not three). Furthermore, I
> think it'd be more robust if Emacs does setsid everywhere (with a fallback
> to open/TIOCNOTTY/close everywhere TIOCNOTTY is available), not just Darwin.
> Proposed patch (against master) attached.

I only have two tests I know of to try here and they both pass with
this patch:

1. M‐x shell RET bg REST

doesn’t report that there’s no job control.

2. (benchmark 1 '(call-process "/usr/bin/true" nil nil nil))

Returns times in the order of 3ms, which is what we’d expect to see.

I’m not even sure if they’re really relevant, tbh. Is there anything
else I should try?
-- 
Alan Third





  parent reply	other threads:[~2018-11-09  0:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 19:30 bug#33154: 27.0.50; create_process on Darwin should not invoke setsid() after vfork() [PATCH] Filipp Gunbin
2018-10-26 11:12 ` Alan Third
2018-11-07  1:35   ` Filipp Gunbin
2018-11-05 17:28 ` Paul Eggert
2018-11-06 13:46   ` Filipp Gunbin
2018-11-07  1:23   ` Filipp Gunbin
2018-11-07  7:41     ` Paul Eggert
2018-11-07  8:53       ` Filipp Gunbin
2018-11-07 15:40         ` Paul Eggert
2018-11-09  0:07       ` Alan Third [this message]
2018-11-09 10:29         ` Filipp Gunbin
2018-11-09 11:16           ` Andreas Schwab
2018-11-10 15:24             ` Filipp Gunbin
2018-11-10 17:09               ` Paul Eggert
2018-11-11 17:14                 ` Filipp Gunbin
2018-11-10 17:05         ` Paul Eggert

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=20181109000741.GA15142@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=33154@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --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).