-
Bug
-
Resolution: Fixed
-
P4
-
openjdk8u372
-
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.
```
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.