When running Apache Lucene tests on the branch to introduce memory segment support in Apache Lucene (for Java 19 with --enable-preview), we have seen the following error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (macroAssembler_x86.cpp:845), pid=3260852, tid=3260993
# fatal error: DEBUG MESSAGE: duplicated predicate failed which is impossible
#
# JRE version: OpenJDK Runtime Environment (19.0+27) (build 19-ea+27-2074)
# Java VM: OpenJDK 64-Bit Server VM (19-ea+27-2074, mixed mode, sharing, tiered, compressed class ptrs, serial gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xb6e5b1] MacroAssembler::debug64(char*, long, long*)+0x41
#
The used branch in Lucene is this one:
https://github.com/uschindler/lucene/tree/draft/jdk-foreign-mmap-jdk19
When digging into hs_err the following correlation to project panama seems to occur:
While hitting this error it looks like it compiles org.apache.lucene.codecs.lucene90.ForUtil::decode14 (code:
https://github.com/uschindler/lucene/blob/draft/jdk-foreign-mmap-jdk19/lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java#L726-L740).
This calls DataInput::readLong, implemented by MemorySegmentIndexInput (https://github.com/uschindler/lucene/blob/draft/jdk-foreign-mmap-jdk19/lucene/core/src/java19/org/apache/lucene/store/MemorySegmentIndexInput.java#L182-L194)
In standrad Lucene builds we have not seen this error, so it could really be related to project Panama.