RFR (XS): 8129855: -XX:+IgnoreUnrecognizedVMOptions hides "out of range" VM options.
gerard ziemski
gerard.ziemski at oracle.com
Thu Jul 30 22:21:01 UTC 2015
Thank you Dmitry and Vladimir for feedback. I have a follow-up question to Vladimir's feedback:
> I think we need more detailed check in case of locked flags. We should
> bailout only for product vs develop and product vs notproduct
> combinations (last 2 cases in get_locked_message()). For diagnostic
> and experimental flags we should exit with error message - this flags
> are available in product and most likely a developer forgot to add
> unlock flag. If we ignore them a test will be executed differently
> than intended. Thanks, Vladimir
So, you are asking for changing the current behavior? According to the tests I performed (see #1.3.4, #1.3.5, #1.3.6 in table #1.3) what you ask for is a new behavior. What you ask for is to have "-XX:+IgnoreUnrecognizedVMOptions" not have any effect on locked experimental, diagnostic and commercial" flags, right?
The issue JDK-8129855 only asks to restore behavior demonstrated by case #1.2.4 and not to break existing case #1.5.3 and #1.5.4, but I am open to do the changes you ask for if that's the consensus.
Please see the following test cases and verify that this is the behavior we want - if that's the case, then I will make the corresponding change and do an update to my webrev (which at moment fails #1.3.4, #1.3.5 and #1.3.5 in table #1.3):
Note: "(1)" next to results denotes a result that is different from the current jdk9/hs-rt behavior!
Note: "(2)" next to results denotes a result that is different from the jdk8 behavior!
*#1.1 normal flag:*
exists, invalid value
-XX:MinHeapFreeRatio=notnum
does not exist
-XX:THIS_FLAG_DOESNT_EXIST
-IgnoreUnrecognizedVMOptions
ERR
ERR
+IgnoreUnrecognizedVMOptions
OK
OK
#1.1.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:MinHeapFreeRatio=notnum -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.1.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:THIS_FLAG_DOESNT_EXIST -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.1.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:MinHeapFreeRatio=notnum -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.1.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:THIS_FLAG_DOESNT_EXIST -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
*
#1.2 normal flag with ranges (/the core of this fix/):*
exists, in range
-XX:StackRedPages=1
exists, out of range
-XX:StackRedPages=0
-IgnoreUnrecognizedVMOptions
OK
ERR
+IgnoreUnrecognizedVMOptions
OK
*ERR (1)*
#1.2.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:StackRedPages=1 -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.2.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:StackRedPages=0 -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.2.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:StackRedPages=1 -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.2.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:StackRedPages=0 -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
*#1.3 locked flag (/has ne//w// behavior/):*
diagnostic & locked
-XX:-UnlockDiagnosticVMOptions
-XX:+PrintInlining
experimental & locked
-XX:-UnlockExperimentalVMOptions
-XX:+AlwaysSafeConstructors
commercial & locked
-XX:-UnlockCommercialFeatures
-XX:+FlightRecorder
-IgnoreUnrecognizedVMOptions
ERR
ERR
ERR
+IgnoreUnrecognizedVMOptions
*ERR (1)(2)*
*ERR (1)(2)*
*ERR (1)(2)*
#1.3.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockDiagnosticVMOptions -XX:+PrintInlining -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.3.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockExperimentalVMOptions -XX:+AlwaysSafeConstructors -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.3.3 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockCommercialFeatures -XX:+FlightRecorder -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.3.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockDiagnosticVMOptions -XX:+PrintInlining -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.3.5 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockExperimentalVMOptions -XX:+AlwaysSafeConstructors -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.3.6 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockCommercialFeatures -XX:+FlightRecorder -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
*#1.4 develop & notproduct flag on debug VM (/trivial/):*
develop & !product_build
-XX:+DeoptimizeALot
notproduct & !product_build
-XX:+VerifyCodeCache
-IgnoreUnrecognizedVMOptions
OK
OK
+IgnoreUnrecognizedVMOptions
OK
OK
#1.4.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.4.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.4.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.4.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
*#1.5 develop & notproduct flag on product VM (/consistent with JDK-6886353/):*
develop & product_build
-XX:+DeoptimizeALot
notproduct & product_build
-XX:+VerifyCodeCache
-IgnoreUnrecognizedVMOptions
OK
OK
+IgnoreUnrecognizedVMOptions
*OK*
*OK*
#1.5.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.5.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.5.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
#1.5.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
------------------------------------------------------------------------------------------------------------------------------------
There was a brief email thread on this subject sometime agohttp://mail.openjdk.java.net/pipermail/hotspot-dev/2015-June/019213.html and it was decided that we need a new flag that provides a better alternative - that effort is now tracked byhttps://bugs.openjdk.java.net/browse/JDK-8132545
Tested with test case fromhttps://bugs.openjdk.java.net/browse/JDK-8130697,https://bugs.openjdk.java.net/browse/JDK-6886353 and via "JPRT testlist,noncolo.testlist -atk quick"
References:
bug:https://bugs.openjdk.java.net/browse/JDK-8129855
webrev:http://cr.openjdk.java.net/~gziemski/8129855_rev0/
cheers
More information about the hotspot-dev
mailing list