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

    • Bug
    • Resolution: Fixed
    • P4
    • 9
    • None
    • hotspot
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: