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

AsyncGetCallTrace obtains too few frames in sanity test

XMLWordPrintable

    • svc
    • 18
    • b11
    • x86
    • generic

        AsyncGetCallTrace returns only 3 frames in the sanity test, while GetStackTrace returns 11. The GetStackTrace trace conforms to the actual source code.

        GetStackTrace returns a stack trace like the following:

        ```
        Frame 0: Native frame Lprofiling/sanity/ASGSTBaseTest;.checkAsyncGetStackTraceCall()Z
        Frame 1: Java frame Lprofiling/sanity/ASGSTBaseTest;.main([Ljava/lang/String;)V: 0
        Frame 2: Java frame Ljava/lang/invoke/LambdaForm$DMH.0x0000000801002000;.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;)V: 10
        Frame 3: Java frame Ljava/lang/invoke/LambdaForm$MH.0x0000000801003400;.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;: 33
        Frame 4: Java frame Ljava/lang/invoke/Invokers$Holder;.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;: 20
        Frame 5: Java frame Ljdk/internal/reflect/DirectMethodHandleAccessor;.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;: 55
        Frame 6: Java frame Ljdk/internal/reflect/DirectMethodHandleAccessor;.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;: 23
        Frame 7: Java frame Ljava/lang/reflect/Method;.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;: 102
        Frame 8: Java frame Lcom/sun/javatest/regtest/agent/MainWrapper$MainThread;.run()V: 134
        Frame 9: Java frame Ljava/lang/Thread;.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V: 5
        Frame 10: Java frame Ljava/lang/Thread;.run()V: 19
        ```

        AsyncGetCallTrace returns:

        ```
        Frame 0: Native frame Lprofiling/sanity/ASGSTBaseTest;.checkAsyncGetStackTraceCall()Z
        Frame 1: Java frame Lprofiling/sanity/ASGSTBaseTest;.main([Ljava/lang/String;)V: 0
        Frame 2: Java frame Ljava/lang/invoke/LambdaForm$DMH.0x0000000801002000;.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;)V: 10
        ```

        This is related to a bug in `frame::is_safe_for_sender` which is already fixed on PPC (https://bugs.openjdk.org/browse/JDK-8209996) but is still present on x86, albeit only for AsyncGetCallTrace and not for JFR.

        The issue itself first appeared with the implementation of JDK-8271820 which altered the implementation of Java reflection which is used by the JTREG test runner. So it might affect other code that uses reflection heavily.

        This test error occurs when checking for the length of the returned traces in the sanity test (see https://github.com/parttimenerd/jdk/commit/98fe63f42f5a3d5ec9fd151b034dfeb3ef767afd).

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

                Created:
                Updated:
                Resolved: