United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6476946 : JHAT - Missing class mishandled

Details
Type:
Bug
Submit Date:
2006-09-29
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
core-svc
OS:
windows_xp
Sub-Component:
tools
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Duplicate:

Sub Tasks

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.
                                     
2006-11-01



Hardware and Software, Engineered to Work Together