Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8280155: [PPC64, s390] frame size checks are not yet correct
Reviewed-by: mbaesken, lucy
  • Loading branch information
TheRealMDoerr committed Jan 19, 2022
1 parent 69cfa9c commit f37bfeadcf036a75defc64ad7f4a9f5596cd7407
Showing 3 changed files with 10 additions and 7 deletions.
@@ -302,7 +302,8 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) {
return false;
}
if (fp() - (abi_minframe_size + ijava_state_size) < sp()) {
int min_frame_slots = (abi_minframe_size + ijava_state_size) / sizeof(intptr_t);
if (fp() - min_frame_slots < sp()) {
return false;
}
// These are hacks to keep us out of trouble.
@@ -306,7 +306,8 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) {
return false;
}
if (fp() - (z_abi_16_size + z_ijava_state_size) < sp()) {
int min_frame_slots = (z_abi_16_size + z_ijava_state_size) / sizeof(intptr_t);
if (fp() - min_frame_slots < sp()) {
return false;
}
// These are hacks to keep us out of trouble.
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022 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
@@ -58,14 +58,15 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
address pc = (address)uc->uc_mcontext.regs->nip;

if (ret_frame.pc() == NULL) {
if (pc == NULL) {
// ucontext wasn't useful
return false;
}

frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], pc);

if (ret_frame.fp() == NULL) {
// The found frame does not have a valid frame pointer.
// Bail out because this will create big trouble later on, either

1 comment on commit f37bfea

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on f37bfea Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.