JDK-8346476 : Thread/TestAlwaysPreTouchStacks fails when run with specific JVM options
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24,25
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-12-18
  • Updated: 2025-06-24
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 26
26Unresolved
Related Reports
Relates :  
Description
This test failed during verification run of     
JDK-8324781: runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved

------------------
Build: jdk-24+27
Platforms: linux-x64, linux-aarch64
CLI Options: -XX:+UnlockDiagnosticVMOptions -Xmx100M -XX:+AlwaysPreTouchStacks -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics
Test: runtime/Thread/TestAlwaysPreTouchStacks.java
Failure: Expected a higher amount of committed with pretouch stacksPreTouch amount: 142077952NoPreTouch amount: 225972224

----------- More details:
java.lang.RuntimeException: Expected a higher amount of committed with pretouch stacksPreTouch amount: 142077952NoPreTouch amount: 225972224
at TestAlwaysPreTouchStacks.main(TestAlwaysPreTouchStacks.java:173)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
at java.base/java.lang.Thread.run(Thread.java:1447) 
Comments
This test fails when executed with above mentioned JVM flags. However it passes when ran w/o extra JVM options. After discussing this with the team, we are leaning towards this bug being a test bug: - the test passes w/o additional JVM flags - test exercises the combination of JVM options by starting JVM with a given combination: "-XX:+UnlockDiagnosticVMOptions -Xmx100M -XX:+AlwaysPreTouchStacks -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics" - passing this same combination to the test likely leads to invalid combination of JVM options If this is the case, solution will be to modify the test. The test should check for interfering/invalid JVM flags passed to the test, and explicitly assert with a message stating that running this test with specified set of JVM options is invalid.
18-12-2024