Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266371

Memory segment bound check fails because of small segment optimizations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 16, repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      This test fails with a JVM crash:

      import jdk.incubator.foreign.MemoryAccess;
      import jdk.incubator.foreign.MemorySegment;
      import jdk.incubator.foreign.ResourceScope;

      class SIGSEGV {
          public static void main(String[] args) {
              MemorySegment memorySegment = MemorySegment.allocateNative(2147479552, ResourceScope.globalScope());
              MemoryAccess.getLongAtOffset(memorySegment, 8223372036854705800L);
          }
      }

      However, when executed with "-Djdk.incubator.foreign.SmallSegments=false", same tests fails with IndexOutOfBoundsException, as expected.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mcimadamore Maurizio Cimadamore
              Reporter:
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: