-
Bug
-
Resolution: Fixed
-
P3
-
21, 22
-
b13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8315055 | 21.0.1 | Patricio Chilano Mateo | P3 | Resolved | Fixed | b09 |
The check in SharedRuntime::reresolve_call_site() "caller.is_compiled_frame() && !caller.is_deoptimized_frame()" fails when caller is Continuation.enterSpecial because it is a native method. This means that if the static callsite to Continuation.enter was patched to point to an nmethod and then the nmethod was marked non-entrant we will always call SharedRuntime::handle_wrong_method() thereafter when resolving Continuation.enter because the callsite will never be reset back to the clean state.
This issue was found after the following report in the loom-dev mailing list:
https://mail.openjdk.org/pipermail/loom-dev/2023-August/006083.html
Test from mail:
```
import java.util.concurrent.*;
public class Virt {
public static void main(String[] args) throws Exception {
while (true) {
ExecutorService e = Executors.newVirtualThreadPerTaskExecutor();
for (int i = 0; i < 100_000; i++) e.submit(Virt::task);
e.shutdown(); e.awaitTermination(100, TimeUnit.MINUTES);
}
}
static void task() { }
}
```
This issue was found after the following report in the loom-dev mailing list:
https://mail.openjdk.org/pipermail/loom-dev/2023-August/006083.html
Test from mail:
```
import java.util.concurrent.*;
public class Virt {
public static void main(String[] args) throws Exception {
while (true) {
ExecutorService e = Executors.newVirtualThreadPerTaskExecutor();
for (int i = 0; i < 100_000; i++) e.submit(Virt::task);
e.shutdown(); e.awaitTermination(100, TimeUnit.MINUTES);
}
}
static void task() { }
}
```
- backported by
-
JDK-8315055 SharedRuntime::handle_wrong_method() gets called too often when resolving Continuation.enter
- Resolved