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

Zip_lock can be uninitialized on some paths

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P4
    • None
    • 17, 21, 22
    • hotspot

    Description

      Found this with JDK-8313202.

      Easiest way to reproduce is to add the assert to ClassLoader::release_load_zip_library():

      ```
      void ClassLoader::release_load_zip_library() {
        assert(Zip_lock != nullptr, "Must be");
        MutexLocker locker(Zip_lock, Monitor::_no_safepoint_check_flag);
      ```

      ...and run:

      ```
      $ CONF=macosx-aarch64-server-slowdebug make test TEST=runtime/cds/appcds/SharedArchiveConsistency.java
      ...
      TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Hotspot crashed
      ```

      In the hs_err from the test, you could see the stack trace:

      ```
      $ vi ./build/macosx-aarch64-server-slowdebug/test-support/jtreg_test_hotspot_jtreg_runtime_cds_appcds_SharedArchiveConsistency_java/runtime/cds/appcds/SharedArchiveConsistency/hs_err_pid20768.log

      Stack: [0x000000016f510000,0x000000016f713000], sp=0x000000016f712770, free space=2057k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x137d4ec] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x93c (classLoader.cpp:932)
      V [libjvm.dylib+0x137db7c] VMError::report_and_die(Thread*, char const*, int, unsigned long, VMErrorType, char const*, char*)+0x0
      V [libjvm.dylib+0x6131a0] print_error_for_unit_test(char const*, char const*, char*)+0x0
      V [libjvm.dylib+0x505964] ClassLoader::release_load_zip_library()+0x58
      V [libjvm.dylib+0xb7b890] ClassLoader::load_zip_library_if_needed()+0x28
      V [libjvm.dylib+0x505d40] ClassLoader::crc32(int, char const*, int)+0x1c
      V [libjvm.dylib+0x7d6bd4] FileMapHeader::compute_crc()+0x54
      V [libjvm.dylib+0x7d792c] FileHeaderHelper::check_header_crc() const+0x40
      V [libjvm.dylib+0x7d2a54] FileHeaderHelper::initialize(int)+0x378
      V [libjvm.dylib+0x7d1dbc] FileHeaderHelper::initialize()+0xe8
      V [libjvm.dylib+0x7d1b00] FileMapInfo::get_base_archive_name_from_header(char const*, char**)+0x3c
      V [libjvm.dylib+0x2a1b2c] Arguments::init_shared_archive_paths()+0x268
      V [libjvm.dylib+0x2a18b8] Arguments::set_shared_spaces_flags_and_archive_paths()+0x84
      V [libjvm.dylib+0x2a3908] Arguments::apply_ergo()+0x58
      V [libjvm.dylib+0x12d3360] Threads::create_vm(JavaVMInitArgs*, bool*)+0x104
      V [libjvm.dylib+0xb37a90] JNI_CreateJavaVM_inner(JavaVM_**, void**, void*)+0xcc
      V [libjvm.dylib+0xb379b0] JNI_CreateJavaVM+0x30
      C [libjli.dylib+0xe2e8] InitializeJVM+0x160
      C [libjli.dylib+0xc830] JavaMain+0xbc
      C [libjli.dylib+0x13418] ThreadJavaMain+0x18
      C [libsystem_pthread.dylib+0x6fa8] _pthread_start+0x94
      ```

      Attachments

        Issue Links

          Activity

            People

              minqi Yumin Qi
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: