Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8056010

Profiler Agent Error: with message: Redefinition failed with error 62

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8u20
    • tools
    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.8.0_20"
      Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
      Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin gray.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      I didn't use the installer, but extracted the .dmg file and copy the JDK into my user folder. The program is started via:
      /Users/daniel/jdk1.8.0u20/bin/java -cp bin/ de.mmis.core.prototype.Prototype

      A DESCRIPTION OF THE PROBLEM :
      I'm using the Java VisualVM bundled with the current JDK (version: 1.8.0_20 (Build 1370-140407); platform 20140407-unknown-revn). When I start the CPU Profiler for my program I receive:

      Profiler Agent: JNI OnLoad Initializing...
      Profiler Agent: JNI OnLoad Initialized successfully
      Profiler Agent: Waiting for connection on port 5140 (Protocol version: 14)
      Profiler Agent: Established connection with the tool
      Profiler Agent: Local accelerated session
      Profiler Agent Error: Redefinition failed for classes:
      [...]
      java.lang.reflect.Method
      Profiler Agent Error: with message: Redefinition failed with error 62
      Check JVMTI documentation for this error code.
      [...]
      Debug: writing class file: java.lang.reflect.Method, into file: java.lang.reflect.Method.class

      Connecting the same version of the VisualVM to my old Java installation works as expected and provides me with a profile.

      REGRESSION. Last worked in version 8u5

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_05"
      Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. compile and start a program with 1.8.0_05
      2. connect with the VisualVM from 1.8.0_20
      3. CPU profiler works as expected
      4. compile and start the program with 1.8.0_20
      5. connect with the VisualVM from 1.8.0_20
      6. run CPU profiler

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      a working CPU profiler
      ACTUAL -
      VisualVM provides the error "Redefinition failed with error 62", the program outputs a profiler error and creates a lot of *.class files in its working directory.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      objc[14452]: Class JavaLaunchHelper is implemented in both /Users/daniel/Stuff/Work/Programs/jdk1.8.0u20/bin/java and /Users/daniel/Stuff/Work/Programs/jdk1.8.0u20/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
      Profiler Agent: JNI OnLoad Initializing...
      Profiler Agent: JNI OnLoad Initialized successfully
      Profiler Agent: Waiting for connection on port 5140 (Protocol version: 14)
      Profiler Agent: Established connection with the tool
      Profiler Agent: Local accelerated session
      Profiler Agent Error: Redefinition failed for classes:
      java.lang.ApplicationShutdownHooks$1
      sun.nio.ch.FileChannelImpl$Unmapper
      sun.rmi.transport.DGCAckHandler$1
      java.util.logging.LogManager$Cleaner
      java.util.concurrent.FutureTask
      sun.rmi.transport.DGCImpl$1
      de.mmis.core.prototype.Prototype
      com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout
      java.util.concurrent.ThreadPoolExecutor$Worker
      java.io.DeleteOnExitHook$1
      java.lang.ref.Reference$ReferenceHandler
      sun.rmi.transport.tcp.TCPTransport$ConnectionHandler
      java.lang.UNIXProcess$4
      sun.rmi.transport.tcp.TCPTransport$AcceptLoop
      java.lang.ref.Finalizer$FinalizerThread
      java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask
      java.lang.reflect.Method
      Profiler Agent Error: with message: Redefinition failed with error 62
      Check JVMTI documentation for this error code.
      Debug: writing class file: java.lang.ApplicationShutdownHooks$1, into file: java.lang.ApplicationShutdownHooks$1.class
      Debug: writing class file: sun.nio.ch.FileChannelImpl$Unmapper, into file: sun.nio.ch.FileChannelImpl$Unmapper.class
      Debug: writing class file: sun.rmi.transport.DGCAckHandler$1, into file: sun.rmi.transport.DGCAckHandler$1.class
      Debug: writing class file: java.util.logging.LogManager$Cleaner, into file: java.util.logging.LogManager$Cleaner.class
      Debug: writing class file: java.util.concurrent.FutureTask, into file: java.util.concurrent.FutureTask.class
      Debug: writing class file: sun.rmi.transport.DGCImpl$1, into file: sun.rmi.transport.DGCImpl$1.class
      Debug: writing class file: de.mmis.core.prototype.Prototype, into file: de.mmis.core.prototype.Prototype.class
      Debug: writing class file: com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout, into file: com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.class
      Debug: writing class file: java.util.concurrent.ThreadPoolExecutor$Worker, into file: java.util.concurrent.ThreadPoolExecutor$Worker.class
      Debug: writing class file: java.io.DeleteOnExitHook$1, into file: java.io.DeleteOnExitHook$1.class
      Debug: writing class file: java.lang.ref.Reference$ReferenceHandler, into file: java.lang.ref.Reference$ReferenceHandler.class
      Debug: writing class file: sun.rmi.transport.tcp.TCPTransport$ConnectionHandler, into file: sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.class
      Debug: writing class file: java.lang.UNIXProcess$4, into file: java.lang.UNIXProcess$4.class
      Debug: writing class file: sun.rmi.transport.tcp.TCPTransport$AcceptLoop, into file: sun.rmi.transport.tcp.TCPTransport$AcceptLoop.class
      Debug: writing class file: java.lang.ref.Finalizer$FinalizerThread, into file: java.lang.ref.Finalizer$FinalizerThread.class
      Debug: writing class file: java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask, into file: java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.class
      Debug: writing class file: java.lang.reflect.Method, into file: java.lang.reflect.Method.class

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package de.mmis.core.prototype;

      import java.io.IOException;

      public class Prototype {

      public static void main(String[] args) throws IOException {
      System.in.read();
      System.out.println("hello world");
      }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      use old Java version 1.8.0_05 for profiling

            thurka Tomáš Hůrka
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: