The flag G1RefProcDrainInterval is defined like this:
product(intx, G1RefProcDrainInterval, 10, \
"The number of discovered reference objects to process before " \
"draining concurrent marking work queues.") \
range(1, max_intx)
The value of the flag is used to initialize the an int value in G1CMKeepAliveAndDrainClosure. Since the range is defined to allow max_intx this will fail on 64-bit systems where intx is 64-bits wide.
The test runtime/CommandLine/OptionsValidation/TestOptionsWithRanges doesn't always catch this bug since a concurrent cycle needs to be triggered for the issue to show. To force this we could update the test utils with something like:
diff --git a/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java b/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java
--- a/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java
+++ b/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java
@@ -216,6 +216,9 @@
case "CMSPrecleanDenominator":
option.addPrepend("-XX:CMSPrecleanNumerator=" + ((new Integer(option.getMin())) - 1));
break;
+ case "G1RefProcDrainInterval":
+ option.addPrepend("-XX:+ExplicitGCInvokesConcurrent");
+ break;
case "InitialTenuringThreshold":
option.addPrepend("-XX:MaxTenuringThreshold=" + option.getMax());
break;
product(intx, G1RefProcDrainInterval, 10, \
"The number of discovered reference objects to process before " \
"draining concurrent marking work queues.") \
range(1, max_intx)
The value of the flag is used to initialize the an int value in G1CMKeepAliveAndDrainClosure. Since the range is defined to allow max_intx this will fail on 64-bit systems where intx is 64-bits wide.
The test runtime/CommandLine/OptionsValidation/TestOptionsWithRanges doesn't always catch this bug since a concurrent cycle needs to be triggered for the issue to show. To force this we could update the test utils with something like:
diff --git a/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java b/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java
--- a/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java
+++ b/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java
@@ -216,6 +216,9 @@
case "CMSPrecleanDenominator":
option.addPrepend("-XX:CMSPrecleanNumerator=" + ((new Integer(option.getMin())) - 1));
break;
+ case "G1RefProcDrainInterval":
+ option.addPrepend("-XX:+ExplicitGCInvokesConcurrent");
+ break;
case "InitialTenuringThreshold":
option.addPrepend("-XX:MaxTenuringThreshold=" + option.getMax());
break;