GNU bug report logs -
#8846
coreutils-8.12 on HP-UX 11.31: 3 of 365 tests failed
Previous Next
Reported by: Bruno Haible <bruno <at> clisp.org>
Date: Mon, 13 Jun 2011 09:17:01 UTC
Severity: normal
Tags: moreinfo
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 06/13/2011 03:39 PM, Stefano Lattarini wrote:
>
> [3] The $(SHELL), which here we assume is ksh with close-on-exec, does a
> fork+exec to execute the test script; thus, when that script begins
> its execution, it has the fd 9 closed (d'oh!, but expected now);
Oddly enough, it looks like it is _only_ 'exec 9>&2' that suffers from
close-on-exec semantics; using '(blah) 9>&2' leaves fd 9 inheritable.
So maybe the real fix is to do the redirection to a subshell or grouping
{} rather than via exec, at which point even ksh and HP-UX sh will allow
the original stderr to be inherited as fd 9 to the child script process:
$ printf '#!/bin/sh\nexec >&9\n' > k
$ sh k
k[2]: 9: Generated or received a file descriptor number that is not valid.
$ sh k 9>&2
$ sh -c 'exec 9>&2; /bin/sh k'
k[2]: 9: Generated or received a file descriptor number that is not valid.
$ sh -c 'sh k 9>&2'
$ sh -c '(sh k) 9>&2'
$ sh -c '{ sh k;} 9>&2'
$
but I don't know if that will require some changes in automake's
parallel-test driver setup code.
And Autoconf should probably document that the close-on-exec semantics
of some shells applies only to the exec builtin, since they do not
happen to other redirections.
--
Eric Blake eblake <at> redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 13 years and 347 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.