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

has_extra_module_paths in filemap.cpp may be uninitialized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • b12

      https://github.com/openjdk/jdk/blame/50239716403732fe8af73b4b6f006b6a4b7b22db/src/hotspot/share/cds/filemap.cpp#L306

        bool has_extra_module_paths;
         if (!config->validate(header()->has_aot_linked_classes(), &has_extra_module_paths)) {

      The has_extra_module_paths variable is not always set by the config->validate() call. We should explicitly set it to false before calling validate().

      Proposed fix:
      $ git diff
      diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp
      index ab9fcd8621a..8d0cb0a73f5 100644
      --- a/src/hotspot/share/cds/filemap.cpp
      +++ b/src/hotspot/share/cds/filemap.cpp
      @@ -310,7 +310,7 @@ bool FileMapInfo::validate_class_location() {
         assert(CDSConfig::is_using_archive(), "runtime only");
       
         AOTClassLocationConfig* config = header()->class_location_config();
      - bool has_extra_module_paths;
      + bool has_extra_module_paths = false;
         if (!config->validate(header()->has_aot_linked_classes(), &has_extra_module_paths)) {
           if (PrintSharedArchiveAndExit) {
             MetaspaceShared::set_archive_loading_failed();

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: