< prev index next >

src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp

Print this page




 527   }
 528 #endif  // COMPILER2
 529   return false;
 530 }
 531 
 532 extern "C" JNIEXPORT int
 533 JVM_handle_linux_signal(int sig,
 534                         siginfo_t* info,
 535                         void* ucVoid,
 536                         int abort_if_unrecognized) {
 537   // in fact this isn't ucontext_t* at all, but struct sigcontext*
 538   // but Linux porting layer uses ucontext_t, so to minimize code change
 539   // we cast as needed
 540   ucontext_t* ucFake = (ucontext_t*) ucVoid;
 541   sigcontext* uc = (sigcontext*)ucVoid;
 542 
 543   Thread* t = ThreadLocalStorage::get_thread_slow();
 544 
 545   // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
 546   // (no destructors can be run)
 547   os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
 548 
 549   SignalHandlerMark shm(t);
 550 
 551   // Note: it's not uncommon that JNI code uses signal/sigset to install
 552   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 553   // or have a SIGILL handler when detecting CPU type). When that happens,
 554   // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
 555   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 556   // that do not require siginfo/ucontext first.
 557 
 558   if (sig == SIGPIPE || sig == SIGXFSZ) {
 559     // allow chained handler to go first
 560     if (os::Linux::chained_handler(sig, info, ucVoid)) {
 561       return true;
 562     } else {
 563       if (PrintMiscellaneous && (WizardMode || Verbose)) {
 564         char buf[64];
 565         warning("Ignoring %s - see bugs 4229104 or 646499219",
 566                 os::exception_name(sig, buf, sizeof(buf)));
 567       }




 527   }
 528 #endif  // COMPILER2
 529   return false;
 530 }
 531 
 532 extern "C" JNIEXPORT int
 533 JVM_handle_linux_signal(int sig,
 534                         siginfo_t* info,
 535                         void* ucVoid,
 536                         int abort_if_unrecognized) {
 537   // in fact this isn't ucontext_t* at all, but struct sigcontext*
 538   // but Linux porting layer uses ucontext_t, so to minimize code change
 539   // we cast as needed
 540   ucontext_t* ucFake = (ucontext_t*) ucVoid;
 541   sigcontext* uc = (sigcontext*)ucVoid;
 542 
 543   Thread* t = ThreadLocalStorage::get_thread_slow();
 544 
 545   // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
 546   // (no destructors can be run)
 547   os::ThreadCrashProtection::check_crash_protection(sig, t);
 548 
 549   SignalHandlerMark shm(t);
 550 
 551   // Note: it's not uncommon that JNI code uses signal/sigset to install
 552   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 553   // or have a SIGILL handler when detecting CPU type). When that happens,
 554   // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
 555   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 556   // that do not require siginfo/ucontext first.
 557 
 558   if (sig == SIGPIPE || sig == SIGXFSZ) {
 559     // allow chained handler to go first
 560     if (os::Linux::chained_handler(sig, info, ucVoid)) {
 561       return true;
 562     } else {
 563       if (PrintMiscellaneous && (WizardMode || Verbose)) {
 564         char buf[64];
 565         warning("Ignoring %s - see bugs 4229104 or 646499219",
 566                 os::exception_name(sig, buf, sizeof(buf)));
 567       }


< prev index next >