+++ This bug was initially created as a clone of Bug #1217236 +++
To test, either have ksh as login shell, or create a test user.
Then ssh localhost.
$ cd /tmp/alan
$ cat tst.ksh
echo $D > /tmp/alan/tst.dat
$ (ksh /tmp/alan/tst.ksh &)
This happens due to a double fork, once for "( cmd )" and
then the first fork forks again due to the "&", but, just
when the child branches, it receives a SIGHUP and
I tested a quick&dirty patch, that basically reverts to
rhel5 ksh behavior, and there are no regressions in the
diff -up ksh-20120801/src/cmd/ksh93/sh/xec.c.orig ksh-20120801/src/cmd/ksh93/sh/xec.c
--- ksh-20120801/src/cmd/ksh93/sh/xec.c.orig 2015-04-28 16:55:25.521818636 -0300
+++ ksh-20120801/src/cmd/ksh93/sh/xec.c 2015-04-28 16:56:34.037753565 -0300
@@ -2059,16 +2059,20 @@ int sh_exec(register const Shnode_t *t,
else if(((type=t->par.partre->tre.tretyp)&FAMP) && ((type&COMMSK)==TFORK))
I also asked upstream, see http://lists.research.att.com/pipermail/ast-users/2015q2/004754.html
but actually, there is a bad comment there, about crashes if
running it as "( cmd ) &". Likely it was due to the way I was
Note that if one has bash as login shell, then starts, or exec
ksh, or even if has ksh as login shell, and first exec ksh,
it will work, because then SIGHUP will be blocked in the
"orphan" process (orphan due to double fork).
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.