assert in ClassLoader::update_module_path_entry_list() could have incorrect message

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 11
    • Affects Version/s: 11
    • Component/s: hotspot
    • b16

        There's the following assert in ClassLoader::update_module_path_entry_list() for making sure a module path exists.

            assert(ret == 0, "module path must exist");

        For a very long module path with length > 2K, the path exists but os::stat() returns ENAMETOOLONG error on linux.
        int os::stat(const char *path, struct stat *sbuf) {
          char pathbuf[MAX_PATH];
          if (strlen(path) > MAX_PATH - 1) {
            errno = ENAMETOOLONG; <<<<< here
            return -1;
          }
          os::native_path(strcpy(pathbuf, path));
          return ::stat(pathbuf, sbuf);
        }

        The assert should be replaced with an error message and the CDS dumping should be aborted.

              Assignee:
              Calvin Cheung (Inactive)
              Reporter:
              Calvin Cheung (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: