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.
This bug was originally marked as duplicate of bug 208251, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE Dev (Build 201606240002) VM: TuxJdk 64-Bit Server VM, 25.92-b03-tuxjdk-03, TuxJdk Runtime Environment, 1.8.0_92-tuxjdk-03 OS: Linux User Comments: pangalz: Running profiler Stacktrace: java.lang.ArrayIndexOutOfBoundsException: 3436 at org.netbeans.lib.profiler.instrumentation.SingleMethodScaner.getU4(SingleMethodScaner.java:189) at org.netbeans.lib.profiler.instrumentation.SingleMethodScaner.getInt(SingleMethodScaner.java:177) at org.netbeans.lib.profiler.instrumentation.Injector.changeJump(Injector.java:409) at org.netbeans.lib.profiler.instrumentation.Injector.changeJumps(Injector.java:526) at org.netbeans.lib.profiler.instrumentation.Injector.relocateCode(Injector.java:659) at org.netbeans.lib.profiler.instrumentation.Injector.injectCodeAndRewrite(Injector.java:328)
Created attachment 160163 [details] stacktrace
Thanks for the report, however I need steps to reproduce it - it looks like that the exception depends on particular class file. What application did you profile?
I'll try with latest build and check if error still happens. It occurred when I tried to attach in more than one app.
*** Bug 267684 has been marked as a duplicate of this bug. ***
*** Bug 268119 has been marked as a duplicate of this bug. ***
I see this and similar exceptions when running the SQL profiler against various projects - the common feature appears to be PervasiveSQL. I do not think PervasiveSQL is a database formally supported by either Netbeans or Hibernate. Running SQL Profiler against projects that use Hibernate in conjunction with MS SQLServer appears to work correctly. Please let me know if i can offer any further information. db
(In reply to bolsover from comment #6) [..] > Please let me know if i can offer any further information. Can you, please, provide step-by-step description, how to reproduce this exception? Thanks.
Hi Thomas I have put together a minimal project to reproduce the exception - but I rather suspect it is of little value unless you have access to a PervasiveSQL database. Let me know if you want a copy of the code I have now. The code I have will reliably reproduce the following exception: java.lang.ArrayIndexOutOfBoundsException: 6796 at org.netbeans.lib.profiler.instrumentation.SingleMethodScaner.getU4(SingleMethodScaner.java:189) at org.netbeans.lib.profiler.instrumentation.SingleMethodScaner.getInt(SingleMethodScaner.java:177) at org.netbeans.lib.profiler.instrumentation.Injector.changeJump(Injector.java:409) at org.netbeans.lib.profiler.instrumentation.Injector.changeJumps(Injector.java:526) I'll investigate further - but need some guidance on how to debug the ide.
(In reply to bolsover from comment #8) > I have put together a minimal project to reproduce the exception - but I > rather suspect it is of little value unless you have access to a > PervasiveSQL database. I am sorry, I don't know anything about PervasiveSQL. How can I get access to it? Maybe JDBC driver for PervasiveSQL will be enough to reproduce the problem.
Created attachment 162150 [details] Minimal test project
I've uploaded a minimal test project to illustrate the problem. The main class will run normally without the profiler but will throw the reported exception when it attempts to run the Hibernate generated queries. The normal JDBC queries run correctly and the profiler reports the SQL for these. The PervasiveSQL driver is include in the /dist/lib folder together with a number of other libraries to allow Hibernate to run. It might be possible to provide a public link (short term) to a PervasiveSQL database - let me know if you this this would be helpful.
Thanks for the test case. I am able to reproduce it with the following line: Class.forName("com.pervasive.jdbc.v2.PreparedStatement"); added after Class.forName("com.pervasive.jdbc.v2.Driver"); statement.
Fixed in profiler-main changeset: 300256:c580baffe8a9 user: Tomas Hurka <thurka@netbeans.org> date: Wed Sep 21 21:26:26 2016 +0200 summary: bugfix #262571, make sure injected code is aligned to 4 bytes - this way opc_tableswitch and opc_lookupswitch do not need to change padding
Integrated into 'main-silver', will be available in build *201609230002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/c580baffe8a9 User: Tomas Hurka <thurka@netbeans.org> Log: bugfix #262571, make sure injected code is aligned to 4 bytes - this way opc_tableswitch and opc_lookupswitch do not need to change padding
Fix transplanted to release82 branch: changeset: 313492:8e8a463529b6 branch: release82 parent: 313368:698929a0e5e1 user: Tomas Hurka <thurka@netbeans.org> date: Wed Sep 21 21:26:26 2016 +0200 files: lib.profiler/src/org/netbeans/lib/profiler/instrumentation/MethodEntryExitCallsInjector.java description: bugfix #262571, make sure injected code is aligned to 4 bytes - this way opc_tableswitch and opc_lookupswitch do not need to change padding (transplanted from c580baffe8a905a0bdb133ec406d5f26285fcda7)
*** Bug 269231 has been marked as a duplicate of this bug. ***
Tested against 82 Patch1 - verified fixed.