This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 106716 - reading heap dump gets IllegalArgumentException: Invalid type 8
Summary: reading heap dump gets IllegalArgumentException: Invalid type 8
Status: RESOLVED INVALID
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P3 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-14 20:20 UTC by ecaspole
Modified: 2008-09-05 09:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
heap dump for this problem (2.94 MB, application/octet-stream)
2007-06-15 18:16 UTC, ecaspole
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecaspole 2007-06-14 20:20:35 UTC
I have a binary heap dump "heap.bin" taken on JDK 1.5.0_06 on linux. The JDK 6 jhat can read it OK. When I load it into
NetBeans 6.0M9 (running on Mac OS X if that matters), i got an exception:

    257 java.lang.IllegalArgumentException: Invalid type 8
    258     at com.sun.tools.profiler.heap.ClassDumpSegment.getPrimitiveArrayClass(ClassDumpSegment.java:102)
    259     at com.sun.tools.profiler.heap.HprofHeap.computeInstances(HprofHeap.java:595)
    260     at com.sun.tools.profiler.heap.ClassDump.getInstancesCount(ClassDump.java:183)
    261     at com.sun.tools.profiler.heap.ComputedSummary.<init>(ComputedSummary.java:26)
    262     at com.sun.tools.profiler.heap.HprofHeap.getSummary(HprofHeap.java:103)
    263     at org.netbeans.modules.profiler.heapwalk.HeapWalker.createHeap(HeapWalker.java:159)
    264     at org.netbeans.modules.profiler.heapwalk.HeapWalker.<init>(HeapWalker.java:50)
    265     at org.netbeans.modules.profiler.heapwalk.ui.OpenHeapWalkerAction$1.run(OpenHeapWalkerAction.java:38)
    266     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)

If I understand this message correctly, and look at the binary heap dump spec, I think 8 is for the byte basic type.
Comment 1 Tomas Hurka 2007-06-15 10:50:23 UTC
Is is possible to zip your dump and attach it to this issue? BTW: How did you take this dump on JDK5? Did you use jmap?
Comment 2 ecaspole 2007-06-15 18:13:27 UTC
Yes I used jmap like 

 /usr/java/jdk1.5.0_06/bin/jmap -heap:format=b 17507

The gzipped heap is about 3MB, I will try to upload it.
Comment 3 ecaspole 2007-06-15 18:16:00 UTC
Created attachment 43809 [details]
heap dump for this problem
Comment 4 Tomas Hurka 2007-06-15 19:57:39 UTC
Thanks.
Comment 5 Tomas Hurka 2007-06-22 14:34:34 UTC
JDK6 jhat fails to read attached dump with the following exception:

Snapshot read, resolving...
Resolving 152164 objects...
WARNING:  Failed to resolve object id 0xb0b60a40 for field unfinalized (signature L)
WARNING:  Failed to resolve object id 0xb0bd9688 for field cachedMat (signature L)
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to com.sun.tools.hat.internal.model.JavaClass
        at com.sun.tools.hat.internal.model.JavaObjectArray.resolve(JavaObjectArray.java:68)
        at com.sun.tools.hat.internal.model.Snapshot.resolve(Snapshot.java:237)
        at com.sun.tools.hat.Main.main(Main.java:152)
 
Comment 6 Jiri Prox 2007-09-17 20:53:46 UTC
Obsolete milestone, please reevaluate
Comment 7 Tomas Hurka 2007-11-07 10:36:09 UTC
Changing target milestone to dev, since NetBeans 6.0 is in high resistance mode.
Comment 8 Tomas Hurka 2008-09-05 09:53:44 UTC
I believe that the heap dump is broken. Note that taking the heap dump with jmap on JDK 5 from a live process is not safe. On JDK 5, jmap attaches to the 
process image in a non-cooperative manner. There is no guarantee that the heap is in a consistent state. I was not able to open it in jhat and I did the heap 
dump analysis and it looks like it is missing description for all the classes, which represents arrays. If you find a way to open this heap dump in jhat, please 
reopen this issue. Thanks.