8299375: [PPC64] GetStackTraceSuspendedStressTest tries to deoptimize frame with invalid fp

Reviewed-by: mdoerr
This commit is contained in:
Richard Reingruber 2023-03-17 08:45:17 +00:00
parent ebac7eec8e
commit 9d518c528b
3 changed files with 18 additions and 4 deletions

View File

@ -557,6 +557,8 @@ inline void ThawBase::set_interpreter_frame_bottom(const frame& f, intptr_t* bot
inline void ThawBase::patch_pd(frame& f, const frame& caller) {
patch_callee_link(caller, caller.fp());
// Prevent assertion if f gets deoptimized right away before it's fully initialized
f.mark_not_fully_initialized();
}
//

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -352,6 +352,13 @@
private:
#ifdef ASSERT
enum special_backlink_values : uint64_t {
NOT_FULLY_INITIALIZED = 0xBBAADDF9
};
bool is_fully_initialized() const { return (uint64_t)_fp != NOT_FULLY_INITIALIZED; }
#endif // ASSERT
// STACK:
// ...
// [THIS_FRAME] <-- this._sp (stack pointer for this frame)
@ -379,6 +386,9 @@
int offset_fp() const { assert_offset(); return _offset_fp; }
void set_offset_fp(int value) { assert_on_heap(); _offset_fp = value; }
// Mark a frame as not fully initialized. Must not be used for frames in the valid back chain.
void mark_not_fully_initialized() const { DEBUG_ONLY(own_abi()->callers_sp = NOT_FULLY_INITIALIZED;) }
// Accessors for ABIs
inline abi_minframe* own_abi() const { return (abi_minframe*) _sp; }
inline abi_minframe* callers_abi() const { return (abi_minframe*) _fp; }

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -77,7 +77,9 @@ inline void frame::setup() {
// Continuation frames on the java heap are not aligned.
// When thawing interpreted frames the sp can be unaligned (see new_stack_frame()).
assert(_on_heap || (is_aligned(_sp, alignment_in_bytes) || is_interpreted_frame()) && is_aligned(_fp, alignment_in_bytes),
assert(_on_heap ||
(is_aligned(_sp, alignment_in_bytes) || is_interpreted_frame()) &&
(is_aligned(_fp, alignment_in_bytes) || !is_fully_initialized()),
"invalid alignment sp:" PTR_FORMAT " unextended_sp:" PTR_FORMAT " fp:" PTR_FORMAT, p2i(_sp), p2i(_unextended_sp), p2i(_fp));
}