< prev index next >

src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp

Print this page




 390 }
 391 
 392 // Utility functions
 393 
 394 // From IA32 System Programming Guide
 395 enum {
 396   trap_page_fault = 0xE
 397 };
 398 
 399 extern "C" JNIEXPORT int
 400 JVM_handle_bsd_signal(int sig,
 401                         siginfo_t* info,
 402                         void* ucVoid,
 403                         int abort_if_unrecognized) {
 404   ucontext_t* uc = (ucontext_t*) ucVoid;
 405 
 406   Thread* t = ThreadLocalStorage::get_thread_slow();
 407 
 408   // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
 409   // (no destructors can be run)
 410   os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
 411 
 412   SignalHandlerMark shm(t);
 413 
 414   // Note: it's not uncommon that JNI code uses signal/sigset to install
 415   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 416   // or have a SIGILL handler when detecting CPU type). When that happens,
 417   // JVM_handle_bsd_signal() might be invoked with junk info/ucVoid. To
 418   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 419   // that do not require siginfo/ucontext first.
 420 
 421   if (sig == SIGPIPE || sig == SIGXFSZ) {
 422     // allow chained handler to go first
 423     if (os::Bsd::chained_handler(sig, info, ucVoid)) {
 424       return true;
 425     } else {
 426       if (PrintMiscellaneous && (WizardMode || Verbose)) {
 427         char buf[64];
 428         warning("Ignoring %s - see bugs 4229104 or 646499219",
 429                 os::exception_name(sig, buf, sizeof(buf)));
 430       }




 390 }
 391 
 392 // Utility functions
 393 
 394 // From IA32 System Programming Guide
 395 enum {
 396   trap_page_fault = 0xE
 397 };
 398 
 399 extern "C" JNIEXPORT int
 400 JVM_handle_bsd_signal(int sig,
 401                         siginfo_t* info,
 402                         void* ucVoid,
 403                         int abort_if_unrecognized) {
 404   ucontext_t* uc = (ucontext_t*) ucVoid;
 405 
 406   Thread* t = ThreadLocalStorage::get_thread_slow();
 407 
 408   // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
 409   // (no destructors can be run)
 410   os::ThreadCrashProtection::check_crash_protection(sig, t);
 411 
 412   SignalHandlerMark shm(t);
 413 
 414   // Note: it's not uncommon that JNI code uses signal/sigset to install
 415   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 416   // or have a SIGILL handler when detecting CPU type). When that happens,
 417   // JVM_handle_bsd_signal() might be invoked with junk info/ucVoid. To
 418   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 419   // that do not require siginfo/ucontext first.
 420 
 421   if (sig == SIGPIPE || sig == SIGXFSZ) {
 422     // allow chained handler to go first
 423     if (os::Bsd::chained_handler(sig, info, ucVoid)) {
 424       return true;
 425     } else {
 426       if (PrintMiscellaneous && (WizardMode || Verbose)) {
 427         char buf[64];
 428         warning("Ignoring %s - see bugs 4229104 or 646499219",
 429                 os::exception_name(sig, buf, sizeof(buf)));
 430       }


< prev index next >