JDK-6476946 : JHAT - Missing class mishandled
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-09-29
  • 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
6u1Fixed 7 b03Fixed
Related Reports
Duplicate :  
Description
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 the resolving phase, if a JavaObject is found whose class does not exist, snapshot.addFakeInstanceClass is called to create a fake class for it. This method adds the fake class to Snapshot.heapObjects, which is being iterated over in Snapshot.resolve. Thus, the next step of the for loop throws a ConcurrentModificationException and dies.


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
I used the following code in Snapshot.resolve. It's very hacky, but I was able to get my file loaded.

        // Now, resolve everything else.
        for (Iterator it=heapObjects.values().iterator(); it.hasNext();)
        {
            JavaHeapObject t=null;
            try {
                t=(JavaHeapObject)it.next();
            } catch (ConcurrentModificationException e) {
                System.out.println("Restarting iteration");
                it=heapObjects.values().iterator();
                t=(JavaHeapObject)it.next();
            }
            if (!(t instanceof JavaClass)) {
                t.resolve(this);
            }
        }

I also added the line
        if (clazz instanceof JavaClass) { return; }
as the first line of JavaObject.resolve and JavaObjectArray.resolve.

Comments
EVALUATION Need to be fixed as suggested.
01-11-2006