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

Improve error handling when specified dynamic archive doesn't exist

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 14
    • 13
    • hotspot
    • b25

      See http://hg.openjdk.java.net/jdk/jdk/file/d3382812b788/src/hotspot/share/memory/dynamicArchive.cpp#l1070

      Currently only a warning is printed. Should we be more strict and give an error instead?

      address DynamicArchive::map() {
        assert(UseSharedSpaces, "Sanity");

        // Create the dynamic archive map info
        FileMapInfo* mapinfo;
        const char* filename = Arguments::GetSharedDynamicArchivePath();
        struct stat st;
        address result;
        if ((filename != NULL) && (os::stat(filename, &st) == 0)) {
          mapinfo = new FileMapInfo(false);
          if (!mapinfo->open_for_read(filename)) {
            result = NULL;
          }
          result = map_impl(mapinfo);
          if (result == NULL) {
            map_failed(mapinfo);
            mapinfo->restore_shared_path_table();
          }
        } else {
          if (filename != NULL) {
            log_warning(cds, dynamic)("specified dynamic archive doesn't exist: %s", filename);
          }
          result = NULL;
        }
        return result;
      }

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

              Created:
              Updated:
              Resolved: