8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer
Reviewed-by: coleenp, aph, stuefe
This commit is contained in:
parent
52ec4bcb1b
commit
0e2c72d7a5
src/hotspot
cpu
share/runtime
@ -508,7 +508,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// first the method
|
||||
|
||||
Method* m = *interpreter_frame_method_addr();
|
||||
Method* m = safe_interpreter_frame_method();
|
||||
|
||||
// validate the method we'd find in this potential sender
|
||||
if (!Method::is_valid_method(m)) return false;
|
||||
|
@ -421,7 +421,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// first the method
|
||||
|
||||
Method* m = *interpreter_frame_method_addr();
|
||||
Method* m = safe_interpreter_frame_method();
|
||||
|
||||
// validate the method we'd find in this potential sender
|
||||
if (!Method::is_valid_method(m)) return false;
|
||||
|
@ -324,7 +324,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// first the method
|
||||
|
||||
Method* m = *interpreter_frame_method_addr();
|
||||
Method* m = safe_interpreter_frame_method();
|
||||
|
||||
// validate the method we'd find in this potential sender
|
||||
if (!Method::is_valid_method(m)) return false;
|
||||
|
@ -478,7 +478,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
// do some validation of frame elements
|
||||
|
||||
// first the method
|
||||
Method* m = *interpreter_frame_method_addr();
|
||||
Method* m = safe_interpreter_frame_method();
|
||||
// validate the method we'd find in this potential sender
|
||||
if (!Method::is_valid_method(m)) {
|
||||
return false;
|
||||
|
@ -496,7 +496,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
// do some validation of frame elements
|
||||
// first the method
|
||||
|
||||
Method* m = *interpreter_frame_method_addr();
|
||||
Method* m = safe_interpreter_frame_method();
|
||||
|
||||
// validate the method we'd find in this potential sender
|
||||
if (!Method::is_valid_method(m)) return false;
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "runtime/monitorChunk.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/safefetch.hpp"
|
||||
#include "runtime/signature.hpp"
|
||||
#include "runtime/stackValue.hpp"
|
||||
#include "runtime/stubCodeGenerator.hpp"
|
||||
@ -301,6 +302,14 @@ bool frame::is_entry_frame_valid(JavaThread* thread) const {
|
||||
return (jfa->last_Java_sp() > sp());
|
||||
}
|
||||
|
||||
Method* frame::safe_interpreter_frame_method() const {
|
||||
Method** m_addr = interpreter_frame_method_addr();
|
||||
if (m_addr == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
return (Method*) SafeFetchN((intptr_t*) m_addr, 0);
|
||||
}
|
||||
|
||||
bool frame::should_be_deoptimized() const {
|
||||
if (_deopt_state == is_deoptimized ||
|
||||
!is_compiled_frame() ) return false;
|
||||
|
@ -236,6 +236,8 @@ class frame {
|
||||
|
||||
bool is_entry_frame_valid(JavaThread* thread) const;
|
||||
|
||||
Method* safe_interpreter_frame_method() const;
|
||||
|
||||
// All frames:
|
||||
|
||||
// A low-level interface for vframes:
|
||||
|
Loading…
x
Reference in New Issue
Block a user