Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6476643

JHAT - Missing array class mishandled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-svc
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      jdk-6-rc-src-b100-jrl-27_sep_2006

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      In JavaObjectArray.resolve, there is code to attempt to handle the case where the class object for the class of the array cannot be found.

              if (clazz == null) {
      clazz = snapshot.getOtherArrayType();
              }

      However, this does not work because fiels clazz is never null - it contains a Number which is the id of the class object we are looking for. JHAT then crashes when it tries to cast the Number to a JavaClass.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      The followint change seems to work:
      original:
          public void resolve(Snapshot snapshot) {
              long classID = getIdValue((Number)clazz);
              if (snapshot.isNewStyleArrayClass()) {
      replacement:
          public void resolve(Snapshot snapshot) {
              long classID = getIdValue((Number)clazz);
              clazz=null; // add this line
              if (snapshot.isNewStyleArrayClass()) {

            sundar Sundararajan Athijegannathan
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: