Skip to content

Commit 9d518c5

Browse files
committedMar 17, 2023
8299375: [PPC64] GetStackTraceSuspendedStressTest tries to deoptimize frame with invalid fp
Reviewed-by: mdoerr
1 parent ebac7ee commit 9d518c5

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed
 

‎src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ inline void ThawBase::set_interpreter_frame_bottom(const frame& f, intptr_t* bot
557557

558558
inline void ThawBase::patch_pd(frame& f, const frame& caller) {
559559
patch_callee_link(caller, caller.fp());
560+
// Prevent assertion if f gets deoptimized right away before it's fully initialized
561+
f.mark_not_fully_initialized();
560562
}
561563

562564
//

‎src/hotspot/cpu/ppc/frame_ppc.hpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
2+
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -352,6 +352,13 @@
352352

353353
private:
354354

355+
#ifdef ASSERT
356+
enum special_backlink_values : uint64_t {
357+
NOT_FULLY_INITIALIZED = 0xBBAADDF9
358+
};
359+
bool is_fully_initialized() const { return (uint64_t)_fp != NOT_FULLY_INITIALIZED; }
360+
#endif // ASSERT
361+
355362
// STACK:
356363
// ...
357364
// [THIS_FRAME] <-- this._sp (stack pointer for this frame)
@@ -379,6 +386,9 @@
379386
int offset_fp() const { assert_offset(); return _offset_fp; }
380387
void set_offset_fp(int value) { assert_on_heap(); _offset_fp = value; }
381388

389+
// Mark a frame as not fully initialized. Must not be used for frames in the valid back chain.
390+
void mark_not_fully_initialized() const { DEBUG_ONLY(own_abi()->callers_sp = NOT_FULLY_INITIALIZED;) }
391+
382392
// Accessors for ABIs
383393
inline abi_minframe* own_abi() const { return (abi_minframe*) _sp; }
384394
inline abi_minframe* callers_abi() const { return (abi_minframe*) _fp; }

‎src/hotspot/cpu/ppc/frame_ppc.inline.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
3+
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,9 @@ inline void frame::setup() {
7777

7878
// Continuation frames on the java heap are not aligned.
7979
// When thawing interpreted frames the sp can be unaligned (see new_stack_frame()).
80-
assert(_on_heap || (is_aligned(_sp, alignment_in_bytes) || is_interpreted_frame()) && is_aligned(_fp, alignment_in_bytes),
80+
assert(_on_heap ||
81+
(is_aligned(_sp, alignment_in_bytes) || is_interpreted_frame()) &&
82+
(is_aligned(_fp, alignment_in_bytes) || !is_fully_initialized()),
8183
"invalid alignment sp:" PTR_FORMAT " unextended_sp:" PTR_FORMAT " fp:" PTR_FORMAT, p2i(_sp), p2i(_unextended_sp), p2i(_fp));
8284
}
8385

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Mar 17, 2023

@openjdk-notifier[bot]
Please sign in to comment.