JDK-7162488 : VM not printing unknown -XX options
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs23,7u4
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-04-18
  • Updated: 2014-09-04
  • Resolved: 2012-08-29
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 7 JDK 8 Other
7u10Fixed 8Fixed hs23.2Resolved
If unknown -XX options passed to JVM from JDK 7u5 b02 then it only prints message about fatal exception:
/export/jdk/jdk1.7.0_05b02/bin/java -XX:unknownFlag 
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

With previous builds JVM also printing information about unknown options:
/export/jdk/jdk1.7.0_05b01/bin/java -XX:unknownFlag
Unrecognized VM option 'unknownFlag'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Unrecognized options reporting works with any previous updates, JDK 1.7.0 FCS and with JDK 7u5 b01.

No information about unknown options printed using -XX:Flags=<file with unknown options> too.
That fact causing runtime/7110720/Test7110720.sh test failures:

/test: http://hg.openjdk.java.net/jdk7u/jdk7u-dev/hotspot/rev/f3a4ee95783b

Verified with jdk7u12-b01

EVALUATION http://hg.openjdk.java.net/hsx/hsx23.4/hotspot/rev/037c44a259bc

EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/f3a4ee95783b

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/f3a4ee95783b

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/f3a4ee95783b

EVALUATION In src/share/vm/runtime/arguments.cpp we need to do something when locked_flag is null, e.g. $ hg diff src/share/vm/runtime/arguments.cpp diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -829,6 +829,9 @@ } else { jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf); } + } else { + jio_fprintf(defaultStream::error_stream(), + "Unrecognized VM option '%s'\n", argname); } // allow for commandline "commenting out" options like -XX:#+Verbose