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

JVM crashes on repeated access to a MethodHandle linking to Object.hashCode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8u251, 9, 10, 11, 12
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      A DESCRIPTION OF THE PROBLEM :
      Creating a MethodHandle linking to java.lang.Object.hashCode() and invoking it more than about 12000 times in a row causes the JVM to crash. Seems to work fine on Java SE 14.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      The issue can be reproduced by running the attached code.


      ---------- BEGIN SOURCE ----------
        MethodHandle hashCode =
                  MethodHandles.lookup().findVirtual(Object.class, "hashCode", MethodType.methodType(int.class));
        
        for (int i = 0; i < 100000; i++)
            hashCode.invoke(new String());
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thartmann Tobias Hartmann
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: