< prev index next >

src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp

Print this page




 117 
 118 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
 119                                         intptr_t** ret_sp,
 120                                         intptr_t** ret_fp) {
 121   ShouldNotCallThis();
 122   return ExtendedPC();
 123 }
 124 
 125 frame os::fetch_frame_from_context(void* ucVoid) {
 126   ShouldNotCallThis();
 127   return frame();
 128 }
 129 
 130 extern "C" JNIEXPORT int
 131 JVM_handle_bsd_signal(int sig,
 132                         siginfo_t* info,
 133                         void* ucVoid,
 134                         int abort_if_unrecognized) {
 135   ucontext_t* uc = (ucontext_t*) ucVoid;
 136 
 137   Thread* t = ThreadLocalStorage::get_thread_slow();
 138 
 139   SignalHandlerMark shm(t);
 140 
 141   // handle SafeFetch faults
 142   if (sig == SIGSEGV || sig == SIGBUS) {
 143     sigjmp_buf* const pjb = get_jmp_buf_for_continuation();
 144     if (pjb) {
 145       siglongjmp(*pjb, 1);
 146     }
 147   }
 148 
 149   // Note: it's not uncommon that JNI code uses signal/sigset to
 150   // install then restore certain signal handler (e.g. to temporarily
 151   // block SIGPIPE, or have a SIGILL handler when detecting CPU
 152   // type). When that happens, JVM_handle_bsd_signal() might be
 153   // invoked with junk info/ucVoid. To avoid unnecessary crash when
 154   // libjsig is not preloaded, try handle signals that do not require
 155   // siginfo/ucontext first.
 156 
 157   if (sig == SIGPIPE || sig == SIGXFSZ) {




 117 
 118 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
 119                                         intptr_t** ret_sp,
 120                                         intptr_t** ret_fp) {
 121   ShouldNotCallThis();
 122   return ExtendedPC();
 123 }
 124 
 125 frame os::fetch_frame_from_context(void* ucVoid) {
 126   ShouldNotCallThis();
 127   return frame();
 128 }
 129 
 130 extern "C" JNIEXPORT int
 131 JVM_handle_bsd_signal(int sig,
 132                         siginfo_t* info,
 133                         void* ucVoid,
 134                         int abort_if_unrecognized) {
 135   ucontext_t* uc = (ucontext_t*) ucVoid;
 136 
 137   Thread* t = Thread::current();
 138 
 139   SignalHandlerMark shm(t);
 140 
 141   // handle SafeFetch faults
 142   if (sig == SIGSEGV || sig == SIGBUS) {
 143     sigjmp_buf* const pjb = get_jmp_buf_for_continuation();
 144     if (pjb) {
 145       siglongjmp(*pjb, 1);
 146     }
 147   }
 148 
 149   // Note: it's not uncommon that JNI code uses signal/sigset to
 150   // install then restore certain signal handler (e.g. to temporarily
 151   // block SIGPIPE, or have a SIGILL handler when detecting CPU
 152   // type). When that happens, JVM_handle_bsd_signal() might be
 153   // invoked with junk info/ucVoid. To avoid unnecessary crash when
 154   // libjsig is not preloaded, try handle signals that do not require
 155   // siginfo/ucontext first.
 156 
 157   if (sig == SIGPIPE || sig == SIGXFSZ) {


< prev index next >