Skip to content

Commit

Permalink
8341015: OopStorage location decoder crashes accessing non-initalized…
Browse files Browse the repository at this point in the history
… OopStorage

Reviewed-by: kbarrett, tschatzl
  • Loading branch information
shipilev committed Sep 27, 2024
1 parent 9003e2c commit 6587909
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/shared/oopStorageSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ bool OopStorageSet::print_containing(const void* addr, outputStream* st) {
if (addr != nullptr) {
const void* aligned_addr = align_down(addr, alignof(oop));
for (OopStorage* storage : Range<Id>()) {
if (storage->print_containing((oop*) aligned_addr, st)) {
// Check for null for extra safety: might get here while handling error
// before storage initialization.
if ((storage != nullptr) && storage->print_containing((oop*) aligned_addr, st)) {
if (aligned_addr != addr) {
st->print_cr(" (unaligned)");
} else {
Expand Down

0 comments on commit 6587909

Please sign in to comment.