GNU bug report logs - #33154
27.0.50; create_process on Darwin should not invoke setsid() after vfork() [PATCH]

Previous Next

Package: emacs;

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

Date: Thu, 25 Oct 2018 19:31:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: Alan Third <alan <at> idiocy.org>, 33154 <at> debbugs.gnu.org
Subject: bug#33154: 27.0.50; create_process on Darwin should not invoke setsid() after vfork() [PATCH]
Date: Tue, 6 Nov 2018 23:41:46 -0800
[Message part 1 (text/plain, inline)]
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.
[0001-Dissociate-controlling-tty-better-on-Darwin.patch (text/x-patch, attachment)]

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

Previous Next


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