RFR: JDK-8310265: (process) jspawnhelper should not use argv[0] [v2]
Roger Riggs
rriggs at openjdk.org
Tue Jun 20 15:03:18 UTC 2023
On Mon, 19 Jun 2023 06:07:26 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Reported by [jarabekit at gmail.com](mailto:jarabekit at gmail.com) [1]
>>
>> jspawnhelper uses argv[0] to receive the fd string from the parent. That breaks with conventions and trips over certain tools like binfmt_misc.
>>
>> For details, see linked ML discussion.
>>
>> [1] https://mail.openjdk.org/pipermail/core-libs-dev/2023-June/107738.html
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>
> correct comment
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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14531#discussion_r1235403720
More information about the core-libs-dev
mailing list