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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 11
    • 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.

              ccheung Calvin Cheung
              ccheung Calvin Cheung
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: