Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8268288: jdk/jfr/api/consumer/streaming/TestOutOfProcessMigration.jav…
…a fails with "Error: ShouldNotReachHere()"

Reviewed-by: mbaesken
Backport-of: 0a0909263194032ae7d8348484e3638f84090233
  • Loading branch information
GoeLin committed Mar 28, 2023
1 parent c6a35f5 commit ac0b7c9
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/hotspot/share/cds/filemap.cpp
Expand Up @@ -2347,28 +2347,28 @@ void FileMapInfo::stop_sharing_and_unmap(const char* msg) {
ClassPathEntry** FileMapInfo::_classpath_entries_for_jvmti = NULL;

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

const char* path = scpe->name();
struct stat st;
if (os::stat(path, &st) != 0) {
const char* path = scpe->name();
struct stat st;
if (os::stat(path, &st) != 0) {
char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128);
jio_snprintf(msg, strlen(path) + 127, "error in finding JAR file %s", path);
THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL);
} else {
ent = ClassLoader::create_class_path_entry(THREAD, path, &st, false, false);
if (ent == NULL) {
char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128);
jio_snprintf(msg, strlen(path) + 127, "error in finding JAR file %s", path);
jio_snprintf(msg, strlen(path) + 127, "error in opening JAR file %s", path);
THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL);
} else {
ent = ClassLoader::create_class_path_entry(THREAD, path, &st, false, false);
if (ent == NULL) {
char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128);
jio_snprintf(msg, strlen(path) + 127, "error in opening JAR file %s", path);
THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL);
}
}
}

Expand Down

1 comment on commit ac0b7c9

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.