-
Bug
-
Resolution: Fixed
-
P3
-
19
-
b19
-
riscv
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8311697 | 17.0.9 | Fei Yang | P3 | Resolved | Fixed | b01 |
Following testcases fail with -XX:+UseRVV after JDK-8284863:
test/hotspot/jtreg/compiler/vectorapi/VectorCastShape128Test.java
test/hotspot/jtreg/compiler/vectorapi/VectorCastShape64Test.java
test/hotspot/jtreg/compiler/vectorapi/VectorMaskCastTest.java
test/hotspot/jtreg/compiler/vectorapi/VectorMaskLoadStoreTest.java
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000400214b604, pid=47220, tid=47271
#
# JRE version: OpenJDK Runtime Environment (19.0) (build 19-internal-adhoc.zhuyanhong.jdk)
# Java VM: OpenJDK 64-Bit Server VM (19-internal-adhoc.zhuyanhong.jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-riscv64)
# Problematic frame:
# V [libjvm.so+0x7de604] LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle const&, int, Bytecodes::Code, JavaThread*)+0x440
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/zhuyanhong/jdk/JTwork/compiler/vectorapi/VectorMaskCastTest/core.47220)
#
The root cause of this problem is that special registers were allocated as temporary registers in C2.
We add `guarantee(tmp != x27, "Use Special Register x27");` in `C2_MacroAssembler::count_positives_v`, and the error log turns out x27 is allocated for temp:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (c2_MacroAssembler_riscv.cpp:1546), pid=45749, tid=45834
# guarantee(tmp != x27) failed: Use Special Register x27
#
# JRE version: OpenJDK Runtime Environment (19.0) (build 19-internal-adhoc.zhuyanhong.jdk)
# Java VM: OpenJDK 64-Bit Server VM (19-internal-adhoc.zhuyanhong.jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-riscv64)
# Problematic frame:
# V [libjvm.so+0x36fdfc] C2_MacroAssembler::count_positives_v(RegisterImpl const*, RegisterImpl const*, RegisterImpl const*, RegisterImpl const*)+0x23a
x27 is used for heapbase, special registers should not allocated as a tmp register. Similar issue also exists in several other C2 instructs for riscv.
test/hotspot/jtreg/compiler/vectorapi/VectorCastShape128Test.java
test/hotspot/jtreg/compiler/vectorapi/VectorCastShape64Test.java
test/hotspot/jtreg/compiler/vectorapi/VectorMaskCastTest.java
test/hotspot/jtreg/compiler/vectorapi/VectorMaskLoadStoreTest.java
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000400214b604, pid=47220, tid=47271
#
# JRE version: OpenJDK Runtime Environment (19.0) (build 19-internal-adhoc.zhuyanhong.jdk)
# Java VM: OpenJDK 64-Bit Server VM (19-internal-adhoc.zhuyanhong.jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-riscv64)
# Problematic frame:
# V [libjvm.so+0x7de604] LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle const&, int, Bytecodes::Code, JavaThread*)+0x440
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/zhuyanhong/jdk/JTwork/compiler/vectorapi/VectorMaskCastTest/core.47220)
#
The root cause of this problem is that special registers were allocated as temporary registers in C2.
We add `guarantee(tmp != x27, "Use Special Register x27");` in `C2_MacroAssembler::count_positives_v`, and the error log turns out x27 is allocated for temp:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (c2_MacroAssembler_riscv.cpp:1546), pid=45749, tid=45834
# guarantee(tmp != x27) failed: Use Special Register x27
#
# JRE version: OpenJDK Runtime Environment (19.0) (build 19-internal-adhoc.zhuyanhong.jdk)
# Java VM: OpenJDK 64-Bit Server VM (19-internal-adhoc.zhuyanhong.jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-riscv64)
# Problematic frame:
# V [libjvm.so+0x36fdfc] C2_MacroAssembler::count_positives_v(RegisterImpl const*, RegisterImpl const*, RegisterImpl const*, RegisterImpl const*)+0x23a
x27 is used for heapbase, special registers should not allocated as a tmp register. Similar issue also exists in several other C2 instructs for riscv.
- backported by
-
JDK-8311697 riscv: should not allocate special register for temp
- Resolved
- relates to
-
JDK-8284863 riscv: missing side effect for result in instruct vcount_positives
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/966fc82d
-
Commit openjdk/jdk/145dfed0
-
Commit openjdk/riscv-port-jdk11u/c7d3a44e
-
Review openjdk/jdk17u-dev/1427
-
Review openjdk/jdk/8283
-
Review openjdk/riscv-port-jdk11u/17
(3 links to)