Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueTypes: java.lang.ArrayIndexOutOfBoundsException ValueClassValidation.java #20983

Open
a7ehuo opened this issue Jan 21, 2025 · 3 comments
Open
Labels
comp:vm project:valhalla Used to track Project Valhalla related work

Comments

@a7ehuo
Copy link
Contributor

a7ehuo commented Jan 21, 2025

Failed Tests:

TEST: runtime/valhalla/inlinetypes/field_layout/ValueCompositionTest.java#ValueCompositionTest_atomic_flat_and_no_nullable_flat
TEST: runtime/valhalla/inlinetypes/field_layout/ValueCompositionTest.java#ValueCompositionTest_atomic_flat_and_nullable_flat
TEST: runtime/valhalla/inlinetypes/field_layout/ValueCompositionTest.java#ValueCompositionTest_no_atomic_flat_and_no_nullable_flat
TEST: runtime/valhalla/inlinetypes/field_layout/ValueCompositionTest.java#ValueCompositionTest_no_atomic_flat_and_nullable_flat

Running them with -Xint and observed java.lang.ArrayIndexOutOfBoundsException failure

--------------------------------------------------
TEST: runtime/valhalla/inlinetypes/field_layout/ValueCompositionTest.java#ValueCompositionTest_atomic_flat_and_no_nullable_flat
TEST JDK: /root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/linux-x86_64-server-release/images/jdk
...
...
Command line: [/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/linux-x86_64-server-release/images/jdk/bin/java -cp /root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/run-test-prebuilt/test-support/jtreg_test_hotspot_jtreg_hotspot_valhalla/classes/2/runtime/valhalla/inlinetypes/field_layout/ValueCompositionTest_ValueCompositionTest_atomic_flat_and_no_nullable_flat.d:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/test/hotspot/jtreg/runtime/valhalla/inlinetypes/field_layout:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/run-test-prebuilt/test-support/jtreg_test_hotspot_jtreg_hotspot_valhalla/classes/2/test/lib:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/test/lib:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/jtreg/lib/javatest.jar:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/jtreg/lib/jtreg.jar -XX:MaxRAMPercentage=8.33333 -Dtest.boot.jdk=/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/linux-x86_64-server-release/images/jdk -Djava.io.tmpdir=/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/run-test-prebuilt/test-support/jtreg_test_hotspot_jtreg_hotspot_valhalla/tmp --enable-preview -XX:ValueTypeFlatteningThreshold=99999 -XX:+EnableArrayFlattening -Xint -Djdk.debug=release --patch-module java.base=/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/linux-x86_64-server-release/jdk/lib/valueclasses/java.base-valueclasses.jar --enable-preview -Xint -XX:+UnlockDiagnosticVMOptions -XX:+PrintFieldLayout -Xshare:off -Xmx256m -XX:+AtomicFieldFlattening -XX:-NullableFieldFlattening -cp /root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/run-test-prebuilt/test-support/jtreg_test_hotspot_jtreg_hotspot_valhalla/classes/2/runtime/valhalla/inlinetypes/field_layout/ValueCompositionTest_ValueCompositionTest_atomic_flat_and_no_nullable_flat.d:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/test/hotspot/jtreg/runtime/valhalla/inlinetypes/field_layout:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/build/run-test-prebuilt/test-support/jtreg_test_hotspot_jtreg_hotspot_valhalla/classes/2/test/lib:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/test/lib:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/jtreg/lib/javatest.jar:/root/home/ahuo/src/openj9-openjdk-jdk.valuetypes/jtreg/lib/jtreg.jar:. ValueCompositionTest$TestRunner ]
[2025-01-21T18:11:56.729681505Z] Gathering output for process 1170568
[2025-01-21T18:11:56.786769481Z] Waiting for completion for process 1170568
[2025-01-21T18:11:57.045883013Z] Waiting for completion finished for process 1170568
Running test_4
Running test_3
Running test_2
Running test_1
Running test_0
Running test_8
Running test_7
Running test_6
Running test_5
STDERR:
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 9
        at java.base/java.util.Arrays$ArrayList.get(Arrays.java:4263)
        at FieldLayoutAnalyzer$LogOutput.getCurrentLine(FieldLayoutAnalyzer.java:48)
        at FieldLayoutAnalyzer.generate(FieldLayoutAnalyzer.java:696)
        at FieldLayoutAnalyzer.createFieldLayoutAnalyzer(FieldLayoutAnalyzer.java:398)
        at ValueCompositionTest.main(ValueCompositionTest.java:366)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:571)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1458)

JavaTest Message: Test threw exception: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 9
JavaTest Message: shutting down test

JVM version

openjdk version "25-internal" 2025-09-16
OpenJDK Runtime Environment (build 25-internal-adhoc.root.openj9-openjdk-jdk.valuetypes)
Eclipse OpenJ9 VM (build master-eb9322941f4-eb9322941, JRE 25 Linux amd64-64-Bit Compressed References 20250117_000000 (JIT enabled, AOT enabled)
OpenJ9   - eb9322941
OMR      - 2767da3a2
JCL      - c154841cc67 based on jdk-25+5)
@a7ehuo a7ehuo added comp:vm project:valhalla Used to track Project Valhalla related work labels Jan 21, 2025
@a7ehuo
Copy link
Contributor Author

a7ehuo commented Jan 21, 2025

@hangshao0 @theresa-m @hzongaro fyi

@a7ehuo
Copy link
Contributor Author

a7ehuo commented Jan 21, 2025

I also observed ClassFormatError first with TEST: runtime/valhalla/inlinetypes/classfileparser/ValueClassValidation.java itself. I'm not sure if it is related to not.

STDOUT:
Testing: InvalidClassFlags
Testing: AbstractValue
STDERR:
java.lang.RuntimeException: Unexpected ClassFormatError: JVMCFRE202E version 68.65535 of class AbstractValue is an unsupported preview major version, runtime only allows 69.65535, try re-compiling the code with the same version of the runtime; offset=6
        at ValueClassValidation.runTest(ValueClassValidation.java:47)
        at ValueClassValidation.main(ValueClassValidation.java:74)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:571)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1458)

@theresa-m
Copy link
Contributor

I also observed ClassFormatError first with TEST: runtime/valhalla/inlinetypes/classfileparser/ValueClassValidation.java itself. I'm not sure if it is related to not.

STDOUT:
Testing: InvalidClassFlags
Testing: AbstractValue
STDERR:
java.lang.RuntimeException: Unexpected ClassFormatError: JVMCFRE202E version 68.65535 of class AbstractValue is an unsupported preview major version, runtime only allows 69.65535, try re-compiling the code with the same version of the runtime; offset=6
        at ValueClassValidation.runTest(ValueClassValidation.java:47)
        at ValueClassValidation.main(ValueClassValidation.java:74)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:571)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1458)

The major version for value type classes was increased from 68 to 69 recently #20911. This error is likely related to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm project:valhalla Used to track Project Valhalla related work
Projects
None yet
Development

No branches or pull requests

2 participants