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

AsyncGetCallTrace obtains too few frames with instrumentation agent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 21
    • None
    • hotspot
    • None
    • svc
    • x86
    • linux

      AsyncGetCallTrace returns too few frames when called in a native method which is in turn called by an instrumentation agent at a class load caused by some methods (java.lang.CharacterData.of and possibly others too), compared to GetStackTrace:

      ```
      GST Trace length: 5
      Frame 0: Native frameLme/bechberger/trace/NativeChecker;.checkTrace(ZI)V
      Frame 1: Java frame Lme/bechberger/trace/ClassTransformer;.transform(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[B)[B: 2
      Frame 2: Java frame Lsun/instrument/TransformerManager;.transform(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[B)[B: 52
      Frame 3: Java frame Lsun/instrument/InstrumentationImpl;.transform(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[BZ)[B: 69
      Frame 4: Java frame Ljava/lang/CharacterData;.of(I)Ljava/lang/CharacterData;: 96
      GST Trace end
      ASGCT Trace:
      ASGCT Trace length: 4
      Frame 0: Native frame Lme/bechberger/trace/NativeChecker;.checkTrace(ZI)V
      Frame 1: Java frame Lme/bechberger/trace/ClassTransformer;.transform(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[B)[B: 2
      Frame 2: Java frame Lsun/instrument/TransformerManager;.transform(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[B)[B: 52
      Frame 3: Java frame Lsun/instrument/InstrumentationImpl;.transform(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[BZ)[B: 69
      ```

      Both GST and ASGCT are instructed to return a maximum of 5 frames. ASGCT is not able to go over the agent boundary, while GST is.


      This can be reproduced using the trace_validation agent [0] `java -Djdk.attach.allowAttachSelf=true -javaagent:target/trace-validation.jar=maxDepth=5 -jar ~/Downloads/renaissance.jar`, when using the current master build of the OpenJDK.

      [0] https://github.com/parttimenerd/trace_validation

            jbechberger Johannes Bechberger
            jbechberger Johannes Bechberger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: