76 77 // Complain and continue. Recoverable errors during the reading of the 78 // archive file may continue (with sharing disabled). 79 // 80 // If we continue, then disable shared spaces and close the file. 81 82 void FileMapInfo::fail_continue(const char *msg, ...) { 83 va_list ap; 84 va_start(ap, msg); 85 MetaspaceShared::set_archive_loading_failed(); 86 if (PrintSharedArchiveAndExit && _validating_classpath_entry_table) { 87 // If we are doing PrintSharedArchiveAndExit and some of the classpath entries 88 // do not validate, we can still continue "limping" to validate the remaining 89 // entries. No need to quit. 90 tty->print("["); 91 tty->vprint(msg, ap); 92 tty->print_cr("]"); 93 } else { 94 if (RequireSharedSpaces) { 95 fail(msg, ap); 96 } else { 97 if (PrintSharedSpaces) { 98 tty->print_cr("UseSharedSpaces: %s", msg); 99 } 100 } 101 } 102 va_end(ap); 103 UseSharedSpaces = false; 104 assert(current_info() != NULL, "singleton must be registered"); 105 current_info()->close(); 106 } 107 108 // Fill in the fileMapInfo structure with data about this VM instance. 109 110 // This method copies the vm version info into header_version. If the version is too 111 // long then a truncated version, which has a hash code appended to it, is copied. 112 // 113 // Using a template enables this method to verify that header_version is an array of 114 // length JVM_IDENT_MAX. This ensures that the code that writes to the CDS file and 115 // the code that reads the CDS file will both use the same size buffer. Hence, will 116 // use identical truncation. This is necessary for matching of truncated versions. 117 template <int N> static void get_header_version(char (&header_version) [N]) { 118 assert(N == JVM_IDENT_MAX, "Bad header_version size"); 119 120 const char *vm_version = VM_Version::internal_vm_info_string(); 121 const int version_len = (int)strlen(vm_version); 122 123 if (version_len < (JVM_IDENT_MAX-1)) { 124 strcpy(header_version, vm_version); 125 | 76 77 // Complain and continue. Recoverable errors during the reading of the 78 // archive file may continue (with sharing disabled). 79 // 80 // If we continue, then disable shared spaces and close the file. 81 82 void FileMapInfo::fail_continue(const char *msg, ...) { 83 va_list ap; 84 va_start(ap, msg); 85 MetaspaceShared::set_archive_loading_failed(); 86 if (PrintSharedArchiveAndExit && _validating_classpath_entry_table) { 87 // If we are doing PrintSharedArchiveAndExit and some of the classpath entries 88 // do not validate, we can still continue "limping" to validate the remaining 89 // entries. No need to quit. 90 tty->print("["); 91 tty->vprint(msg, ap); 92 tty->print_cr("]"); 93 } else { 94 if (RequireSharedSpaces) { 95 fail(msg, ap); 96 } 97 UseSharedSpaces = false; 98 assert(current_info() != NULL, "singleton must be registered"); 99 current_info()->close(); 100 } 101 va_end(ap); 102 } 103 104 // Fill in the fileMapInfo structure with data about this VM instance. 105 106 // This method copies the vm version info into header_version. If the version is too 107 // long then a truncated version, which has a hash code appended to it, is copied. 108 // 109 // Using a template enables this method to verify that header_version is an array of 110 // length JVM_IDENT_MAX. This ensures that the code that writes to the CDS file and 111 // the code that reads the CDS file will both use the same size buffer. Hence, will 112 // use identical truncation. This is necessary for matching of truncated versions. 113 template <int N> static void get_header_version(char (&header_version) [N]) { 114 assert(N == JVM_IDENT_MAX, "Bad header_version size"); 115 116 const char *vm_version = VM_Version::internal_vm_info_string(); 117 const int version_len = (int)strlen(vm_version); 118 119 if (version_len < (JVM_IDENT_MAX-1)) { 120 strcpy(header_version, vm_version); 121 |