RFR: 8353237: [AArch64] Incorrect result of VectorizedHashCode intrinsic on some hardware

Koutheir Attouchi duke at openjdk.org
Tue Apr 8 17:02:18 UTC 2025


On Tue, 8 Apr 2025 16:27:32 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> How can this bug be reproduced? Can you write a reproducer to attach to this PR?

I define a Java source file like this:

// A.java
public class A {
    public static void main(String[] args) {
        System.out.println("HelloWorld!");
    }
}


Then I build its class file on my computer (`javac A.java`). I transfer both files to [the Rock64 device](https://pine64.org/devices/rock64/) running Linux/AArch64, and I get the following behaviors.

First, the good behaviors:

# Load A.class:
$ jdk-25/bin/java A
HelloWorld!

# Compile A.java then load it:
$ jdk-25/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseVectorizedHashCodeIntrinsic A.java
HelloWorld!


Then, the wrong behavior:

$ jdk-25/bin/java A.java
An exception has occurred in the compiler ((version info not available)). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.NoClassDefFoundError: com/sun/tools/javac/jvm/ClassReader$AttributeReader
        at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.initAttributeReaders(ClassReader.java:885)
        at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.<init>(ClassReader.java:308)
        at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.instance(ClassReader.java:270)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.<init>(ClassFinder.java:186)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.instance(ClassFinder.java:178)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.<init>(JavaCompiler.java:400)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:129)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.<init>(JavacProcessingEnvironment.java:209)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.instance(JavacProcessingEnvironment.java:194)
        at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugins(BasicJavacTask.java:218)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.prepareCompiler(JavacTaskImpl.java:204)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.parseInternal(JavacTaskImpl.java:257)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.parse(JavacTaskImpl.java:248)
        at jdk.compiler/com.sun.tools.javac.launcher.ProgramDescriptor.of(ProgramDescriptor.java:71)
        at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:132)
        at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:76)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.jvm.ClassReader$AttributeReader
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
        ... 17 more
Exception in thread "main" java.lang.IllegalStateException: java.lang.NoClassDefFoundError: com/sun/tools/javac/jvm/ClassReader$AttributeReader
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.parse(JavacTaskImpl.java:252)
        at jdk.compiler/com.sun.tools.javac.launcher.ProgramDescriptor.of(ProgramDescriptor.java:71)
        at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:132)
        at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:76)
Caused by: java.lang.NoClassDefFoundError: com/sun/tools/javac/jvm/ClassReader$AttributeReader
        at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.initAttributeReaders(ClassReader.java:885)
        at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.<init>(ClassReader.java:308)
        at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.instance(ClassReader.java:270)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.<init>(ClassFinder.java:186)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.instance(ClassFinder.java:178)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.<init>(JavaCompiler.java:400)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:129)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.<init>(JavacProcessingEnvironment.java:209)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.instance(JavacProcessingEnvironment.java:194)
        at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugins(BasicJavacTask.java:218)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.prepareCompiler(JavacTaskImpl.java:204)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.parseInternal(JavacTaskImpl.java:257)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.parse(JavacTaskImpl.java:248)
        ... 3 more
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.jvm.ClassReader$AttributeReader
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
        ... 17 more


For reference:

$ jdk-25/bin/java -version
openjdk version "25-ea" 2025-09-16
OpenJDK Runtime Environment (build 25-ea+16-1816)
OpenJDK 64-Bit Server VM (build 25-ea+16-1816, mixed mode, sharing)

$ uname -a
Linux rock64-aarch64-2 6.13.5-3-aarch64-ARCH #1 SMP PREEMPT_DYNAMIC Wed Mar  5 18:09:23 MST 2025 aarch64 GNU/Linux

$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

$ cat /sys/devices/system/cpu/cpu0/regs/identification/revidr_el1
0x0000000000000180

# The erratum 835769 for Cortex A53 is fixed on this CPU:
$ python3
>>> (0x0000000000000180 >> 7) & 1
1

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24489#issuecomment-2787098570


More information about the hotspot-compiler-dev mailing list