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

[JDK20/FFI_Jtreg] IndexOutOfBoundsException captured in VaListTest #17091

Closed
ChengJin01 opened this issue Apr 3, 2023 · 2 comments · Fixed by adoptium/aqa-tests#4489
Closed
Assignees
Labels
comp:vm jdk20 project:panama Used to track Project Panama related work test failure

Comments

@ChengJin01
Copy link

IndexOutOfBoundsException was captured in VaListTest.testVaListMemorySegment() on zLinux as follows:

 VaListTest$$Lambda$239/0x00000000c017bc68@b814d76c, a64): failure
java.lang.IndexOutOfBoundsException: Out of bound access on segment MemorySegment{ array: Optional.empty address:139847358506464 limit: 0 }; new offset = 0; new length = 4
        at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.outOfBoundException(AbstractMemorySegmentImpl.java:371)
        at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.apply(AbstractMemorySegmentImpl.java:357)
        at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.apply(AbstractMemorySegmentImpl.java:70)
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:124)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:448)
        at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.checkBounds(AbstractMemorySegmentImpl.java:346)
        at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.checkAccess(AbstractMemorySegmentImpl.java:311)
        at java.base/java.lang.invoke.VarHandleSegmentAsInts.checkAddress(VarHandleSegmentAsInts.java:81)
        at java.base/java.lang.invoke.VarHandleSegmentAsInts.get(VarHandleSegmentAsInts.java:108)
        at java.base/java.lang.foreign.MemorySegment.get(MemorySegment.java:1552)
        at VaListTest.lambda$pointers$16(VaListTest.java:244) <--------
        at VaListTest.testVaListMemorySegment(VaListTest.java:267) <----------
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)

against the test code at
https://github.com/ibmruntimes/openj9-openjdk-jdk20/blob/9fcbd19b761da90ae3d1fc9b8692c63e8267d5b7/test/jdk/java/foreign/valist/VaListTest.java#L244

    public static Object[][] pointers() {
        Function<ValueLayout.OfAddress, Function<VaList, Integer>> getIntJavaFact = layout ->
                list -> {
                    MemorySegment ma = list.nextVarg(layout);
                    return ma.get(JAVA_INT, 0); <---------
                };

FYI: @tajila, @pshipton

@ChengJin01 ChengJin01 self-assigned this Apr 3, 2023
@ChengJin01 ChengJin01 added comp:vm project:panama Used to track Project Panama related work test failure jdk20 labels Apr 3, 2023
@ChengJin01
Copy link
Author

ChengJin01 commented Apr 3, 2023

This is likely due to the new changes in JDK20 in which MemoryAddress was replaced with MemorySegment. In such case, list.nextVarg on zLinux somehow returns a zero-sized MemorySegment which can't be directly accessed.

@ChengJin01
Copy link
Author

I will create a PR in aqa-test to exclude this test suite given everything related to VaList was totally removed in the latest JEP442 (Third Preview) mentioned at #16951 which means there is no need to resolve VaList related issue from now on.

ChengJin01 pushed a commit to ChengJin01/aqa-tests that referenced this issue Apr 3, 2023
The change exclude this test suite as we no longer
need VaList as specified in the latest JEP442 at
eclipse-openj9/openj9#16951

Fixes: #eclipse-openj9/openj9/issues/17091

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
ChengJin01 pushed a commit to ChengJin01/aqa-tests that referenced this issue Apr 3, 2023
The change exclude this test suite as we no longer
need VaList as specified in the latest JEP442 at
eclipse-openj9/openj9#16951

Fixes: eclipse-openj9/openj9/issues/17091

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
ChengJin01 pushed a commit to ChengJin01/aqa-tests that referenced this issue Apr 3, 2023
The change exclude this test suite as we no longer
need VaList as specified in the latest JEP442 at
eclipse-openj9/openj9#16951

Fixes: eclipse-openj9/openj9/issues/17091

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm jdk20 project:panama Used to track Project Panama related work test failure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant