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

assert(is_aligned(class_space_rs.base(), class_space_alignment)) failed: Sanity

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 15
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b28

      Backports

        Description

        The following assert was observed in our CI/CD which can be reproduced by runtime/cds/appcds/SharedBaseAddress.java and runtime/cds/SharedBaseAddress.java
        ---------------------------------------------------------
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/data/workspace/jdk15/src/hotspot/share/memory/metaspaceShared.cpp:2543), pid=27502, tid=27505
        # assert(is_aligned(class_space_rs.base(), class_space_alignment)) failed: Sanity
        #
        # JRE version: (15.0) (fastdebug build )
        # Java VM: OpenJDK 64-Bit Server VM (fastdebug 15-internal+0-adhoc.root.jdk15, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0x118ad04] MetaspaceShared::reserve_address_space_for_archives(FileMapInfo*, FileMapInfo*, bool, ReservedSpace&, ReservedSpace&)+0x564
        ---------------------------------------------------------


        ```
        Stack: [0x00007fea99408000,0x00007fea99509000], sp=0x00007fea99507750, free space=1021k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x118ad04] MetaspaceShared::reserve_address_space_for_archives(FileMapInfo*, FileMapInfo*, bool, ReservedSpace&, ReservedSpace&)+0x564
        V [libjvm.so+0x118d86f] MetaspaceShared::map_archives(FileMapInfo*, FileMapInfo*, bool)+0xcf
        V [libjvm.so+0x118de53] MetaspaceShared::initialize_runtime_shared_and_meta_spaces()+0xc3
        V [libjvm.so+0x11842fd] Metaspace::global_initialize()+0x42d
        V [libjvm.so+0x16bf6fa] universe_init()+0xca
        V [libjvm.so+0xc1ccce] init_globals()+0x5e
        V [libjvm.so+0x167ddc7] Threads::create_vm(JavaVMInitArgs*, bool*)+0x287
        V [libjvm.so+0xd9a7a9] JNI_CreateJavaVM+0x99
        C [libjli.so+0x415a] JavaMain+0x8a
        C [libjli.so+0x7a39] ThreadJavaMain+0x9
        ```

        It might be fixed by:
        ```
        diff -r 1c81917f228b src/hotspot/share/memory/metaspaceShared.cpp
        --- a/src/hotspot/share/memory/metaspaceShared.cpp Fri Jun 12 14:33:20 2020 -0700
        +++ b/src/hotspot/share/memory/metaspaceShared.cpp Sat Jun 13 16:51:46 2020 +0800
        @@ -2502,8 +2502,8 @@
                  "CompressedClassSpaceSize malformed: "
                  SIZE_FORMAT, CompressedClassSpaceSize);

        - const size_t ccs_begin_offset = align_up(archive_space_size,
        - class_space_alignment);
        + const size_t ccs_begin_offset = align_up((size_t)base_address + archive_space_size,
        + class_space_alignment) - (size_t)base_address;
           const size_t gap_size = ccs_begin_offset - archive_space_size;

           const size_t total_range_size =
        ```

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jiefu Jie Fu
                  Reporter:
                  jiefu Jie Fu
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: