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

Object references from expression stack are not visible as roots via jvmti FollowReferences and HeapDump

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b04

      Description

      The function FollowReference should do a traversal over all objects that are reachable from the heap roots.
      However, references from the expression stack are not considered.
      Executing the following code and initiating FollowReferences at a breakpoint in the Function getIntAndWait(),
      no instance of MyTestClass will be found.
       
         public static void main(String[] args) {
              setUp(MyTestClass.class);
              int sum = sum (new MyTestClass( 3, 4, 5), getIntAndWait());
          }
       
      Triggering a HeapDump in getIntAndWait(), the instance of MyTestClass will be shown as unreachable.
       
      I add a test consisting of a java file, the source for a jvmti agent that initiates the heap walk and a make file.
      The test can be run by gnumake JDK=<path to jdk> OSNAME=linux OPT=false test.
      The test will output
      Failed: No reference found!
      if the reference is not found via FollowRefences.
      In addition the test triggers a HeapDump, that can be inspected using appropriate tools.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              simonis Volker Simonis
              Reporter:
              simonis Volker Simonis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: