Skip to content
This repository has been archived by the owner. It is now read-only.

8280155: [PPC64, s390] frame size checks are not yet correct #107

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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