Bad assert in OuterStripMinedLoopNode::transform_to_counted_loop?
Matthias Ernst
matthias at mernst.org
Thu Jan 2 16:11:23 UTC 2025
In fact, the assertion can be triggered by just this code:
import static java.lang.foreign.ValueLayout.JAVA_LONG;
import java.lang.foreign.Arena;
import java.lang.foreign.MemorySegment;
public class Repro {
static final int COUNT = 100000;
static final MemorySegment segment = Arena.global().allocate(JAVA_LONG,
COUNT);
public static void main(String[] args) {
var i = 0;
var j = 0;
while (i < COUNT) {
segment.setAtIndex(JAVA_LONG, i++, 0);
segment.setAtIndex(JAVA_LONG, j++, 0);
}
}
}
On Tue, Dec 31, 2024 at 13:26 Matthias Ernst <matthias at mernst.org> wrote:
> Hi, I've come across an assertion tripping in JDK debug builds (24,
> latest, not 23) in combination with new foreign memory apis. Product builds
> seem to be functioning ok:
>
> # Internal Error (src/hotspot/share/opto/loopnode.cpp:3196), pid=27, tid=44
> # Error: assert(!loop->_body.contains(in)) failed
>
>
> I've been able to narrow it down somewhat, repro code/data as well as
> crash logs can be found here:
> https://github.com/mernst-github/repro/tree/main/loopnode-assertion (this
> was originally a standard `quicksort` on top of a MemorySegment).
>
> I have not been able to discover anything more systematic. Small changes
> to the input data, or using a heap array instead of a MemorySegment make
> the issue go away.
>
> Cheers
> Matthias
> (PS: lmk if this is not an opportune place to report such an issue)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-compiler-dev/attachments/20250102/cd254454/attachment.htm>
More information about the hotspot-compiler-dev
mailing list