mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer
Backport-of: 0e2c72d7a5
This commit is contained in:
committed by
Vitaly Provodin
parent
986a132b17
commit
24e0f40a32
@@ -508,7 +508,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
|||||||
|
|
||||||
// first the method
|
// 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
|
// validate the method we'd find in this potential sender
|
||||||
if (!Method::is_valid_method(m)) return false;
|
if (!Method::is_valid_method(m)) return false;
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
|||||||
|
|
||||||
// first the method
|
// 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
|
// validate the method we'd find in this potential sender
|
||||||
if (!Method::is_valid_method(m)) return false;
|
if (!Method::is_valid_method(m)) return false;
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
|||||||
|
|
||||||
// first the method
|
// 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
|
// validate the method we'd find in this potential sender
|
||||||
if (!Method::is_valid_method(m)) return false;
|
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
|
// do some validation of frame elements
|
||||||
|
|
||||||
// first the method
|
// 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
|
// validate the method we'd find in this potential sender
|
||||||
if (!Method::is_valid_method(m)) {
|
if (!Method::is_valid_method(m)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
|||||||
// do some validation of frame elements
|
// do some validation of frame elements
|
||||||
// first the method
|
// 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
|
// validate the method we'd find in this potential sender
|
||||||
if (!Method::is_valid_method(m)) return false;
|
if (!Method::is_valid_method(m)) return false;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include "runtime/monitorChunk.hpp"
|
#include "runtime/monitorChunk.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
|
#include "runtime/safefetch.hpp"
|
||||||
#include "runtime/signature.hpp"
|
#include "runtime/signature.hpp"
|
||||||
#include "runtime/stackValue.hpp"
|
#include "runtime/stackValue.hpp"
|
||||||
#include "runtime/stubCodeGenerator.hpp"
|
#include "runtime/stubCodeGenerator.hpp"
|
||||||
@@ -301,6 +302,14 @@ bool frame::is_entry_frame_valid(JavaThread* thread) const {
|
|||||||
return (jfa->last_Java_sp() > sp());
|
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 {
|
bool frame::should_be_deoptimized() const {
|
||||||
if (_deopt_state == is_deoptimized ||
|
if (_deopt_state == is_deoptimized ||
|
||||||
!is_compiled_frame() ) return false;
|
!is_compiled_frame() ) return false;
|
||||||
|
|||||||
@@ -236,6 +236,8 @@ class frame {
|
|||||||
|
|
||||||
bool is_entry_frame_valid(JavaThread* thread) const;
|
bool is_entry_frame_valid(JavaThread* thread) const;
|
||||||
|
|
||||||
|
Method* safe_interpreter_frame_method() const;
|
||||||
|
|
||||||
// All frames:
|
// All frames:
|
||||||
|
|
||||||
// A low-level interface for vframes:
|
// A low-level interface for vframes:
|
||||||
|
|||||||
Reference in New Issue
Block a user