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
Description
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:
http://vice.russia.sun.com/results/1.7.0_05/b02/vm/win2008r2-x64-32_hs/workDir/runtime/7110720/Test7110720.jtr

Comments
/test: http://hg.openjdk.java.net/jdk7u/jdk7u-dev/hotspot/rev/f3a4ee95783b
06-12-2012

Verified with jdk7u12-b01
13-10-2012

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

EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/f3a4ee95783b
29-06-2012

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

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

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
18-04-2012