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

[aarch64] JDK8 single-step debugging is extremely slow

XMLWordPrintable

    • b02
    • aarch64
    • linux

        Debugging on linux-aarch64 platforms can be extremely slow (10x slower than jdk11) due to an unoptimal implementation of jvmti:post_method_exit, the method recalculates a stack depth on each call.
        ```
        void JvmtiExport::post_method_exit(JavaThread *thread, Method* method, frame current_frame) {
        ....
        #ifdef AARCH64
          // FIXME: this is just a kludge to get JVMTI going. Compiled
          // MethodHandle code doesn't call the JVMTI notify routines, so the
          // stack depth we see here is wrong.
          state->invalidate_cur_stack_depth();
        #else
          state->decr_cur_stack_depth();
        #endif
        }
        ```
        It seems this code is not correct anymore, since nothing similar exists in jdk11+

        This bug exists since the merge of jdk8 aarch64 port into jdk8u repo.

        To reproduce:
        1. Build attached application with maven: "mvn package"
        2. Run it in debugger mode: "java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:5555,suspend=y,server=y -jar target/maventest-0.0.1-SNAPSHOT-jar-with-dependencies.jar"
        3. Attach debugger from separate console: "jdb -attach localhost:5555"
        3.1 Set a breakpoint at main function: "stop in Main.main"
        3.2. Continue execution: "cont"
        3.3. When the breapoint hits, issue several step-over commands, the second one will take around 30 seconds to complete.

              snazarki Sergey Nazarkin
              snazarki Sergey Nazarkin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: