United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6663908 NegativeArraySizeException is not thrown
6663908 : NegativeArraySizeException is not thrown

Details
Type:
Bug
Submit Date:
2008-02-15
Status:
Closed
Updated Date:
2012-02-01
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
solaris,generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
hs13

Related Reports
Backport:
Backport:
Duplicate:
Relates:

Sub Tasks

Description
Test execution results are erroneous when C2 with -Xcomp is used.

-Xint / -client / -server -Xmixed: 
[
Tester.var_29 = 2.6356778E38
Tester.var_28 = true
]

-server -Xcomp:
[
Tester.var_29 = 98.0
Tester.var_28 = true
]

I observe such behavior at least on linux-x86/x64 with both JDK 6u10b11 and JDK 7b24.

Testcase is attached.
HS10 (10.0-b19, jdk6u5-b11) isn't affected.

                                    

Comments
EVALUATION

A compiled method misses throwing a NegativeArraySizeException.
                                     
2008-03-05
EVALUATION

The bug only occurs when allocating a multi-dimensional array where the lowest dimension has negative size, all of the higher dimension sizes are constants, and at least one of those higher dimension sizes is zero.

The fix to bug 6603492 tries to optimize some cases of multidimensional array allocations. It fails to cause the NegativeArraySizeException to be thrown when a dimension size is zero.
                                     
2008-03-05
SUGGESTED FIX

In do_multianewarray() in parse3.cpp, change the dim_con test to be "dim_con <= 0" instead of "dim_con < 0".
                                     
2008-03-05



Hardware and Software, Engineered to Work Together