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

ClassLoaderData::loaded_classes_do fails with "assert(ZAddress::is_marked(addr)) failed: Should be marked"

XMLWordPrintable

    • b14
    • x86_64
    • os_x_10.15

      The following test failed in the JDK16 CI:

      runtime/cds/appcds/dynamicArchive/methodHandles/MethodHandlesAsCollectorTest.java

      Here's a snippet from the log file:

      [69.311s][info ][class,load] java.lang.invoke.LambdaForm$MH/0x0000000801d67840 source: __JVM_LookupDefineClass__
      [69.311s][debug][class,load] klass: 0x0000000801d67840 super: 0x0000000800007430 loader: [loader data: 0x00007ff86855d5c0 of 'bootstrap' has a class holder] bytes: 2558 checksum: 5c1e7991
      [69.325s][info ][class,load] java.util.IdentityHashMap$IdentityHashMapIterator source: shared objects file
      [69.325s][debug][class,load] klass: 0x000000080031f408 super: 0x0000000800007430 interfaces: 0x000000080008a700 loader: [loader data: 0x00007ff8cbd0ea20 of 'bootstrap']
      [69.332s][info ][class,load] java.util.IdentityHashMap$KeyIterator source: shared objects file
      [69.332s][debug][class,load] klass: 0x000000080031f180 super: 0x000000080031f408 loader: [loader data: 0x00007ff8cbd0ea20 of 'bootstrap']
      # To suppress the following error report, specify this argument
      # after -XX: or in .hotspotrc: SuppressErrorAt=/zBarrier.cpp:40
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/1a7cca38-e299-473e-97af-f3151e5423d5-S31285/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/dccaa9f7-deba-4ee0-892e-33474275f83a/runs/f3d248b9-8108-4afd-8824-077b6401f827/workspace/open/src/hotspot/share/gc/z/zBarrier.cpp:40), pid=3018, tid=6403
      # assert(ZAddress::is_marked(addr)) failed: Should be marked
      #
      # JRE version: Java(TM) SE Runtime Environment (16.0+12) (fastdebug build 16-ea+12-438)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 16-ea+12-438, mixed mode, sharing, tiered, z gc, bsd-amd64)
      # Core dump will be written. Default location: core.3018
      #
      # An error report file with more information is saved as:
      # /System/Volumes/Data/mesos/work_dir/slaves/1a7cca38-e299-473e-97af-f3151e5423d5-S40302/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ef6e05d3-73de-41ce-8396-666ce5b8cefb/runs/a7c99aa1-90d2-4205-8e6f-9051ae0e0dbb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_runtime/scratch/2/hs_err_pid3018.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #
      ];
       stderr: []
       exitValue = 134

      JavaTest Message: JUnit Failure: test(MethodHandlesAsCollectorTest): Expected to get exit value of [0]

      Here's the crashing thread's stack:

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

      Current thread (0x00007ff8adc52a20): JavaThread "DestroyJavaVM" [_thread_in_vm, id=6403, stack(0x0000700006f10000,0x0000700007010000)]

      Stack: [0x0000700006f10000,0x0000700007010000], sp=0x000070000700f930, free space=1022k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x10aa6a5] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6d5
      V [libjvm.dylib+0x10aaddb] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b
      V [libjvm.dylib+0x570de2] report_vm_error(char const*, int, char const*, char const*, ...)+0x142
      V [libjvm.dylib+0x11187cb] unsigned long ZBarrier::mark<true, false, true>(unsigned long)+0x8b
      V [libjvm.dylib+0x5639] oop ZBarrier::barrier<&(ZBarrier::is_good_or_null_fast_path(unsigned long)), &(ZBarrier::load_barrier_on_oop_slow_path(unsigned long))>(oop volatile*, oop)+0x89
      V [libjvm.dylib+0x58c1] AccessInternal::PostRuntimeDispatch<ZBarrierSet::AccessBarrier<548948ull, ZBarrierSet>, (AccessInternal::BarrierType)2, 548948ull>::oop_access_barrier(void*)+0x81
      V [libjvm.dylib+0x4d7b9e] ClassLoaderData::loaded_classes_do(KlassClosure*)+0xde
      V [libjvm.dylib+0x4de17b] ClassLoaderDataGraph::unlocked_loaded_classes_do(KlassClosure*)+0x2b
      V [libjvm.dylib+0xd1d4dc] MetaspaceShared::link_and_cleanup_shared_classes(Thread*)+0x4c
      V [libjvm.dylib+0x101d70c] JavaThread::invoke_shutdown_hooks()+0x2c
      V [libjvm.dylib+0x101d952] Threads::destroy_vm()+0x1b2
      V [libjvm.dylib+0x9152bc] jni_DestroyJavaVM+0xec
      C [libjli.dylib+0x4ced] JavaMain+0xb2d
      C [libjli.dylib+0x7339] ThreadJavaMain+0x9
      C [libsystem_pthread.dylib+0x6109] _pthread_start+0x94
      C [libsystem_pthread.dylib+0x1b8b] thread_start+0xf

      While this is a crash in ZGC, it's more likely that the culprit
      is in ClassLoaderData::loaded_classes_do() so I'm starting
      this bug off in hotspot/runtime for initial triage.

            ccheung Calvin Cheung
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: