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

Thomas Stüfe thomas.stuefe at gmail.com
Tue Jun 4 19:40:13 UTC 2019


Thank you for clarifying, and for the review.

Cheers, Thomas

On Tue, Jun 4, 2019 at 9:14 PM Roger Riggs <Roger.Riggs at oracle.com> wrote:

> 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> 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