8265150: AsyncGetCallTrace crashes on ResourceMark

Reviewed-by: dholmes, stuefe, eosterlund, sspitsyn
This commit is contained in:
Coleen Phillimore 2021-12-04 13:05:06 +00:00
parent 9642629d15
commit 267c024eb5
2 changed files with 6 additions and 9 deletions

View file

@ -324,14 +324,11 @@ int Method::bci_from(address bcp) const {
if (is_native() && bcp == 0) {
return 0;
}
#ifdef ASSERT
{
ResourceMark rm;
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
"bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s",
p2i(bcp), name_and_sig_as_C_string());
}
#endif
// Do not have a ResourceMark here because AsyncGetCallTrace stack walking code
// may call this after interrupting a nested ResourceMark.
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
"bcp doesn't belong to this method. bcp: " INTPTR_FORMAT, p2i(bcp));
return bcp - code_base();
}

View file

@ -829,7 +829,7 @@ JvmtiEnvBase::get_stack_trace(JavaThread *java_thread,
"call by myself / at safepoint / at handshake");
int count = 0;
if (java_thread->has_last_Java_frame()) {
RegisterMap reg_map(java_thread);
RegisterMap reg_map(java_thread, false /* update_map */, false /* process_frames */);
ResourceMark rm(current_thread);
javaVFrame *jvf = java_thread->last_java_vframe(&reg_map);
HandleMark hm(current_thread);