Skip to content

Commit 59d085a

Browse files
committedNov 28, 2023
fix frame::interpreter_frame_print_on() with heap frame
1 parent 960d5b8 commit 59d085a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed
 

‎src/hotspot/share/runtime/frame.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,21 @@ void frame::interpreter_frame_print_on(outputStream* st) const {
576576
current < interpreter_frame_monitor_begin();
577577
current = next_monitor_in_interpreter_frame(current)) {
578578
st->print(" - obj [%s", current->obj() == nullptr ? "null" : "");
579-
if (current->obj() != nullptr) current->obj()->print_value_on(st);
579+
oop obj = current->obj();
580+
if (obj != nullptr) {
581+
if (!is_heap_frame()) {
582+
obj->print_value_on(st);
583+
} else {
584+
// Might be an invalid oop. We don't have the
585+
// stackChunk to correct it so just print address.
586+
st->print(INTPTR_FORMAT, p2i(obj));
587+
}
588+
}
580589
st->print_cr("]");
581590
st->print(" - lock [");
582-
current->lock()->print_on(st, current->obj());
591+
if (!is_heap_frame()) {
592+
current->lock()->print_on(st, obj);
593+
}
583594
st->print_cr("]");
584595
}
585596
// monitor

0 commit comments

Comments
 (0)
Please sign in to comment.