src/hotspot/share/classfile/classLoader.cpp
changeset 50254 61657d4a99e5
parent 50206 adec398d9051
child 50939 783cc906a5f8
--- a/src/hotspot/share/classfile/classLoader.cpp	Thu May 24 20:34:17 2018 +0530
+++ b/src/hotspot/share/classfile/classLoader.cpp	Thu May 24 09:15:09 2018 -0700
@@ -711,8 +711,11 @@
 void ClassLoader::update_module_path_entry_list(const char *path, TRAPS) {
   assert(DumpSharedSpaces, "dump time only");
   struct stat st;
-  int ret = os::stat(path, &st);
-  assert(ret == 0, "module path must exist");
+  if (os::stat(path, &st) != 0) {
+    tty->print_cr("os::stat error %d (%s). CDS dump aborted (path was \"%s\").",
+      errno, os::errno_name(errno), path);
+    vm_exit_during_initialization();
+  }
   // File or directory found
   ClassPathEntry* new_entry = NULL;
   new_entry = create_class_path_entry(path, &st, true /* throw_exception */,