Skip to content

Commit ac0b7c9

Browse files
committed
8268288: jdk/jfr/api/consumer/streaming/TestOutOfProcessMigration.java fails with "Error: ShouldNotReachHere()"
Reviewed-by: mbaesken Backport-of: 0a0909263194032ae7d8348484e3638f84090233
1 parent c6a35f5 commit ac0b7c9

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/hotspot/share/cds/filemap.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,28 +2347,28 @@ void FileMapInfo::stop_sharing_and_unmap(const char* msg) {
23472347
ClassPathEntry** FileMapInfo::_classpath_entries_for_jvmti = NULL;
23482348

23492349
ClassPathEntry* FileMapInfo::get_classpath_entry_for_jvmti(int i, TRAPS) {
2350+
if (i == 0) {
2351+
// index 0 corresponds to the ClassPathImageEntry which is a globally shared object
2352+
// and should never be deleted.
2353+
return ClassLoader::get_jrt_entry();
2354+
}
23502355
ClassPathEntry* ent = _classpath_entries_for_jvmti[i];
23512356
if (ent == NULL) {
2352-
if (i == 0) {
2353-
ent = ClassLoader::get_jrt_entry();
2354-
assert(ent != NULL, "must be");
2355-
} else {
2356-
SharedClassPathEntry* scpe = shared_path(i);
2357-
assert(scpe->is_jar(), "must be"); // other types of scpe will not produce archived classes
2357+
SharedClassPathEntry* scpe = shared_path(i);
2358+
assert(scpe->is_jar(), "must be"); // other types of scpe will not produce archived classes
23582359

2359-
const char* path = scpe->name();
2360-
struct stat st;
2361-
if (os::stat(path, &st) != 0) {
2360+
const char* path = scpe->name();
2361+
struct stat st;
2362+
if (os::stat(path, &st) != 0) {
2363+
char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128);
2364+
jio_snprintf(msg, strlen(path) + 127, "error in finding JAR file %s", path);
2365+
THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL);
2366+
} else {
2367+
ent = ClassLoader::create_class_path_entry(THREAD, path, &st, false, false);
2368+
if (ent == NULL) {
23622369
char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128);
2363-
jio_snprintf(msg, strlen(path) + 127, "error in finding JAR file %s", path);
2370+
jio_snprintf(msg, strlen(path) + 127, "error in opening JAR file %s", path);
23642371
THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL);
2365-
} else {
2366-
ent = ClassLoader::create_class_path_entry(THREAD, path, &st, false, false);
2367-
if (ent == NULL) {
2368-
char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128);
2369-
jio_snprintf(msg, strlen(path) + 127, "error in opening JAR file %s", path);
2370-
THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL);
2371-
}
23722372
}
23732373
}
23742374

0 commit comments

Comments
 (0)