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

SEGV in very large arrays of inline classes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      A segv occurs when accessing element 0 of a very large
      array of inline classes.

      public class BugOpt2 {

          public static void main(String[] args) {
              BNode<Integer, Integer>[] table = new BNode[0x40000000];
              Object k = table[0].key;
              hash(k);
          }

          /**
           * Basic hash bin node.
           */
          static inline class BNode<K,V> {
              final K key;
              final V value;

              BNode(K key, V value) {
                  this.key = key;
                  this.value = value;
              }
          }

          static final int hash(Object key) {
              int h;
              return (key == null) ? 0 : (h = key.hashCode()) ^ (h >>> 16);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dsimms David Simms
                Reporter:
                rriggs Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: