RFR: JDK-8310265: (process) jspawnhelper should not use argv[0] [v2]

Roger Riggs rriggs at openjdk.org
Tue Jun 20 16:30:23 UTC 2023


On Tue, 20 Jun 2023 15:08:13 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/java.base/unix/native/jspawnhelper/jspawnhelper.c line 139:
>> 
>>> 137:     ChildStuff c;
>>> 138:     struct stat buf;
>>> 139:     /* argv[1] contains the fd number to read all the child info */
>> 
>> I would prefer to also fix the use of `argc-1` below to match.  Its a pretty odd form and might trip someone later.
>
> I wondered about this, it looked so deliberate. So I wondered whether jspawnhelper is used outside of the posix_spawn context, but cannot find anything. Maybe historic?

I'm not aware of any other uses either; its not intended to be used outside of ProcessImpl especially since the addition of the new protocol to communicate parameters and confirm launching of the child.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14531#discussion_r1235515103


More information about the core-libs-dev mailing list