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

string concatenation in class transformer causes LinkageError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 9, 17
    • hotspot
    • None
    • generic

      See attached testcase (Test1.java, InstrumentationHandoff.java, retransformAgent.mf)

      > javac Test1.java
      > javac InstrumentationHandoff.java
      > jar cvfm retransformAgent.jar retransformAgent.mf InstrumentationHandoff.class
      > java -XX:MaxRAMPercentage=12 -javaagent:retransformAgent.jar Test1

      Results:
      InstrumentationHandoff JPLIS agent initialized
      >>addTransformerToManager
      >>transform
      >>transform
      Exception in thread "main" >>transform
      >>transform
      >>transform
      java.lang.ClassCircularityError: java/lang/invoke/MethodHandleImpl$AsVarargsCollector
      >>transform
      >>transform
              at java.base/java.lang.invoke.MethodHandleImpl.makeVarargsCollector(MethodHandleImpl.java:442)
              at java.base/java.lang.invoke.MethodHandle.asVarargsCollector(MethodHandle.java:1433)
              at java.base/java.lang.invoke.MethodHandle.withVarargs(MethodHandle.java:1114)
              at java.base/java.lang.invoke.MethodHandle.setVarargs(MethodHandle.java:1637)
              at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:3996)
              at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:3944)
              at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodForConstant(MethodHandles.java:4188)
              at java.base/java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:4136)
              at java.base/java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:615)
              at Test1.addTransformerToManager(Test1.java:27)
              at Test1.runTest(Test1.java:18)
              at Test1.main(Test1.java:10)
      >>transform
      >>transform
      >>transform
      >>transform
      >>transform
      >>transform
      >>transform
      >>transform
      >>transform

            amenkov Alex Menkov
            amenkov Alex Menkov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: