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

Simpler example for JDI StackFrame.getArgumentValues JDWP error 32

    XMLWordPrintable

Details

    • x86_64
    • linux

    Description

      FULL PRODUCT VERSION :
      java version "1.7.0_51"
      OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02)
      OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux tux.cs.princeton.edu 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 23:48:56 EST 2014 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      I sent a bug request earlier this week with review ID "JI-9012167"

      In the mean time, I determined this bug (or an extremely similar bug) existed in Java 7, so it is not necessarily directly related to Lambdas or Java 8.

      As described in that previous bug, to reproduce it you have to use the "trace" package and add some calls to StackFrame.getArgumentValues().

      The new example incurs this error within stack frames corresponding to instance initializers for local and anonymous classes that capture a final local variable.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      As described in JI-9012167. However, use this code in place of the mini-program with the lambda expression:

      public class JWDP32 {
         public static void main(String[] args) {
            // x needs to be final, but not a compile-time constant
            final int x = Math.random() < 2 ? 42 : -42;
            Object anon = new Object(){int f(){return x;}};
            class Local{int g(){return x;}}
            Local loc = new Local();
         }
      }


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Should never cause an internal JDWP error when calling StackFrame.getArgumentValues()
      ACTUAL -
      Causes internal JDWP error 32 (INVALID_SLOT) in the instance initializer.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Same as previous report.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      See above, and instructions in previous report.
      ---------- END SOURCE ----------

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: