< prev index next >

src/os_cpu/linux_zero/vm/os_linux_zero.cpp

Print this page




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




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


< prev index next >