Compiler bugs
Cay Horstmann
cay.horstmann at gmail.com
Mon Mar 4 15:35:17 UTC 2024
Hi, I built the Valhalla image from https://github.com/openjdk/valhalla and get errors with very basic programs:
import java.lang.management.*;
value record Point(int x, int y) {}
public class Problem1 {
public static void main(String[] args) {
int NPOINTS = 100_000;
System.out.println(new Point(3, 4));
}
}
$ javac Problem1.java
$ java Problem1
Exception in thread "main" java.lang.IncompatibleClassChangeError: Value type Point has an identity type as supertype
value class Point {
int x;
int y;
Point(int x, int y) { this.x = x; this.y = y; }
}
public class Problem2 {
public static void main(String[] args) {
int NPOINTS = 100_000;
Point[] ps = new Point[NPOINTS];
for (int i = 0; i < ps.length; i++) {
ps[i] = new Point(i, i);
}
}
}
# SIGSEGV (0xb) at pc=0x00007f27b82c9570, pid=111935, tid=111936
#
# JRE version: OpenJDK Runtime Environment (22.0) (build 22-internal-adhoc.cay.valhalla)
# Java VM: OpenJDK 64-Bit Server VM (22-internal-adhoc.cay.valhalla, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# J 6 c2 Point.<init>(II)V (15 bytes) @ 0x00007f27b82c9570 [0x00007f27b82c94a0+0x00000000000000d0]
#
Are you interested in getting such reports, or is the implementation known to be unstable right now?
Cheers,
Cay
--
Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com
More information about the valhalla-spec-observers
mailing list