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 54242 - ArrayIndexOutOfBoundsException in ClassLoaderTable when memory profiling
Summary: ArrayIndexOutOfBoundsException in ClassLoaderTable when memory profiling
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: mishadmitriev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-01 02:13 UTC by mishadmitriev
Modified: 2006-07-24 14:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The thread dump for resin server after the problem (29.83 KB, text/plain)
2005-02-01 02:15 UTC, mishadmitriev
Details
The thread dump for NetBeans after the problem (7.46 KB, text/plain)
2005-02-01 02:16 UTC, mishadmitriev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mishadmitriev 2005-02-01 02:13:42 UTC
The server runs fine when profiling with  the
"record object creation" option. Then I started
testing the other option, "record both object
creation and garbage collection". I got this
exception from the IDE:

java.lang.ArrayIndexOutOfBoundsException: 25
 at 
com.sun.tools.profiler.classfile.ClassLoaderTable.getParentLoader(ClassLoaderTable.java:29)
 at 
com.sun.tools.profiler.classfile.SameNameClassGroup.isParentLoaderTo(SameNameClassGroup.java:70)
 at 
com.sun.tools.profiler.classfile.SameNameClassGroup.checkForCompatibility(SameNameClassGroup.java:45)
 at 
com.sun.tools.profiler.classfile.ClassRepository.lookupClassOrCreatePlaceholder(ClassRepository.java:258)
 at 
com.sun.tools.profiler.instrumentation.ClassManager.javaClassOrPlaceholderForName(ClassManager.java:68)
 at 
com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor$MethodScanerForNewOpcodes.hasNewArrayOpcodes(MemoryProfMethodInstrumentor.java:233)
 at 
com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.hasNewOpcodes(MemoryProfMethodInstrumentor.java:114)
 at 
com.sun.tools.profiler.instrumentation.ObjLivenessMethodInstrumentor.methodNeedsInstrumentation(ObjLivenessMethodInstrumentor.java:43)
 at 
com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.findAndMarkMethodsToInstrumentInClass(MemoryProfMethodInstrumentor.java:95)
 at 
com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.getMethodsToInstrumentUponClassLoad(MemoryProfMethodInstrumentor.java:63)
 at 
com.sun.tools.profiler.instrumentation.Instrumentor.createFollowUpInstrumentMethodGroupResponseForMemoryProfiling(Instrumentor.java:368)
 at 
com.sun.tools.profiler.instrumentation.Instrumentor.createFollowUpInstrumentMethodGroupResponse(Instrumentor.java:107)
 at 
com.sun.tools.profiler.ProfilerClient.instrumentMethodGroupFollowUp(ProfilerClient.java:610)
 at 
com.sun.tools.profiler.ProfilerClient.access$2700(ProfilerClient.java:41)
[catch] at 
com.sun.tools.profiler.ProfilerClient$SeparateCmdExecutionThread.run(ProfilerClient.java:1177)

    And after a clean resin install and retesting,
it took more time, but I 
got a similar exception from the IDE:

java.lang.ArrayIndexOutOfBoundsException: 607
 at 
com.sun.tools.profiler.classfile.ClassLoaderTable.getParentLoader(ClassLoaderTable.java:29)
 at 
com.sun.tools.profiler.classfile.SameNameClassGroup.isParentLoaderTo(SameNameClassGroup.java:70)
 at 
com.sun.tools.profiler.classfile.SameNameClassGroup.checkForCompatibility(SameNameClassGroup.java:45)
 at 
com.sun.tools.profiler.classfile.SameNameClassGroup.findCompatibleClass(SameNameClassGroup.java:59)
 at 
com.sun.tools.profiler.classfile.ClassRepository.lookupClass(ClassRepository.java:127)
 at 
com.sun.tools.profiler.classfile.ClassRepository.lookupClass(ClassRepository.java:111)
 at 
com.sun.tools.profiler.instrumentation.ClassManager.javaClassForName(ClassManager.java:48)
 at 
com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.findAndMarkMethodsToInstrumentInClass(MemoryProfMethodInstrumentor.java:82)
 at 
com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.getMethodsToInstrumentUponClassLoad(MemoryProfMethodInstrumentor.java:63)
 at 
com.sun.tools.profiler.instrumentation.Instrumentor.createFollowUpInstrumentMethodGroupResponseForMemoryProfiling(Instrumentor.java:368)
 at 
com.sun.tools.profiler.instrumentation.Instrumentor.createFollowUpInstrumentMethodGroupResponse(Instrumentor.java:107)
 at 
com.sun.tools.profiler.ProfilerClient.instrumentMethodGroupFollowUp(ProfilerClient.java:610)
 at 
com.sun.tools.profiler.ProfilerClient.access$2700(ProfilerClient.java:41)
[catch] at 
com.sun.tools.profiler.ProfilerClient$SeparateCmdExecutionThread.run(ProfilerClient.java:1177)

    I can always reproduce the first stack trace
when starting the 
application server with all the classes/JSPs etc.
already compiled, 
immediately after I access the root URL.

    When this happens, the profiled VM freezes, I
attached the full thread 
dumps collected after the error.
Comment 1 mishadmitriev 2005-02-01 02:15:55 UTC
Created attachment 20105 [details]
The thread dump for resin server after the problem
Comment 2 mishadmitriev 2005-02-01 02:16:57 UTC
Created attachment 20106 [details]
The thread dump for NetBeans after the problem
Comment 3 mishadmitriev 2005-02-01 03:33:54 UTC
Ok, I can reproduce the problem and understand why it happens. Now 
need to understand how to fix it.
Comment 4 mishadmitriev 2005-02-02 06:06:06 UTC
Fixed in M5 release. Thanks again for your help, Vlad!
Comment 5 ehucka 2006-07-24 14:31:12 UTC
old issue, closed