-
Bug
-
Resolution: Fixed
-
P3
-
11, 17, 20, 21
-
b26
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8322635 | 21.0.3 | Jaroslav Bachorík | P3 | Resolved | Fixed | b01 |
JDK-8322689 | 17.0.11 | Jaroslav Bachorík | P3 | Resolved | Fixed | b01 |
JDK-8322690 | 11.0.23 | Jaroslav Bachorík | P3 | Resolved | Fixed | b01 |
I know that jmethodID is by spec guranteed to be valid only while the declaring class is strongly referenced but that condition is rarely met in practice. There is actually quite a lot of code around making it possible to use a jmethodID even if the declaring class is gone - one would not get any information for such jmethodID but it is not supposed to crash JVM when used.
The crash has the following trace
```
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f3f86175daf, pid=3423779, tid=3423802
#
# JRE version: OpenJDK Runtime Environment Temurin-20.0.1+9 (20.0.1+9) (build 20.0.1+9)
# Java VM: OpenJDK 64-Bit Server VM Temurin-20.0.1+9 (20.0.1+9, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, parallel gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xc46daf] Method::checked_resolve_jmethod_id(_jmethodID*)+0xf
#
# Core dump will be written. Default location: /usr/local/app/core.3423779
#
# JFR recording file will be written. Location: /usr/local/app/hs_err_pid3423779.jfr
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
#
```
Attaching full log for posterity.
- backported by
-
JDK-8322635 Accessing jmethodID might lead to spurious crashes
- Resolved
-
JDK-8322689 Accessing jmethodID might lead to spurious crashes
- Resolved
-
JDK-8322690 Accessing jmethodID might lead to spurious crashes
- Resolved
- links to
-
Commit openjdk/jdk11u-dev/53824e58
-
Commit openjdk/jdk17u-dev/32fc8a25
-
Commit openjdk/jdk21u-dev/636607b6
-
Commit openjdk/jdk/cdd1a6e8
-
Review openjdk/jdk11u-dev/2321
-
Review openjdk/jdk17u-dev/2001
-
Review openjdk/jdk21u-dev/56
-
Review openjdk/jdk21u/411
-
Review openjdk/jdk/15171
-
Review openjdk/jdk/16662