1 --- a/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp Thu Nov 12 10:50:44 2020
2 +++ b/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp Thu Nov 12 10:57:39 2020
7 -extern "C" JNIEXPORT int
8 -JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
9 - int abort_if_unrecognized) {
10 - ucontext_t* uc = (ucontext_t*) ucVoid;
11 +bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
12 + ucontext_t* uc, JavaThread* thread) {
15 - if (sig == SIGILL && info->si_addr == (caddr_t)sse_check) {
16 - // the SSE instruction faulted. supports_sse() need return false.
17 - uc->uc_mcontext.gregs[EIP] = (greg_t)sse_unavailable;
22 - Thread* t = Thread::current_or_null_safe();
24 - // If crash protection is installed we may longjmp away and no destructors
25 - // for objects in this scope will be run.
26 - // So don't use any RAII utilities before crash protection is checked.
27 - os::ThreadCrashProtection::check_crash_protection(sig, t);
29 - if(sig == SIGPIPE || sig == SIGXFSZ) {
30 - if (PosixSignals::chained_handler(sig, info, ucVoid)) {
33 - // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
38 - JavaThread* thread = NULL;
39 - VMThread* vmthread = NULL;
41 - if (PosixSignals::are_signal_handlers_installed()) {
43 - if(t->is_Java_thread()) {
44 - thread = (JavaThread*)t;
46 - else if(t->is_VM_thread()){
47 - vmthread = (VMThread *)t;
52 - if (sig == ASYNC_SIGNAL) {
53 - if(thread || vmthread){
55 - } else if (PosixSignals::chained_handler(sig, info, ucVoid)) {
58 - // If ASYNC_SIGNAL not chained, and this is a non-vm and
64 if (info == NULL || info->si_code <= 0 || info->si_code == SI_NOINFO) {
65 // can't decode this kind of signal
72 - if (PosixSignals::chained_handler(sig, info, ucVoid)) {
76 - if (!abort_if_unrecognized) {
77 - // caller wants another chance, so give it to him
82 - * FIXME: libjsig_is_loaded has been moved to PosixSignals but is
83 - * not visible. But what does this code do anyway? I can find no
84 - * analogues to this code in any other os_cpu files
86 - if (!PosixSignals::libjsig_is_loaded) {
87 - struct sigaction oldAct;
88 - sigaction(sig, (struct sigaction *)0, &oldAct);
89 - if (oldAct.sa_sigaction != signalHandler) {
90 - void* sighand = oldAct.sa_sigaction ? CAST_FROM_FN_PTR(void*, oldAct.sa_sigaction)
91 - : CAST_FROM_FN_PTR(void*, oldAct.sa_handler);
92 - warning("Unexpected Signal %d occurred under user-defined signal handler %#lx", sig, (long)sighand);
97 - if (pc == NULL && uc != NULL) {
98 - pc = (address) uc->uc_mcontext.gregs[REG_PC];
101 - // unmask current signal
103 - sigemptyset(&newset);
104 - sigaddset(&newset, sig);
105 - sigprocmask(SIG_UNBLOCK, &newset, NULL);
107 - // Determine which sort of error to throw. Out of swap may signal
108 - // on the thread stack, which could get a mapping error when touched.
109 - address addr = (address) info->si_addr;
110 - if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) {
111 - vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack.");
114 - VMError::report_and_die(t, sig, pc, info, ucVoid);
116 - ShouldNotReachHere();