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

j.l.i.: .retransformClasses throws unexpected InternalError

XMLWordPrintable

    • b26
    • generic
    • generic
    • Verified

      Filed By : JCK team
      JDK : java full version "1.6.0-fcs"
      JCK : 6a
      Platform[s] : FAIL - seems to be all
      switch/Mode : default
      JCK test owner : http://javaweb.sfbay/jcce/tcks/jck/docs/others/owners.jto
      Failed tests:
        api/java_lang/instrument/Instrumentation/index.html#Instrumentation[Instrumentation219]
        api/java_lang/instrument/Instrumentation/attach.html#InstrumentationAttach[Instrumentation219]

      Problem description
      ===================
      The javadoc specification for the Instrumentation.retransformClasses(Class<?>... classes) method at:
        http://javaweb.sfbay/java/re/jdk/6.0/latest/docs/api/java/lang/instrument/Instrumentation.html#retransformClasses(java.lang.Class...)
      states as follows:
        ---Excerpt-from-spec---
        Throws:
        NullPointerException - if the supplied classes array or any of its components is null.
        ---End-of-excerpt---

      However, the call of retransformClasses(Class<?>... classes) throws unexpected InternalError
      if any of supplied classes array components is null.

      Please see attached minimized test (test.tar.gz) to reproduce the failure.

      Minimized test output:
      ======================
      <yg153347@d-espb04-125-170> java -javaagent:agent.jar Test
      Exception in thread "main" java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
              at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
      Caused by: java.lang.InternalError: class redefinition failed: invalid class
              at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method) at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:124)
              at com.test.agent.Agent.doTest(Agent.java:23)
              at com.test.agent.Agent.premain(Agent.java:13)
              ... 6 more
      FATAL ERROR in native method: processing of -javaagent failed

      Additional info:
      ================
      > uname -a
      SunOS d-espb04-125-170 5.10 Generic_118833-33 sun4u sparc SUNW,Ultra-60

            dcubed Daniel Daugherty
            ygaevsky Yuri Gaevsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: