[lworld+vector] RFR: 8320815: [lworld+vector] Fix vector API jtreg crashes with "-XX:InlineFieldMaxFlatSize=0"
Xiaohong Gong
xgong at openjdk.org
Thu Dec 7 03:52:57 UTC 2023
On Thu, 7 Dec 2023 03:39:44 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
> Hi @XiaohongGong ,
>
> I am seeing following assertion failures in Vector API JTREG tests with flattening disabled, not yet spent time in root causing it.
>
> ```
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error (/home/jatinbha/sandboxes/lworld+vector/valhalla/src/hotspot/share/opto/narrowptrnode.cpp:45), pid=342594, tid=342623
> # assert(t->isa_narrowoop()) failed: only narrowoop here
> #
> # JRE version: OpenJDK Runtime Environment (22.0) (fastdebug build 22-internal-adhoc.root.valhalla)
> # Java VM: OpenJDK 64-Bit Server VM (fastdebug 22-internal-adhoc.root.valhalla, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
> # Problematic frame:
> # V [libjvm.so+0x14a9044] DecodeNNode::Value(PhaseGVN*) const+0x124
> #
> # 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 /home/jatinbha/sandboxes/lworld+vector/valhalla/build/linux-x86_64-server-fastdebug/test-support/jtreg_test_jdk_jdk_incubator_vector/scratch/1/core.342594)
> #
> # An error report file with more information is saved as:
> # /home/jatinbha/sandboxes/lworld+vector/valhalla/build/linux-x86_64-server-fastdebug/test-support/jtreg_test_jdk_jdk_incubator_vector/scratch/1/hs_err_pid342594.log
> #
> # Compiler replay data is saved as:
> # /home/jatinbha/sandboxes/lworld+vector/valhalla/build/linux-x86_64-server-fastdebug/test-support/jtreg_test_jdk_jdk_incubator_vector/scratch/1/replay_pid342594.log
> #
> # If you would like to submit a bug report, please visit:
> # https://bugreport.java.com/bugreport/crash.jsp
> #
> ```
Thanks for reporting this issue. Seems the workaround for `VectorBox` in `LoadNode::Identity()` is not right, that if the value is `InlineType` field of `VectorBox`, it returned the `InlineType` not rightly. We should do nothing for such cases. Could you please help check whether it can be fixed by applying following change:
diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp
index d88ff398e..3ecf780a7 100644
--- a/src/hotspot/share/opto/memnode.cpp
+++ b/src/hotspot/share/opto/memnode.cpp
@@ -1251,12 +1251,13 @@ Node* LoadNode::Identity(PhaseGVN* phase) {
offset > oopDesc::klass_offset_in_bytes()) {
Node* value = base->as_InlineType()->field_value_by_offset((int)offset, true);
if (value != nullptr) {
- if (Opcode() == Op_LoadN && !base->is_VectorBox()) {
+ if (Opcode() != Op_LoadN) {
+ return value;
+ } else if (!base->is_VectorBox()) {
// Encode oop value if we are loading a narrow oop
assert(!phase->type(value)->isa_narrowoop(), "should already be decoded");
- value = phase->transform(new EncodePNode(value, bottom_type()));
+ return phase->transform(new EncodePNode(value, bottom_type()));
}
- return value;
}
}
Thanks so much in advance!
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/958#issuecomment-1844223541
More information about the valhalla-dev
mailing list