< prev index next >

src/os_cpu/linux_x86/vm/os_linux_x86.cpp

Print this page




 204     return frame();
 205   } else {
 206     return os::get_sender_for_C_frame(&myframe);
 207   }
 208 }
 209 
 210 // Utility functions
 211 
 212 // From IA32 System Programming Guide
 213 enum {
 214   trap_page_fault = 0xE
 215 };
 216 
 217 extern "C" JNIEXPORT int
 218 JVM_handle_linux_signal(int sig,
 219                         siginfo_t* info,
 220                         void* ucVoid,
 221                         int abort_if_unrecognized) {
 222   ucontext_t* uc = (ucontext_t*) ucVoid;
 223 
 224   Thread* t = ThreadLocalStorage::get_thread_slow();
 225 
 226   // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
 227   // (no destructors can be run)
 228   os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
 229 
 230   SignalHandlerMark shm(t);
 231 
 232   // Note: it's not uncommon that JNI code uses signal/sigset to install
 233   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 234   // or have a SIGILL handler when detecting CPU type). When that happens,
 235   // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
 236   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 237   // that do not require siginfo/ucontext first.
 238 
 239   if (sig == SIGPIPE || sig == SIGXFSZ) {
 240     // allow chained handler to go first
 241     if (os::Linux::chained_handler(sig, info, ucVoid)) {
 242       return true;
 243     } else {
 244       if (PrintMiscellaneous && (WizardMode || Verbose)) {




 204     return frame();
 205   } else {
 206     return os::get_sender_for_C_frame(&myframe);
 207   }
 208 }
 209 
 210 // Utility functions
 211 
 212 // From IA32 System Programming Guide
 213 enum {
 214   trap_page_fault = 0xE
 215 };
 216 
 217 extern "C" JNIEXPORT int
 218 JVM_handle_linux_signal(int sig,
 219                         siginfo_t* info,
 220                         void* ucVoid,
 221                         int abort_if_unrecognized) {
 222   ucontext_t* uc = (ucontext_t*) ucVoid;
 223 
 224   Thread* t = Thread::current_or_null_safe();
 225 
 226   // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
 227   // (no destructors can be run)
 228   os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
 229 
 230   SignalHandlerMark shm(t);
 231 
 232   // Note: it's not uncommon that JNI code uses signal/sigset to install
 233   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 234   // or have a SIGILL handler when detecting CPU type). When that happens,
 235   // JVM_handle_linux_signal() might be invoked with junk info/ucVoid. To
 236   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 237   // that do not require siginfo/ucontext first.
 238 
 239   if (sig == SIGPIPE || sig == SIGXFSZ) {
 240     // allow chained handler to go first
 241     if (os::Linux::chained_handler(sig, info, ucVoid)) {
 242       return true;
 243     } else {
 244       if (PrintMiscellaneous && (WizardMode || Verbose)) {


< prev index next >