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

jdb crashes when invoking "lock" command on inline class

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: core-svc
    • Labels:
      None

      Description

      1. Compile the sample test.
      2. Start jdb:
      $ jdb -classpath . Test
      3. Set breakpoint on the line with System.out.println()
      > stop at Test:6
      4. Run to breakpoint
      > run
      5. Print lock info for inline class instance 'v'
      >lock v

      Expected result:
      The output printed that inline class cannot own a lock

      Actual result:
      Monitor information for v ("[ValTest4$MyValue a=12 b=c]"):
      # To suppress the following error report, specify this argument
      # after -XX: or in .hotspotrc: SuppressErrorAt=/markWord.hpp:215
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/Users/datitov/src/valhalla/open/src/hotspot/share/oops/markWord.hpp:215), pid=15723, tid=39171
      # assert(!is_always_locked()) failed: invariant
      #
      # JRE version: Java(TM) SE Runtime Environment (15.0) (fastdebug build 15-lworldea+0-2020-06-12-1826154.datitov...)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 15-lworldea+0-2020-06-12-1826154.datitov..., mixed mode, sharing, tiered, compressed oops, g1 gc, bsd-amd64)
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # An error report file with more information is saved as:
      #
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bInternal exception during operation:
          null
      ugreport/cException in thread "asynchronous jdb command" rash.jsp
      #

      =====================================================
      public class Test {

          public static void main(String[] args){
              MyValue v = new MyValue(12,'c');
              System.out.println("v == v " + (v == v));
          }

          public inline static class MyValue {
              int a;
              char b;

              public MyValue(int a, char b){
                  this.a = a;
                  this.b = b;
              }

          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fparain Frederic Parain
                Reporter:
                dtitov Daniil Titov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: