JDK-6272923 : CI wrongly reports array class as unloaded after constrained klass is reported as loaded
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-05-19
  • Updated: 2023-07-21
  • Resolved: 2006-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
6 b75Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Hotspot crashes  and outputs log and the attached console message.

CONFIGURATION :
     - JDK : 6.0-ea36
     - OS  : WindowsXP SP1

REPRODUCE :
    (1) Compile the attached .java file.
    (2) Create jar files by the attached "build.bat"
    (3) Launch the command
       "java -server -Xcomp -XX:CompileOnly=Test.caller -XX:-Inline -cp Test.jar Test"

  You will see the following message and hs_log file.

K:\tmp>java -server -Xcomp -XX:CompileOnly=Test.caller -XX:-Inline -cp Test.jar Test
Test...
class name = #
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6da84006, pid=220, tid=3216
#
# Java VM: Java HotSpot(TM) Server VM (1.6.0-ea-b36 compiled mode)
# Problematic frame:
# V  [jvm.dll+0x1e4006]
#
# An error report file with more information is saved as hs_err_pid220.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

INVESTIGATION :
   when c2 thread compiles Test.caller, invalid(incorrect) code for target variable
   seems the cause of this crash.
   Loader constraint related to the type of return value Target[] in Derived.callee
   does not seem set correctly.
   Then the class loader which loads Derived class fails to detect Target[] class
    and data flow of "target" variable stays invalid("TOP" , means NULL).
   The above invalid status can not be founded and code generated.
    When the variable "target" is referred, VM crash or NullPointerException
    seems occurs.
###@###.### 2005-05-19 08:18:07 GMT

Comments
EVALUATION Correction. The bug was in the add_loader_constraint logic in systemDictionary.cpp. For object arrays, the element object needs to be added to the loader constraint table. Loaders do not load arrays so arrays have no meaning in a loader constraint context. The elements do. See fix for 6626217.
07-12-2009

SUGGESTED FIX See PRT webrev: http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2006/20060221143333.rasbold.c2_baseline2/workspace/webrevs/webrev-2006.02.21/index.html
22-02-2006

EVALUATION Re-evaluation: the constraint table and the systemDictionary are correct. The function used to query them, find_constrained_array_or_instance_klass(), does not report a consistent answer in this case.
11-02-2006

EVALUATION LibraryCallKit::inline_native_getClass() fails to handle top() receiver adequately. ###@###.### 2005-05-20 18:03:01 GMT The above evaluation is incorrect. When a signature includes an array, the loader constraint for an array is not properly added to the systemDictionary's constraint table. In the supplied test case, this causes CI to incorrectly return an unloaded ciKlass for "[LTarget;" when finding the monomorphic method at the callee() call site. This then creates havoc with the C2 type system, which causes C2 to believe that the receiver of getClass() is TOP. ###@###.### 2005-05-23 22:55:40 GMT
19-05-2005