JDK-8310265 : (process) jspawnhelper should not use argv[0]
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 17,21,22
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2023-06-17
  • Updated: 2024-02-27
  • Resolved: 2023-06-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 22
11.0.22Fixed 17.0.10Fixed 21Fixed 22 b03Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Reported by jarabekit@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
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2255 Date: 2023-11-06 15:59:38 +0000
06-11-2023

[jdk11u-fix-request] Approval Request from Ludovic Henry That fix is required for Java to launch new processes when running inside QEMU user space emulation. It is a requirement for some platforms (like riscv or s390x) as hardware or VMs are not largely available, and QEMU is the only available solutions on many CIs. The approach has been in JDK 21 and later for some time, and it's been validated to work. The risk is also minimal since the patch only makes sure to follow the specification for posix_spawn and execve, which we didn't follow before. The backport wasn't clean, but the conflicts are minimal and the logic straightforward.
06-11-2023

[jdk17u-fix-request] Approval Request from Ludovic Henry That fix is required for Java to launch new processes when running inside QEMU user space emulation. It is a requirement for some platforms (like riscv or s390x) as hardware or VMs are not largely available, and QEMU is the only available solutions on many CIs. The approach has been in JDK 21 and later for some time, and it's been validated to work. The risk is also minimal since the patch only makes sure to follow the specification for posix_spawn and execve, which we didn't follow before. The backport wasn't clean, but the conflicts are minimal and the logic straightforward.
01-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1922 Date: 2023-10-26 11:36:51 +0000
26-10-2023

[jdk17u-critical-request] Approval Request from Ludovic Henry
25-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u/pull/384 Date: 2023-10-25 07:14:17 +0000
25-10-2023

Hi [~luhenry], yes, this change is good for backporting. Feel free to do so. Lable again if the PR is ready, i.e. tested and reviewed if needed. Thanks.
23-10-2023

Could we please also backport that change to JDK 17 and 11 as well? Running under qemu user emulation is particularly important for RISC-V, and we are backporting RISC-V support to 11 and 17. Thanks!
23-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21/pull/103 Date: 2023-07-06 19:42:08 +0000
07-07-2023

Changeset: 47d00a4c Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2023-06-21 04:55:43 +0000 URL: https://git.openjdk.org/jdk/commit/47d00a4cbeff5d757dda9c660dfd2385c02a57d7
21-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14531 Date: 2023-06-17 18:24:54 +0000
17-06-2023