JDK-8288483 : JAVA_TOOL_OPTIONS are silently truncated if they exceed 1024 bytes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: openjdk8u
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2022-06-15
  • Updated: 2023-07-25
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
The JAVA_TOOL_OPTIONS environment variable is used to pass additional JVM arguments.

The current implementation has an internal limit on the length of the option variable (1024 bytes) and the number of options (64). 

A longer variable will be silently truncated and options will be lost or the VM will exist with an unrecognized option error. 

Such limits are not set in the specification: https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#tooloptions

It's partial backport of relevant changes from JDK-8135195, JDK-8074895, JDK-8061999
Comments
[~dsamersoff] This has been fixed in Oracle JDK 8u351.
19-07-2023

Latest jdk8u-dev still has the problem. Please, check attached testcase.
15-02-2023

This is already fixed in 8u351 with the backport of JDK-8061999.
10-02-2023

Any updates on this issue?
06-09-2022

Any updates on this issue? Could we move forward with it?
13-07-2022

The changes are in *hotspot/src/share/vm/runtime/arguments.cpp* so I think, that hotspot/runtime is the best placement.
22-06-2022

The changes is not risky because the final code is very close to one working in jdk11 and later. Testing done: jtreg:hotspot/runtime and jck:runtime/vm
20-06-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/74 Date: 2022-06-15 17:34:51 +0000
15-06-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/72 Date: 2022-06-15 14:31:29 +0000
15-06-2022