< prev index next >

src/os_cpu/linux_x86/vm/os_linux_x86.cpp

Print this page
rev 7905 : 8074552:  SafeFetch32 and SafeFetchN do not work in error handling
Summary: handle SafeFetch faults in secondary signal handlers
Contributed-by: Thomas Stuefe

*** 120,129 **** --- 120,133 ---- address os::Linux::ucontext_get_pc(ucontext_t * uc) { return (address)uc->uc_mcontext.gregs[REG_PC]; } + void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) { + uc->uc_mcontext.gregs[REG_PC] = (intptr_t)pc; + } + intptr_t* os::Linux::ucontext_get_sp(ucontext_t * uc) { return (intptr_t*)uc->uc_mcontext.gregs[REG_SP]; } intptr_t* os::Linux::ucontext_get_fp(ucontext_t * uc) {
*** 277,287 **** //%note os_trap_1 if (info != NULL && uc != NULL && thread != NULL) { pc = (address) os::Linux::ucontext_get_pc(uc); if (StubRoutines::is_safefetch_fault(pc)) { ! uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc)); return 1; } #ifndef AMD64 // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs --- 281,291 ---- //%note os_trap_1 if (info != NULL && uc != NULL && thread != NULL) { pc = (address) os::Linux::ucontext_get_pc(uc); if (StubRoutines::is_safefetch_fault(pc)) { ! os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc)); return 1; } #ifndef AMD64 // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs
*** 512,522 **** if (stub != NULL) { // save all thread context in case we need to restore it if (thread != NULL) thread->set_saved_exception_pc(pc); ! uc->uc_mcontext.gregs[REG_PC] = (greg_t)stub; return true; } // signal-chaining if (os::Linux::chained_handler(sig, info, ucVoid)) { --- 516,526 ---- if (stub != NULL) { // save all thread context in case we need to restore it if (thread != NULL) thread->set_saved_exception_pc(pc); ! os::Linux::ucontext_set_pc(uc, stub); return true; } // signal-chaining if (os::Linux::chained_handler(sig, info, ucVoid)) {
< prev index next >