Skip to content

Commit

Permalink
8312014: [s390x] TestSigInfoInHsErrFile.java Failure
Browse files Browse the repository at this point in the history
Reviewed-by: stuefe, amitkumar, tsteele
  • Loading branch information
sid8606 authored and Tyler Steele committed Jul 19, 2023
1 parent b5b6f4e commit 6f66213
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define CPU_AARCH64_GLOBALDEFINITIONS_AARCH64_HPP

const int StackAlignmentInBytes = 16;
const size_t pd_segfault_address = 1024;

// Indicates whether the C calling conventions require that
// 32-bit integer argument values are extended to 64 bits.
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/arm/globalDefinitions_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define CPU_ARM_GLOBALDEFINITIONS_ARM_HPP

const int StackAlignmentInBytes = 8;
const size_t pd_segfault_address = 1024;

// Indicates whether the C calling conventions require that
// 32-bit integer argument values are extended to 64 bits.
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ const int BytesPerInstWord = 4;

const int StackAlignmentInBytes = 16;

#ifdef AIX
const size_t pd_segfault_address = -1;
#else
const size_t pd_segfault_address = 1024;
#endif

// Indicates whether the C calling conventions require that
// 32-bit integer argument values are extended to 64 bits.
const bool CCallingConventionRequiresIntsAsLongs = true;
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/riscv/globalDefinitions_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define CPU_RISCV_GLOBALDEFINITIONS_RISCV_HPP

const int StackAlignmentInBytes = 16;
const size_t pd_segfault_address = 1024;

// Indicates whether the C calling conventions require that
// 32-bit integer argument values are extended to 64 bits.
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/cpu/s390/globalDefinitions_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

const int StackAlignmentInBytes = 16;

// All faults on s390x give the address only on page granularity.
// Set Pdsegfault_address to minimum one page address.
const size_t pd_segfault_address = 4096;

#define SUPPORTS_NATIVE_CX8

#define CPU_MULTI_COPY_ATOMIC
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/x86/globalDefinitions_x86.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define CPU_X86_GLOBALDEFINITIONS_X86_HPP

const int StackAlignmentInBytes = 16;
const size_t pd_segfault_address = 1024;

// Indicates whether the C calling conventions require that
// 32-bit integer argument values are extended to 64 bits.
Expand Down
7 changes: 7 additions & 0 deletions src/hotspot/cpu/zero/globalDefinitions_zero.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@
// Indicates whether the C calling conventions require that
// 32-bit integer argument values are extended to 64 bits.
const bool CCallingConventionRequiresIntsAsLongs = false;
#if defined(AIX)
const size_t pd_segfault_address = -1;
#elif defined(S390)
const size_t pd_segfault_address = 4096;
#else
const size_t pd_segfault_address = 1024;
#endif

#endif // CPU_ZERO_GLOBALDEFINITIONS_ZERO_HPP
1 change: 1 addition & 0 deletions src/hotspot/share/utilities/vmError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const char* VMError::_filename;
int VMError::_lineno;
size_t VMError::_size;
const size_t VMError::_reattempt_required_stack_headroom = 64 * K;
const intptr_t VMError::segfault_address = pd_segfault_address;

// List of environment variables that should be reported in error log file.
static const char* env_list[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/utilities/vmError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class VMError : public AllStatic {
DEBUG_ONLY(static void controlled_crash(int how);)

// Non-null address guaranteed to generate a SEGV mapping error on read, for test purposes.
static constexpr intptr_t segfault_address = AIX_ONLY(-1) NOT_AIX(1 * K);
static const intptr_t segfault_address;

// Max value for the ErrorLogPrintCodeLimit flag.
static const int max_error_log_print_code = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ public static void main(String[] args) throws Exception {
patterns.add(Pattern.compile("# .*VMError::controlled_crash.*"));

// Crash address: see VMError::_segfault_address
String crashAddress = Platform.isAix() ? "0xffffffffffffffff" : "0x0*400";
String crashAddress = "0x0*400";
if (Platform.isAix()) {
crashAddress = "0xffffffffffffffff";
} else if (Platform.isS390x()) {
// All faults on s390x give the address only on page granularity.
// Hence fault address is first page address.
crashAddress = "0x0*1000";
}
patterns.add(Pattern.compile("siginfo: si_signo: \\d+ \\(SIGSEGV\\), si_code: \\d+ \\(SEGV_.*\\), si_addr: " + crashAddress + ".*"));

HsErrFileUtils.checkHsErrFileContent(f, patterns.toArray(new Pattern[] {}), true);
Expand Down

1 comment on commit 6f66213

@openjdk-notifier
Copy link

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.