8344032: InterpreterRuntime::verify_mdp() missing lock while printing MethodData on failure

Reviewed-by: shade, dholmes, tschatzl
This commit is contained in:
Coleen Phillimore 2024-11-14 12:39:01 +00:00
parent 2145ace384
commit 8ccc48c9c8
2 changed files with 4 additions and 1 deletions

View File

@ -1558,6 +1558,8 @@ void MethodData::print_value_on(outputStream* st) const {
} }
void MethodData::print_data_on(outputStream* st) const { void MethodData::print_data_on(outputStream* st) const {
ConditionalMutexLocker ml(extra_data_lock(), !extra_data_lock()->owned_by_self(),
Mutex::_no_safepoint_check_flag);
ResourceMark rm; ResourceMark rm;
ProfileData* data = first_data(); ProfileData* data = first_data();
if (_parameters_type_data_di != no_parameters) { if (_parameters_type_data_di != no_parameters) {
@ -1568,6 +1570,7 @@ void MethodData::print_data_on(outputStream* st) const {
st->fill_to(6); st->fill_to(6);
data->print_data_on(st, this); data->print_data_on(st, this);
} }
st->print_cr("--- Extra data:"); st->print_cr("--- Extra data:");
DataLayout* dp = extra_data_base(); DataLayout* dp = extra_data_base();
DataLayout* end = args_data_limit(); DataLayout* end = args_data_limit();

View File

@ -2511,7 +2511,7 @@ public:
void clean_method_data(bool always_clean); void clean_method_data(bool always_clean);
void clean_weak_method_links(); void clean_weak_method_links();
Mutex* extra_data_lock() { return &_extra_data_lock; } Mutex* extra_data_lock() const { return const_cast<Mutex*>(&_extra_data_lock); }
void check_extra_data_locked() const NOT_DEBUG_RETURN; void check_extra_data_locked() const NOT_DEBUG_RETURN;
}; };