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

assert(verify_field_bit(1)) failed: Attempting to write an uninitialized event field: type

    XMLWordPrintable

Details

    • jfr
    • b01
    • generic
    • generic

    Description

      This issue can always reproduced by running the following two jtreg tests with 8u debug build:
          jdk/jfr/event/gc/collection/TestGCEventMixedWithG1ConcurrentMark.java
          jdk/jfr/event/gc/collection/TestGCEventMixedWithG1FullCollection.java

      I think the reason is that we are not setting trace type for EventG1HeapRegionInformation event.

      Proposed 8u fix:
      diff -r caca9fa8d833 src/share/vm/gc_implementation/g1/g1HeapRegionEventSender.cpp
      --- a/src/share/vm/gc_implementation/g1/g1HeapRegionEventSender.cpp Tue Sep 03 10:03:13 2019 +0200
      +++ b/src/share/vm/gc_implementation/g1/g1HeapRegionEventSender.cpp Thu Apr 01 10:51:58 2021 +0800
      @@ -33,7 +33,7 @@
         bool doHeapRegion(HeapRegion* r) {
           EventG1HeapRegionInformation evt;
           evt.set_index(r->hrm_index());
      - // XXX TODO evt.set_type(r->get_trace_type());
      + evt.set_type(r->get_trace_type());
           evt.set_start((uintptr_t)r->bottom());
           evt.set_used(r->used());
           evt.commit();


      $ jtreg -othervm jdk/test/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1FullCollection.java

      HotSpot JVM crash log:

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (../generated/jfrfiles/jfrEventClasses.hpp:9049), pid=10113, tid=0x0000fffdda12f1f0
      # assert(verify_field_bit(1)) failed: Attempting to write an uninitialized event field: type
      #
      # JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-internal-debug-yangfei_2021_04_01_09_48-b00)
      # Java VM: OpenJDK 64-Bit Server VM (25.71-b00-debug mixed mode linux-aarch64 compressed oops)
      # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #

      --------------- T H R E A D ---------------

      Current thread (0x0000ffff802b2800): VMThread [stack: 0x0000fffdd9f30000,0x0000fffdda130000] [id=10214]

      Stack: [0x0000fffdd9f30000,0x0000fffdda130000], sp=0x0000fffdda12dec0, free space=2039k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xd00a64] VMError::report_and_die()+0x4dc
      V [libjvm.so+0x5e7c2c] report_vm_error(char const*, int, char const*, char const*)+0x84
      V [libjvm.so+0x6eb5d0] EventG1HeapRegionInformation::verify() const+0xa0
      V [libjvm.so+0x6ebaa4] JfrEvent<EventG1HeapRegionInformation>::assert_precondition()+0x14
      V [libjvm.so+0x6eb9d4] JfrEvent<EventG1HeapRegionInformation>::write_event()+0x14
      V [libjvm.so+0x6eb8e8] JfrEvent<EventG1HeapRegionInformation>::commit()+0xdc
      V [libjvm.so+0x6eb6f0] DumpEventInfoClosure::doHeapRegion(HeapRegion*)+0x78
      V [libjvm.so+0x76a684] HeapRegionManager::iterate(HeapRegionClosure*) const+0xf4
      V [libjvm.so+0x6c2c78] G1CollectedHeap::heap_region_iterate(HeapRegionClosure*) const+0x20
      V [libjvm.so+0x6eb3b4] G1HeapRegionEventSender::send_events()+0x28
      V [libjvm.so+0x83d9dc] VM_G1SendHeapRegionInfoEvents::doit()+0x10
      V [libjvm.so+0xd359f8] VM_Operation::evaluate()+0x68
      V [libjvm.so+0xd32a90] VMThread::evaluate_operation(VM_Operation*)+0x3c
      V [libjvm.so+0xd3307c] VMThread::loop()+0x508
      V [libjvm.so+0xd325d8] VMThread::run()+0x124
      V [libjvm.so+0xb14ba8] java_start(Thread*)+0x1a8
      C [libpthread.so.0+0x7088] start_thread+0xb0

      VM_Operation (0x0000fffd9abf41a0): HeapIterateOperation, mode: safepoint, requested by thread 0x0000ffff80418000

      Attachments

        Activity

          People

            fyang Fei Yang
            fyang Fei Yang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: