Bug 191297 - Profiling fails with 'Redefinition failed with error 62'
Profiling fails with 'Redefinition failed with error 62'
Status: RESOLVED FIXED
Product: profiler
Classification: Unclassified
Component: Engine
6.x
All All
: P2 (vote)
: 7.0
Assigned To: Tomas Hurka
issues@profiler
: VISUALVM
: 198170 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-25 08:06 UTC by Tomas Hurka
Modified: 2016-02-05 07:41 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Sample project (18.35 KB, application/octet-stream)
2011-01-07 13:28 UTC, J Bachorik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2010-10-25 08:06:51 UTC
This is JDK 7 specific bug caused by more strict classfile verification for classes with version >= 51.

Steps to reproduce. 
1) Download latest JDK 7 build (tested with build 113)
2) add JDK 7 as Java platform in NetBeans
3) create AnagramGame project
4) set JDK 7 ad Java platform
5) set JDK 7 as Source/Binary Format
6) profile AnagramGame (CPU, default settings)
7) class instrumentation fails. See log below:


Profiler Agent: Initializing...
Profiler Agent: Options: >/home/thurka/Projects/netbeans_691/netbeans/profiler/lib,5140,10<
Profiler Agent: Initialized successfully
Profiler Agent: Waiting for connection on port 5140, timeout 10 seconds (Protocol version: 10)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
Profiler Agent Error: Redefinition failed for classes:
com.toy.anagrams.ui.Anagrams
Profiler Agent Error: with message: Redefinition failed with error 62
Check JVMTI documentation for this error code.
Debug: writing class file: com.toy.anagrams.ui.Anagrams, into file: com.toy.anagrams.ui.Anagrams.class
Comment 1 Tomas Hurka 2010-10-25 08:13:12 UTC
There is a easy workaround: 
run profiled application with -Xverify:none
Comment 2 Quality Engineering 2010-12-10 06:19:05 UTC
Integrated into 'main-golden', will be available in build *201012100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/40857be8ceee
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #191297, update a local variable table when a class is instrumented
Comment 3 J Bachorik 2011-01-07 13:28:28 UTC
Created attachment 104787 [details]
Sample project
Comment 4 J Bachorik 2011-01-07 13:29:20 UTC
Comment on attachment 104787 [details]
Sample project

should have been attached to a different issue
Comment 5 Quality Engineering 2011-01-09 06:20:23 UTC
Integrated into 'main-golden', will be available in build *201101090000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3ae4f288a8b5
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #194076, #191297, update LocalVariableTypeTable attribute when a class is instrumented
Comment 6 Quality Engineering 2011-01-19 06:32:25 UTC
Integrated into 'main-golden', will be available in build *201101190000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/43a5d34aa113
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #191297, #194186, forgotten initialization of modifiledLocalVariableTypeTableOffsets added
Comment 7 Quality Engineering 2011-01-29 05:26:08 UTC
Integrated into 'main-golden', will be available in build *201101290000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/77b3a2b43586
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #191297 update StackMapTable attribute when a class is instrumented
Comment 8 Quality Engineering 2011-02-16 11:35:47 UTC
Integrated into 'main-golden', will be available in build *201102160501* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/66bbeccf47a9
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #195478, #191297, initialize modifiledStackMapTableOffsets
Comment 9 Quality Engineering 2011-02-18 10:31:34 UTC
Integrated into 'main-golden', will be available in build *201102180501* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/9c7e822f0d18
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #195477, #191297, insert StackMapTable attribute at the end of Code attribute
Comment 10 Tomas Hurka 2011-03-18 07:47:59 UTC
This issue can be finally closed as fixed. To work correctly, JDK 7 b134 or newer has to be used together with this fix in NetBeans Profiler 7.0.
Comment 11 Tomas Hurka 2015-04-23 11:47:34 UTC
*** Bug 198170 has been marked as a duplicate of this bug. ***
Comment 12 swpalmer 2016-02-04 20:48:36 UTC
This still happens with NetBeans 8.1 on Java 8u72.  The error appears occasionally while collecting profiling info.
Comment 13 swpalmer 2016-02-04 20:49:51 UTC
The message "Profiler Agent Warning: JVMTI classLoadHook: class name is null." is dumped to stderr repeatedly when this happens.
Comment 14 Tomas Hurka 2016-02-05 07:41:19 UTC
(In reply to swpalmer from comment #12)
> This still happens with NetBeans 8.1 on Java 8u72.  The error appears
> occasionally while collecting profiling info.
Please file separate bug and don't forget to include steps how to reproduce it and messages.log. Thanks.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo