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

array index out of bound in FileMapInfo::check_paths

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 14, 15
    • Fix Version/s: 16
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b04

      Backports

        Description

        If the effective runtime classpath is shorter than the one during dump time, the rp_array could be indexed out of bound in FileMapInfo::check_paths.

        For example:
        dump time -cp: jar1:jar2
        run time -cp: jar1:jarX
        where jarX doesn't exist.

        It will fail the following assert during runtime:

        # Internal Error (/ws/jdk/open/src/hotspot/share/utilities/growableArray.hpp:231), pid=6988, tid=6991
        # assert(0 <= i && i < _len) failed: illegal index

        Stack: [0x00007fd8be8c6000,0x00007fd8be9c7000], sp=0x00007fd8be9c55d0, 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+0x6f0e95] GrowableArray<char const*>::at(int)+0x2b
        V [libjvm.so+0x81ab15] FileMapInfo::check_paths(int, int, GrowableArray<char const*>*)+0x63
        V [libjvm.so+0x81ae23] FileMapInfo::validate_app_class_paths(int)+0x133
        V [libjvm.so+0x81b420] FileMapInfo::validate_shared_path_table()+0x472
        V [libjvm.so+0xdd723d] MetaspaceShared::map_archive(FileMapInfo*, char*, ReservedSpace)+0x137
        V [libjvm.so+0xdd6418] MetaspaceShared::map_archives(FileMapInfo*, FileMapInfo*, bool)+0x4b2
        V [libjvm.so+0xdd5c48] MetaspaceShared::initialize_runtime_shared_and_meta_spaces()+0x90
        V [libjvm.so+0xdcc616] Metaspace::global_initialize()+0x48
        V [libjvm.so+0x10a80f2] universe_init()+0xb0
        V [libjvm.so+0x990bae] init_globals()+0x3d

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ccheung Calvin Cheung
                Reporter:
                ccheung Calvin Cheung
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: