PING: RFR(s): (new approach) 8223777: In posix_spawn mode, failing to exec() jspawnhelper does not result in an error

Roger Riggs Roger.Riggs at oracle.com
Tue Jun 4 19:14:03 UTC 2019


Hi Thomas,

If the argument is not an .exe, then it may be a command shell script  
(.sh, etc.)
Only the system knows it is not an exe (errno == ENOEXEC), so it then 
passes it as
the first argument to /bin/sh that will handle the shell files.

And yes, count me as a Reviewer and reviewed.

Roger

On 06/04/2019 12:14 PM, Thomas Stüfe wrote:

> On Tue, Jun 4, 2019 at 5:09 PM Roger Riggs <Roger.Riggs at oracle.com 
> <mailto:Roger.Riggs at oracle.com>> wrote:
>
...
>
> Then I ran an strace over it and saw this:
>
> 5332 [pid  3911] execve("./sleep2", ["./sleep2"], [/* 78 vars */] 
> <unfinished ...>                 ..
> 5342 [pid  3911] <... execve resumed> )      = -1 ENOEXEC (Exec format 
> error)
> 5343 [pid  3911] execve("/bin/sh", ["/bin/sh", "./sleep2"], [/* 78 
> vars */] <unfinished ...>
> 5347 [pid  3911] <... execve resumed> )      = 0
>
> So, if the first exec fails for whatever reason, we try again, passing 
> the executable file name as argument to the system shell. This does 
> not feel right? Do you know why we do this?
>
>
>     Thanks, Roger
>
>
> Thank you Roger. Can I consider the patch to be reviewed by you?
> ..Thomas
>



More information about the core-libs-dev mailing list