Skip to content

Commit fdf21b6

Browse files
committed
8265150: AsyncGetCallTrace crashes on ResourceMark
Reviewed-by: phh Backport-of: 267c024eb52acd1611188dd5b1417b877ff3eafd
1 parent 2893731 commit fdf21b6

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
@@ -251,14 +251,11 @@ int Method::bci_from(address bcp) const {
251251
if (is_native() && bcp == 0) {
252252
return 0;
253253
}
254-
#ifdef ASSERT
255-
{
256-
ResourceMark rm;
257-
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
258-
"bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s",
259-
p2i(bcp), name_and_sig_as_C_string());
260-
}
261-
#endif
254+
// Do not have a ResourceMark here because AsyncGetCallTrace stack walking code
255+
// may call this after interrupting a nested ResourceMark.
256+
assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(),
257+
"bcp doesn't belong to this method. bcp: " INTPTR_FORMAT, p2i(bcp));
258+
262259
return bcp - code_base();
263260
}
264261

src/hotspot/share/prims/jvmtiEnvBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ JvmtiEnvBase::get_stack_trace(JavaThread *java_thread,
814814
"at safepoint or target thread is suspended");
815815
int count = 0;
816816
if (java_thread->has_last_Java_frame()) {
817-
RegisterMap reg_map(java_thread);
817+
RegisterMap reg_map(java_thread, false /* update_map */);
818818
Thread* current_thread = Thread::current();
819819
ResourceMark rm(current_thread);
820820
javaVFrame *jvf = java_thread->last_java_vframe(&reg_map);

0 commit comments

Comments
 (0)