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

assert(o->is_oop_or_null()) failed: should always be an oop, at heapDumper.cpp:724

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P5
    • None
    • 8, 9
    • hotspot
    • gc

    Description

      When doing a heap dump with jmap or jcmd an assert can fail in jdk8 and 9.
      The assert fails because the heap dumper is trying to inspect an object that is dead.

      Unexpected Error
      ------------------------------------------------------------------------------
      Internal Error at heapDumper.cpp:724, pid=27154, tid=139872669280000
      assert(o->is_oop_or_null()) failed: should always be an oop

      Analysis from Mikael Gerdin:
      -------
      Object o1 in region r1 points to humongous object o2 in r2.
      o1 and o2 are not reachable.
      r2 is freed and later re-used for some other purpose.
      (since o2 is not evacuated the reference from o1 is not updated)
      r1 is considered expensive to evacuate and is kept around.

      A heap dump is requested, which performs object_iterate on all in-use regions.
      object_iterate provides a callback to the HeapDumper for each object, dead or
      alive.

      The HeapDumper iterates over all the fields of the object and at this point
      o1's reference field which used to point to o2 can now point to arbitrary heap
      memory.
      --------

      Loading and decoding the oop is fine, but the assert will fail.
      In product builds nothing bad will happen, except that the hprof file will have a strange pointer in it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aeriksso Andreas Eriksson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: