< prev index next >

src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 500           thread->disable_stack_yellow_reserved_zone();
 501           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
 502         } else {
 503           // Thread was in the vm or native code.  Return and try to finish.
 504           thread->disable_stack_yellow_reserved_zone();
 505           return true;
 506         }
 507       } else if (thread->in_stack_red_zone(addr)) {
 508         // Fatal red zone violation.  Disable the guard pages and fall through
 509         // to handle_unexpected_exception way down below.
 510         thread->disable_stack_red_zone();
 511         tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
 512       }
 513     }
 514 
 515     if ((sig == SIGSEGV) && VM_Version::is_cpuinfo_segv_addr(pc)) {
 516       // Verify that OS save/restore AVX registers.
 517       stub = VM_Version::cpuinfo_cont_addr();
 518     }
 519 
 520     if (thread->thread_state() == _thread_in_vm ||
 521          thread->thread_state() == _thread_in_native) {
 522       if (sig == SIGBUS && info->si_code == BUS_OBJERR && thread->doing_unsafe_access()) {
 523         address next_pc = Assembler::locate_next_instruction(pc);
 524         if (UnsafeCopyMemory::contains_pc(pc)) {
 525           next_pc = UnsafeCopyMemory::page_error_continue_pc(pc);
 526         }
 527         stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
 528       }
 529     }
 530 
 531     if (thread->thread_state() == _thread_in_Java) {
 532       // Support Safepoint Polling
 533       if ( sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
 534         stub = SharedRuntime::get_poll_stub(pc);
 535       }
 536       else if (sig == SIGBUS && info->si_code == BUS_OBJERR) {
 537         // BugId 4454115: A read from a MappedByteBuffer can fault
 538         // here if the underlying file has been truncated.
 539         // Do not crash the VM in such a case.
 540         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
 541         if (cb != NULL) {
 542           CompiledMethod* nm = cb->as_compiled_method_or_null();
 543           bool is_unsafe_arraycopy = thread->doing_unsafe_access() && UnsafeCopyMemory::contains_pc(pc);
 544           if ((nm != NULL && nm->has_unsafe_access()) || is_unsafe_arraycopy) {
 545             address next_pc = Assembler::locate_next_instruction(pc);
 546             if (is_unsafe_arraycopy) {
 547               next_pc = UnsafeCopyMemory::page_error_continue_pc(pc);
 548             }
 549             stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
 550           }
 551         }
 552       }
 553       else
 554       if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
 555         // integer divide by zero
 556         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 557       }
 558 #ifndef AMD64
 559       else if (sig == SIGFPE && info->si_code == FPE_FLTDIV) {
 560         // floating-point divide by zero
 561         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 562       }
 563       else if (sig == SIGFPE && info->si_code == FPE_FLTINV) {
 564         // The encoding of D2I in i486.ad can cause an exception prior
 565         // to the fist instruction if there was an invalid operation
 566         // pending. We want to dismiss that exception. From the win_32
 567         // side it also seems that if it really was the fist causing
 568         // the exception that we do the d2i by hand with different


   1 /*
   2  * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 500           thread->disable_stack_yellow_reserved_zone();
 501           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
 502         } else {
 503           // Thread was in the vm or native code.  Return and try to finish.
 504           thread->disable_stack_yellow_reserved_zone();
 505           return true;
 506         }
 507       } else if (thread->in_stack_red_zone(addr)) {
 508         // Fatal red zone violation.  Disable the guard pages and fall through
 509         // to handle_unexpected_exception way down below.
 510         thread->disable_stack_red_zone();
 511         tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
 512       }
 513     }
 514 
 515     if ((sig == SIGSEGV) && VM_Version::is_cpuinfo_segv_addr(pc)) {
 516       // Verify that OS save/restore AVX registers.
 517       stub = VM_Version::cpuinfo_cont_addr();
 518     }
 519 
 520     if (thread->thread_state() == _thread_in_vm) {

 521       if (sig == SIGBUS && info->si_code == BUS_OBJERR && thread->doing_unsafe_access()) {
 522         address next_pc = Assembler::locate_next_instruction(pc);



 523         stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
 524       }
 525     }
 526 
 527     if (thread->thread_state() == _thread_in_Java) {
 528       // Support Safepoint Polling
 529       if ( sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
 530         stub = SharedRuntime::get_poll_stub(pc);
 531       }
 532       else if (sig == SIGBUS && info->si_code == BUS_OBJERR) {
 533         // BugId 4454115: A read from a MappedByteBuffer can fault
 534         // here if the underlying file has been truncated.
 535         // Do not crash the VM in such a case.
 536         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
 537         if (cb != NULL) {
 538           CompiledMethod* nm = cb->as_compiled_method_or_null();
 539           if (nm != NULL && nm->has_unsafe_access()) {

 540             address next_pc = Assembler::locate_next_instruction(pc);



 541             stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
 542           }
 543         }
 544       }
 545       else
 546       if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
 547         // integer divide by zero
 548         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 549       }
 550 #ifndef AMD64
 551       else if (sig == SIGFPE && info->si_code == FPE_FLTDIV) {
 552         // floating-point divide by zero
 553         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 554       }
 555       else if (sig == SIGFPE && info->si_code == FPE_FLTINV) {
 556         // The encoding of D2I in i486.ad can cause an exception prior
 557         // to the fist instruction if there was an invalid operation
 558         // pending. We want to dismiss that exception. From the win_32
 559         // side it also seems that if it really was the fist causing
 560         // the exception that we do the d2i by hand with different


< prev index next >