-
Bug
-
Resolution: Fixed
-
P4
-
11, 17, 21, 22, 23, 24
-
b13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8340958 | 23.0.2 | Matias Saavedra Silva | P4 | Resolved | Fixed | b01 |
JDK-8340953 | 21.0.6-oracle | Matias Saavedra Silva | P4 | Resolved | Fixed | b01 |
JDK-8341323 | 21.0.6 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
Affected:
JDK23 - JDK11, maybe further back (did not check more).
Product gives us:
Error: Unable to initialize main class TestClassNew
Caused by: java.lang.LinkageError: Illegal class file encountered. Try running with -Xverify:all in method main
Debug reproduces/asserts immediately.
emanuel@emanuel-oracle:xyz$ java -jar ~/Documents/asmtools-7.0-build/release/lib/asmtools.jar jasm Test.jasm
emanuel@emanuel-oracle:xyz$ /oracle-work/jdk-fork2/build/linux-x64-debug/jdk/bin/java Test
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/oracle-work/jdk-fork2/open/src/hotspot/share/oops/generateOopMap.cpp:401), pid=3707675, tid=3707676
# assert(bci>= 0 && bci < c->method()->code_size()) failed: index out of bounds
#
# JRE version: Java(TM) SE Runtime Environment (24.0) (fastdebug build 24-internal-2024-06-13-1913126.emanuel...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-internal-2024-06-13-1913126.emanuel..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xd5b5c8] GenerateOopMap::bb_mark_fct(GenerateOopMap*, int, int*) [clone .part.0]+0x28
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /oracle-work/???/files-for-report/24-13/core.3707675)
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
bci = 39, c->method()->code_size() = 39
We are at bci 36, where the jsr bytecode is. Then, we want to step the length of that bytecode forward, i.e. +3, and mark the bci there as a block header. But that is the end of the code, i.e. there is nothing after the jsr.
I extracted a simple JASM test:
super public class Test
{
public static Method main:"([Ljava/lang/String;)V"
stack 100 locals 100
{
return;
LABEL:
nop;
jsr LABEL; // bci=2. Compute bci + length(jsr) -> bci = 5 accessed, out of bounds.
}
}
- backported by
-
JDK-8340953 Parsing jsr broken: assert(bci>= 0 && bci < c->method()->code_size()) failed: index out of bounds
- Resolved
-
JDK-8340958 Parsing jsr broken: assert(bci>= 0 && bci < c->method()->code_size()) failed: index out of bounds
- Resolved
-
JDK-8341323 Parsing jsr broken: assert(bci>= 0 && bci < c->method()->code_size()) failed: index out of bounds
- Resolved
- relates to
-
JDK-8283441 C2: segmentation fault in ciMethodBlocks::make_block_at(int)
- Resolved
-
JDK-8338924 C1: assert(0 <= i && i < _len) failed: illegal index 5 for length 5
- Resolved
- links to
-
Commit(master) openjdk/jdk21u-dev/dd13bf68
-
Commit(master) openjdk/jdk23u/caf28d4a
-
Commit(master) openjdk/jdk/6041c936
-
Review(master) openjdk/jdk21u-dev/1012
-
Review(master) openjdk/jdk23u/109
-
Review(master) openjdk/jdk/20645