JDK-6744783 : HotSpot segfaults if given -XX options with an empty string argument
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs14,6u11
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_2.5.1
  • CPU: generic,x86
  • Submitted: 2008-09-04
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
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 6 JDK 7 Other
6u14Fixed 7Fixed hs14Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
There's a regression in the argument parsing code
of the HotSpot which leads to a segmentation fault if an -XX option
with an empty string argument (e.g. -XX:SyncKnobs= or
-XX:SyncKnobs="") is given on the command line.

The regression must have appeared somewhere in HS 11, because Java
1.6.0_06 (which contains HS 10.0_b22) doesn't show the problem while
both Java 1.6.0_10 (HS 11.0_b11) and Java 1.7.0-ea-b24 (HS 12.0_b01)
as well as the latest OpenJDK snapshot (Rev. 292 with tag jdk7-b34)
are affected.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/885fe0f95828
25-09-2008

EVALUATION Simple fix to argument processing
05-09-2008

SUGGESTED FIX Suggested fix provided as a patch by the submitter: The patch also fixes a minor flaw in globals.hpp where the default value of the 'PrintAssemblyOptions' option, which is of type 'ccstr', should really be "" instead of 'false'. # HG changeset patch # User Volker H. Simonis <###@###.###> # Date 1220536147 -7200 # Node ID 9e103080d2dd8b4741fb22052dec954ed1192972 # Parent 5967ae2171f65055b4da7af918751d5a8d9e5f10 Fixed a regression in arguments.cpp which leads to a segmentation fault if an empty -XX option with an empty string argument (e.g. -XX:SyncKnobs= or -XX:SyncKnobs="") was given on the command line. The regression must have appeared somewhere in HS 11, because Java 1.6.0_06 (which contains HS 10.0_b22) doesn't show the problem while both Java 1.6.0_10 (HS 11.0_b11) and Java 1.7.0-ea-b24 (HS 12.0_b01) as well as the latest OpenJDK snapshot (Rev. 292 with tag jdk7-b34) are affected. At the same time I fixed a minor problem in globals.hpp where the default value of the 'PrintAssemblyOptions' option which is of type 'ccstr' should really be "" instead of 'false'. diff -r 5967ae2171f6 -r 9e103080d2dd src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Thu Aug 28 11:05:17 2008 -0700 +++ b/src/share/vm/runtime/arguments.cpp Thu Sep 04 15:49:07 2008 +0200 @@ -610,9 +610,6 @@ bool Arguments::parse_argument(const cha if (flag->ccstr_accumulates()) { return append_to_string_flag(name, value, origin); } else { - if (value[0] == '\0') { - value = NULL; - } return set_string_flag(name, value, origin); } } diff -r 5967ae2171f6 -r 9e103080d2dd src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Thu Aug 28 11:05:17 2008 -0700 +++ b/src/share/vm/runtime/globals.hpp Thu Sep 04 15:49:07 2008 +0200 @@ -689,7 +689,7 @@ class CommandLineFlags { diagnostic(bool, PrintAssembly, false, \ "Print assembly code (using external disassembler.so)") \ \ - diagnostic(ccstr, PrintAssemblyOptions, false, \ + diagnostic(ccstr, PrintAssemblyOptions, "", \ "Options string passed to disassembler.so") \ \ diagnostic(bool, PrintNMethods, false, \
04-09-2008