HotSpot segfaults if given -XX options with an empty string argument (regression)

Volker Simonis volker.simonis at gmail.com
Thu Sep 4 08:45:02 PDT 2008


.. and I forgot to say: the actual crash happens in
'CommandLineFlags::ccstrAtPut()' where 'strlen()' is called with a
NULL argument because 'value' is set to NULL in
'Arguments::parse_argument()' if it points to an empty string. The
patch fixes this...

On 9/4/08, Volker Simonis <volker.simonis at gmail.com> wrote:
> Hi,
>
>  I just realized that 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.
>
>  Attached you can find a patch against
>  http://hg.openjdk.java.net/jdk7/jdk7/hotspot
>
>  At the same time, 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'.
>
>  Regards,
>
> Volker
>
>



More information about the hotspot-dev mailing list