Kyle Evans <kev...@freebsd.org> added the comment:

> * On FreeBSD, if setting posix_spawn() "attributes" or execute posix_spawn() 
> "file actions" fails, posix_spawn() succeed but the child process exits 
> immediately with exit code 127 without trying to call execv(). If execv() 
> fails, posix_spawn() succeed, but the child process exit with exit code 127.

Hi,

As a disclaimer, I'm a FreeBSD developer interested in making sure we're doing 
the right thing here. =)

May I ask what the above assessment is based on, and specifically what we need 
to address?

As far as I can tell, our implementation is as POSIX describes -- errors 
processing the file actions or attrs triggers a 127 exit [1][2] which get 
bubbled up via the return value to posix_spawn [3]. exec failures capture errno 
at [4] and bubble the error up to the return value of posix_spawn as well via 
[3]. POSIX explicitly does not require an implementation to use errno for this, 
only return values, and we seem to have gone the route of not using errno to 
match OpenSolaris behavior.

What do I need to do to reproduce the results for deriving the results seen in 
the above quote, so that I can fix us and we can also see this improvement?

I threw together a minimal C reproducer for posix-spawn on -current (this 
particular bit being unchanged since FreeBSD 11.x times) and was returned 
ENOENT for a bad exec and otherwise given a pid for successful exec with a 
return of 0.

[1] 
https://svnweb.freebsd.org/base/head/lib/libc/gen/posix_spawn.c?view=markup#l214
[2] 
https://svnweb.freebsd.org/base/head/lib/libc/gen/posix_spawn.c?view=markup#l219
[3] 
https://svnweb.freebsd.org/base/head/lib/libc/gen/posix_spawn.c?view=markup#l232
[4] 
https://svnweb.freebsd.org/base/head/lib/libc/gen/posix_spawn.c?view=markup#l225

----------
nosy: +kevans

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35537>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to