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 164250 - ArrayIndexOutOfBoundsException in ProfilerRuntimeCPUSampledInstr.methodEntry()
Summary: ArrayIndexOutOfBoundsException in ProfilerRuntimeCPUSampledInstr.methodEntry()
Status: RESOLVED DUPLICATE of bug 163211
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: issues@profiler
URL:
Keywords:
: 164503 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-30 22:37 UTC by apb
Modified: 2009-05-25 21:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description apb 2009-04-30 22:37:30 UTC
I have an extremely large proprietary project (1700 files and > 70K methods) and I'm trying to profile the entire
project, however, the profiler always crashes with the following exception

Exception in thread "SubL Thread #1" java.lang.ExceptionInInitializerError
        at sun.misc.Unsafe.ensureClassInitialized(Native Method)
        at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
        at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
        at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
        at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
        at java.lang.reflect.Field.get(Field.java:358)
        at com.cyc.tool.subl.util.SubLFiles.initialize(SubLFiles.java:70)
        at com.cyc.cycjava.cycl.cycl.runTopLevelForms(cycl.java:398)
        at com.cyc.tool.subl.util.SubLFiles.initialize(SubLFiles.java:55)
        at com.cyc.tool.subl.jrtl.nativeCode.subLisp.Eval.initialize_subl_interface_file(Eval.java:211)
        at com.cyc.tool.subl.jrtl.nativeCode.subLisp.SubLMain.initializeTranslatedSystems(SubLMain.java:184)
        at com.cyc.tool.subl.jrtl.nativeCode.subLisp.SubLMain$2.safeRun(SubLMain.java:463)
        at com.cyc.tool.subl.jrtl.nativeCode.type.core.SubLProcess.run(SubLProcess.java:147)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
        at com.cyc.tool.subl.jrtl.nativeCode.subLisp.SubLThread.run(SubLThread.java:109)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -32656
        at
org.netbeans.lib.profiler.server.ProfilerRuntimeCPUSampledInstr.methodEntry(ProfilerRuntimeCPUSampledInstr.java:287)
        at
org.netbeans.lib.profiler.server.ProfilerRuntimeCPUSampledInstr.rootMethodEntry(ProfilerRuntimeCPUSampledInstr.java:385)
        at com.cyc.cycjava.cycl.inference.harness.inference_modules.<clinit>(inference_modules.java:73)
        ... 17 more


It looks like the profiler may be inappropriately using byte offests when bytes are not sufficiently large. Note, I
really need to profile the the vast majority of code, so picking a few roots isn't sufficient or will pick up everything
anyways.
Comment 1 apb 2009-05-01 00:17:48 UTC
This seems like it might be related to Issue 104573 where the profiler was using chars for offsets into large files that
were greater than 32K bytes long.
Comment 2 Tomas Hurka 2009-05-01 07:53:06 UTC
There is no problem in profiler and this exception has nothing to do with issue #104573. This is a problem in JVM. There is a workaround for it, but it 
stopped working in JDK 1.6.0_10. Which JDK are you using? 1.6.0_07 should work. 
Comment 3 Tomas Hurka 2009-05-04 13:43:45 UTC
You can also tell HotSpot compiler to exclude org.netbeans.lib.profiler.server.ProfilerRuntimeCPUSampledInstr.methodEntry() method from being compiled. To 
do so, you will create .hotspot_compiler file in the current working directory of the profiled application and put

exclude org/netbeans/lib/profiler/server/ProfilerRuntimeCPUSampledInstr methodEntry

See this http://blogs.sun.com/javawithjiva/entry/hotspotrc_and_hotspot_compiler link for more details about .hotspot_compiler




*** This issue has been marked as a duplicate of 163211 ***
Comment 4 Tomas Hurka 2009-05-04 16:00:28 UTC
More info: the JVM bug can be reproduce with Server VM only.
Comment 5 Tomas Hurka 2009-05-05 16:40:44 UTC
*** Issue 164503 has been marked as a duplicate of this issue. ***
Comment 6 mgoe 2009-05-06 12:36:09 UTC
Could someone please post the jdk bug id.