Skip to content

Commit f0bbbcc

Browse files
revert JVM_handle_XXX_signal change
1 parent 29f5635 commit f0bbbcc

File tree

14 files changed

+47
-30
lines changed

14 files changed

+47
-30
lines changed

make/hotspot/symbols/symbols-aix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
2121
# questions.
2222
#
2323

24-
JVM_handle_posix_signal
24+
JVM_handle_linux_signal
2525
numa_error
2626
numa_warn
2727
sysThreadAvailableStackWithSlack

make/hotspot/symbols/symbols-linux

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
2121
# questions.
2222
#
2323

24-
JVM_handle_posix_signal
24+
JVM_handle_linux_signal
2525
JVM_IsUseContainerSupport
2626
numa_error
2727
numa_warn

make/hotspot/symbols/symbols-macosx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -21,4 +21,4 @@
2121
# questions.
2222
#
2323

24-
JVM_handle_posix_signal
24+
JVM_handle_bsd_signal

src/hotspot/cpu/arm/vm_version_arm_32.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
107107
__ pldw(Address(R0));
108108
// Return true if instruction caused no signals
109109
__ mov(R0, 1);
110-
// JVM_handle_posix_signal moves PC here if SIGILL happens
110+
// JVM_handle_linux_signal moves PC here if SIGILL happens
111111
__ bx(LR);
112112

113113
return start;

src/hotspot/os/posix/signals_posix.cpp

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static sigset_t check_signal_done;
6464
static bool check_signals = true;
6565

6666
// This boolean allows users to forward their own non-matching signals
67-
// to JVM_handle_posix_signal harmlessly.
67+
// to JVM_handle_bsd_signal/JVM_handle_linux_signal, harmlessly.
6868
static bool signal_handlers_are_installed = false;
6969

