Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -835,6 +835,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
# for all archs except arm and ppc, prevent gcc to omit frame pointer
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
fi
if test "x$FLAGS_CPU" = xppc64le; then
# Little endian machine uses ELFv2 ABI.
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
fi
fi
if test "x$OPENJDK_TARGET_OS" = xaix; then
$1_CFLAGS_CPU="-mcpu=pwr8"
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,

// End life with a fatal error, message and detail message and the context.
// Note: no need to do any post-processing here (e.g. signal chaining)
va_list va_dummy = nullptr;
VMError::report_and_die(thread, uc, nullptr, 0, msg, detail_msg, va_dummy);
va_end(va_dummy);
VMError::report_and_die(thread, uc, nullptr, 0, msg, "%s", detail_msg);

ShouldNotReachHere();
}
Expand Down
11 changes: 1 addition & 10 deletions src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,6 @@ NOINLINE frame os::current_frame() {
}
}

ATTRIBUTE_PRINTF(6, 7)
static void report_and_die(Thread* thread, void* context, const char* filename, int lineno, const char* message,
const char* detail_fmt, ...) {
va_list va;
va_start(va, detail_fmt);
VMError::report_and_die(thread, context, filename, lineno, message, detail_fmt, va);
va_end(va);
}

bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
ucontext_t* uc, JavaThread* thread) {
// Enable WXWrite: this function is called by the signal handler at arbitrary
Expand Down Expand Up @@ -294,7 +285,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,

// End life with a fatal error, message and detail message and the context.
// Note: no need to do any post-processing here (e.g. signal chaining)
report_and_die(thread, uc, nullptr, 0, msg, "%s", detail_msg);
VMError::report_and_die(thread, uc, nullptr, 0, msg, "%s", detail_msg);
ShouldNotReachHere();

} else if (sig == SIGFPE &&
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,

// End life with a fatal error, message and detail message and the context.
// Note: no need to do any post-processing here (e.g. signal chaining)
va_list va_dummy;
VMError::report_and_die(thread, uc, nullptr, 0, msg, detail_msg, va_dummy);
va_end(va_dummy);
VMError::report_and_die(thread, uc, nullptr, 0, msg, "%s", detail_msg);

ShouldNotReachHere();

Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,

// End life with a fatal error, message and detail message and the context.
// Note: no need to do any post-processing here (e.g. signal chaining)
va_list va_dummy;
VMError::report_and_die(thread, uc, nullptr, 0, msg, detail_msg, va_dummy);
va_end(va_dummy);
VMError::report_and_die(thread, uc, nullptr, 0, msg, "%s", detail_msg);

ShouldNotReachHere();

Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,

// End life with a fatal error, message and detail message and the context.
// Note: no need to do any post-processing here (e.g. signal chaining)
va_list va_dummy;
VMError::report_and_die(thread, uc, nullptr, 0, msg, detail_msg, va_dummy);
va_end(va_dummy);
VMError::report_and_die(thread, uc, nullptr, 0, msg, "%s", detail_msg);

ShouldNotReachHere();
} else if (sig == SIGFPE &&
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/filemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ address FileMapInfo::heap_region_dumptime_address() {
assert(UseSharedSpaces, "runtime only");
assert(is_aligned(r->mapping_offset(), sizeof(HeapWord)), "must be");
if (UseCompressedOops) {
return /*dumptime*/ narrow_oop_base() + r->mapping_offset();
return /*dumptime*/ (address)((uintptr_t)narrow_oop_base() + r->mapping_offset());
} else {
return heap_region_requested_address();
}
Expand All @@ -2050,7 +2050,7 @@ address FileMapInfo::heap_region_requested_address() {
// Runtime base = 0x4000 and shift is also 0. If we map this region at 0x5000, then
// the value P can remain 0x1200. The decoded address = (0x4000 + (0x1200 << 0)) = 0x5200,
// which is the runtime location of the referenced object.
return /*runtime*/ CompressedOops::base() + r->mapping_offset();
return /*runtime*/ (address)((uintptr_t)CompressedOops::base() + r->mapping_offset());
} else {
// We can avoid relocation if each region is mapped into the exact same address
// where it was at dump time.
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/share/logging/logDecorators.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -85,7 +85,9 @@ bool LogDecorators::parse(const char* decorator_args, outputStream* errstream) {
break;
}
tmp_decorators |= mask(d);
token = comma_pos + 1;
if (comma_pos != nullptr) {
token = comma_pos + 1;
}
} while (comma_pos != nullptr);
os::free(args_copy);
if (result) {
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/share/logging/logSelection.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -134,7 +134,9 @@ static LogSelection parse_internal(char *str, outputStream* errstream) {
return LogSelection::Invalid;
}
tags[ntags++] = tag;
cur_tag = plus_pos + 1;
if (plus_pos != nullptr) {
cur_tag = plus_pos + 1;
}
} while (plus_pos != nullptr);

for (size_t i = 0; i < ntags; i++) {
Expand Down
8 changes: 6 additions & 2 deletions src/hotspot/share/logging/logSelectionList.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -61,7 +61,7 @@ bool LogSelectionList::parse(const char* str, outputStream* errstream) {
}
char* copy = os::strdup_check_oom(str, mtLogging);
// Split string on commas
for (char *comma_pos = copy, *cur = copy; success && comma_pos != nullptr; cur = comma_pos + 1) {
for (char *comma_pos = copy, *cur = copy; success; cur = comma_pos + 1) {
if (_nselections == MaxSelections) {
if (errstream != nullptr) {
errstream->print_cr("Can not have more than " SIZE_FORMAT " log selections in a single configuration.",
Expand All @@ -82,6 +82,10 @@ bool LogSelectionList::parse(const char* str, outputStream* errstream) {
break;
}
_selections[_nselections++] = selection;

if (comma_pos == nullptr) {
break;
}
}

os::free(copy);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/memory/virtualspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ void ReservedHeapSpace::try_reserve_range(char *highest_start,
while (attach_point >= lowest_start &&
attach_point <= highest_start && // Avoid wrap around.
((_base == nullptr) ||
(_base < aligned_heap_base_min_address || _base + size > upper_bound))) {
(_base < aligned_heap_base_min_address || size > (uintptr_t)(upper_bound - _base)))) {
try_reserve_heap(size, alignment, page_size, attach_point);
attach_point -= stepsize;
}
Expand Down
8 changes: 8 additions & 0 deletions src/hotspot/share/utilities/vmError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,14 @@ void VMError::report_and_die(Thread* thread, unsigned int sig, address pc, void*
va_end(detail_args);
}

void VMError::report_and_die(Thread* thread, void* context, const char* filename, int lineno, const char* message,
const char* detail_fmt, ...) {
va_list detail_args;
va_start(detail_args, detail_fmt);
report_and_die(thread, context, filename, lineno, message, detail_fmt, detail_args);
va_end(detail_args);
}

void VMError::report_and_die(Thread* thread, unsigned int sig, address pc, void* siginfo, void* context)
{
report_and_die(thread, sig, pc, siginfo, context, "%s", "");
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/utilities/vmError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ class VMError : public AllStatic {
static void report_and_die(Thread* thread, unsigned int sig, address pc, void* siginfo,
void* context, const char* detail_fmt, ...);

ATTRIBUTE_NORETURN
ATTRIBUTE_PRINTF(6, 7)
static void report_and_die(Thread* thread, void* context, const char* filename, int lineno, const char* message,
const char* detail_fmt, ...);

ATTRIBUTE_NORETURN
ATTRIBUTE_PRINTF(3, 0)
static void report_and_die(int id, const char* message, const char* detail_fmt, va_list detail_args,
Expand Down
19 changes: 18 additions & 1 deletion src/java.base/aix/native/libjava/ProcessHandleImpl_aix.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,24 @@ jint os_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray,
}

pid_t os_getParentPidAndTimings(JNIEnv *env, pid_t pid, jlong *total, jlong *start) {
return unix_getParentPidAndTimings(env, pid, total, start);
pid_t the_pid = pid;
struct procentry64 ProcessBuffer;

if (getprocs64(&ProcessBuffer, sizeof(ProcessBuffer), NULL, sizeof(struct fdsinfo64), &the_pid, 1) <= 0) {
return -1;
}

// Validate the pid before returning the info
if (kill(pid, 0) < 0) {
return -1;
}

*total = ((ProcessBuffer.pi_ru.ru_utime.tv_sec + ProcessBuffer.pi_ru.ru_stime.tv_sec) * 1000000000L) +
((ProcessBuffer.pi_ru.ru_utime.tv_usec + ProcessBuffer.pi_ru.ru_stime.tv_usec));

*start = ProcessBuffer.pi_start * (jlong)1000;

return (pid_t) ProcessBuffer.pi_ppid;
}

void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
Expand Down
Loading
Loading