Skip to content

Commit

Permalink
8343890: SEGV crash in RunTimeClassInfo::klass
Browse files Browse the repository at this point in the history
Reviewed-by: iklam, ccheung
  • Loading branch information
Matias Saavedra Silva committed Dec 5, 2024
1 parent a97dca5 commit bf0debc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/hotspot/share/cds/runTimeClassInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ void RunTimeClassInfo::init(DumpTimeClassInfo& info) {
}

InstanceKlass* RunTimeClassInfo::klass() const {
if (ArchiveBuilder::is_active() && ArchiveBuilder::current()->is_in_buffer_space((address)this)) {
return ArchiveBuilder::current()->offset_to_buffered<InstanceKlass*>(_klass_offset);
} else {
if (MetaspaceShared::is_in_shared_metaspace(this)) {
// <this> is inside a mmaped CDS archive.
return ArchiveUtils::offset_to_archived_address<InstanceKlass*>(_klass_offset);
} else {
// <this> is a temporary copy of a RunTimeClassInfo that's being initialized
// by the ArchiveBuilder.
return ArchiveBuilder::current()->offset_to_buffered<InstanceKlass*>(_klass_offset);
}
}

Expand Down

0 comments on commit bf0debc

Please sign in to comment.