7070
debug_only(static bool signal_sets_initialized = false);
@@ -432,9 +432,20 @@ bool PosixSignals::chained_handler(int sig, siginfo_t* siginfo, void* context) {
432432
// Note that the VM will print warnings if it detects conflicting signal
433433
// handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers".
434434
//
435-
extern "C" JNIEXPORT int JVM_handle_posix_signal(int signo, siginfo_t* siginfo,
436-
void* ucontext,
437-
int abort_if_unrecognized);
435+
436+
#if defined(BSD)
437+
extern "C" JNIEXPORT int JVM_handle_bsd_signal(int signo, siginfo_t* siginfo,
438+
void* ucontext,
439+
int abort_if_unrecognized);
440+
#elif defined(AIX)
441+
extern "C" JNIEXPORT int JVM_handle_aix_signal(int signo, siginfo_t* siginfo,
442+
void* ucontext,
443+
int abort_if_unrecognized);
444+
#else
445+
extern "C" JNIEXPORT int JVM_handle_linux_signal(int signo, siginfo_t* siginfo,
446+
void* ucontext,
447+
int abort_if_unrecognized);
448+
#endif
438449

439450
// Function to unblock all signals which are, according
440451
// to POSIX, typical program error signals. If they happen while being blocked,
@@ -459,7 +470,13 @@ static void javaSignalHandler(int sig, siginfo_t* info, void* uc) {
459470
unblock_program_error_signals();
460471

461472
int orig_errno = errno; // Preserve errno value over signal handler.
462-
JVM_handle_posix_signal(sig, info, uc, true);
473+
#if defined(BSD)
474+
JVM_handle_bsd_signal(sig, info, uc, true);
475+
#elif defined(AIX)
476+
JVM_handle_aix_signal(sig, info, uc, true);
477+
#else
478+
JVM_handle_linux_signal(sig, info, uc, true);
479+
#endif
463480
errno = orig_errno;
464481
}
465482

src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ frame os::current_frame() {
200200
// Utility functions
201201

202202
extern "C" JNIEXPORT int
203-
JVM_handle_posix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) {
203+
JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) {
204204

205205
ucontext_t* uc = (ucontext_t*) ucVoid;
206206

@@ -211,7 +211,7 @@ JVM_handle_posix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unr
211211
// Note: it's not uncommon that JNI code uses signal/sigset to install
212212
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
213213
// or have a SIGILL handler when detecting CPU type). When that happens,
214-
// JVM_handle_posix_signal() might be invoked with junk info/ucVoid. To
214+
// JVM_handle_aix_signal() might be invoked with junk info/ucVoid. To
215215
// avoid unnecessary crash when libjsig is not preloaded, try handle signals
216216
// that do not require siginfo/ucontext first.
217217

src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ enum {
422422
};
423423

424424
extern "C" JNIEXPORT int
425-
JVM_handle_posix_signal(int sig,
425+
JVM_handle_bsd_signal(int sig,
426426
siginfo_t* info,
427427
void* ucVoid,
428428
int abort_if_unrecognized) {
@@ -439,7 +439,7 @@ JVM_handle_posix_signal(int sig,
439439
// Note: it's not uncommon that JNI code uses signal/sigset to install
440440
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
441441
// or have a SIGILL handler when detecting CPU type). When that happens,
442-
// JVM_handle_posix_signal() might be invoked with junk info/ucVoid. To
442+
// JVM_handle_bsd_signal() might be invoked with junk info/ucVoid. To
443443
// avoid unnecessary crash when libjsig is not preloaded, try handle signals
444444
// that do not require siginfo/ucontext first.
445445

src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
116116
}
117117

118118
extern "C" JNIEXPORT int
119-
JVM_handle_posix_signal(int sig,
119+
JVM_handle_bsd_signal(int sig,
120120
siginfo_t* info,
121121
void* ucVoid,
122122
int abort_if_unrecognized) {
@@ -137,7 +137,7 @@ JVM_handle_posix_signal(int sig,
137137
// Note: it's not uncommon that JNI code uses signal/sigset to
138138
// install then restore certain signal handler (e.g. to temporarily
139139
// block SIGPIPE, or have a SIGILL handler when detecting CPU
140-
// type). When that happens, JVM_handle_posix_signal() might be
140+
// type). When that happens, JVM_handle_bsd_signal() might be
141141
// invoked with junk info/ucVoid. To avoid unnecessary crash when
142142
// libjsig is not preloaded, try handle signals that do not require
143143
// siginfo/ucontext first.

src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ NOINLINE frame os::current_frame() {
194194
}
195195

196196
extern "C" JNIEXPORT int
197-
JVM_handle_posix_signal(int sig,
197+
JVM_handle_linux_signal(int sig,
198198
siginfo_t* info,
199199
void* ucVoid,
200200
int abort_if_unrecognized) {
@@ -211,7 +211,7 @@ JVM_handle_posix_signal(int sig,
211211
// Note: it's not uncommon that JNI code uses signal/sigset to install
212212
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
213213
// or have a SIGILL handler when detecting CPU type). When that happens,
214-
// JVM_handle_posix_signal() might be invoked with junk info/ucVoid. To
214+
// JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
215215
// avoid unnecessary crash when libjsig is not preloaded, try handle signals
216216
// that do not require siginfo/ucontext first.
217217

src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ address check_mp_ext_fault_instr = NULL;
243243

244244
// Utility functions
245245

246-
extern "C" int JVM_handle_posix_signal(int sig, siginfo_t* info,
246+
extern "C" int JVM_handle_linux_signal(int sig, siginfo_t* info,
247247
void* ucVoid, int abort_if_unrecognized) {
248248
ucontext_t* uc = (ucontext_t*) ucVoid;
249249

@@ -270,7 +270,7 @@ extern "C" int JVM_handle_posix_signal(int sig, siginfo_t* info,
270270
// Note: it's not uncommon that JNI code uses signal/sigset to install
271271
// then restore certain signal handler (e.g. to temporarily block SIGPIPE,
272272
// or have a SIGILL handler when detecting CPU type). When that happens,
273-
// JVM_handle_posix_signal() might be invoked with junk info/ucVoid. To
273+
// JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
274274
// avoid unnecessary crash when libjsig is not preloaded, try handle signals
275275
// that do not require siginfo/ucontext first.
276276

0 commit comments

Comments
 (0)