Skip to content

Commit 267c024

Browse files
committed
8265150: AsyncGetCallTrace crashes on ResourceMark
Reviewed-by: dholmes, stuefe, eosterlund, sspitsyn
1 parent 9642629 commit 267c024

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/hotspot/share/oops/method.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,11 @@ int Method::bci_from(address bcp) const {
324324
if (is_native() && bcp == 0) {
325325
return 0;
326326
}
327-
#ifdef ASSERT
328-
{
329-
ResourceMark rm;
330-
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
331-
"bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s",
332-
p2i(bcp), name_and_sig_as_C_string());
333-
}
334-
#endif
327+
// Do not have a ResourceMark here because AsyncGetCallTrace stack walking code
328+
// may call this after interrupting a nested ResourceMark.
329+
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
330+
"bcp doesn't belong to this method. bcp: " INTPTR_FORMAT, p2i(bcp));
331+
335332
return bcp - code_base();
336333
}
337334

src/hotspot/share/prims/jvmtiEnvBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ JvmtiEnvBase::get_stack_trace(JavaThread *java_thread,
829829
"call by myself / at safepoint / at handshake");
830830
int count = 0;
831831
if (java_thread->has_last_Java_frame()) {
832-
RegisterMap reg_map(java_thread);
832+
RegisterMap reg_map(java_thread, false /* update_map */, false /* process_frames */);
833833
ResourceMark rm(current_thread);
834834
javaVFrame *jvf = java_thread->last_java_vframe(&reg_map);
835835
HandleMark hm(current_thread);

0 commit comments

Comments
 (0)