RFR (XS): 8129855: -XX:+IgnoreUnrecognizedVMOptions hides "out of range" VM options.
gerard ziemski
gerard.ziemski at oracle.com
Thu Jul 30 23:00:02 UTC 2015
(resending with tables formatted using plain text - the mailing list
sanitized my real tables. hopefully the plain text formatting will get
preserved, if not, please see the table in the bug's comments section at
https://bugs.openjdk.java.net/browse/JDK-8129855)
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 (unchanged):
exists, invalid value does not
exist
-XX:MinHeapFreeRatio=notnum -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 JDK-8129855, fixed):
exists, in range exists,
out of range
-XX:StackRedPages=1 -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 (new behavior):
diagnostic & locked
experimental & locked commercial & locked
-XX:-UnlockDiagnosticVMOptions -XX:-UnlockExperimentalVMOptions
-XX:-UnlockCommercialFeatures
-XX:+PrintInlining -XX:+AlwaysSafeConstructors -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, unchanged):
develop & !product_build
notproduct & !product_build
-XX:+DeoptimizeALot -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, unchanged):
develop & product_build
notproduct & product_build
-XX:+DeoptimizeALot -XX:+VerifyCodeCache
-IgnoreUnrecognizedVMOptions ERR ERR
+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 ago at
http://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 by
https://bugs.openjdk.java.net/browse/JDK-8132545
Tested with test case from
https://bugs.openjdk.java.net/browse/JDK-8130697,
https://bugs.openjdk.java.net/browse/JDK-6886353and via "JPRT -testset
hotspot"
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