< prev index next >

src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.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  *


 419           thread->disable_stack_yellow_reserved_zone();
 420           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
 421         } else {
 422           // Thread was in the vm or native code.  Return and try to finish.
 423           thread->disable_stack_yellow_reserved_zone();
 424           return true;
 425         }
 426       } else if (thread->in_stack_red_zone(addr)) {
 427         // Fatal red zone violation.  Disable the guard pages and fall through
 428         // to handle_unexpected_exception way down below.
 429         thread->disable_stack_red_zone();
 430         tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
 431         // Sometimes the register windows are not properly flushed.
 432         if(uc->uc_mcontext.gwins != NULL) {
 433           ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
 434         }
 435       }
 436     }
 437 
 438 
 439     if (thread->thread_state() == _thread_in_vm ||
 440         thread->thread_state() == _thread_in_native) {
 441       if (sig == SIGBUS && thread->doing_unsafe_access()) {
 442         if (UnsafeCopyMemory::contains_pc(pc)) {
 443           npc = UnsafeCopyMemory::page_error_continue_pc(pc);
 444         }
 445         stub = SharedRuntime::handle_unsafe_access(thread, npc);
 446       }
 447     }
 448 
 449     else if (thread->thread_state() == _thread_in_Java) {
 450       // Java thread running in Java code => find exception handler if any
 451       // a fault inside compiled code, the interpreter, or a stub
 452 
 453       // Support Safepoint Polling
 454       if (sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
 455         stub = SharedRuntime::get_poll_stub(pc);
 456       }
 457 
 458       // Not needed on x86 solaris because verify_oops doesn't generate
 459       // SEGV/BUS like sparc does.
 460       if ( (sig == SIGSEGV || sig == SIGBUS)
 461            && pc >= MacroAssembler::_verify_oop_implicit_branch[0]
 462            && pc <  MacroAssembler::_verify_oop_implicit_branch[1] ) {
 463         stub     =  MacroAssembler::_verify_oop_implicit_branch[2];
 464         warning("fixed up memory fault in +VerifyOops at address " INTPTR_FORMAT, info->si_addr);
 465       }
 466 
 467       // This is not factored because on x86 solaris the patching for
 468       // zombies does not generate a SEGV.
 469       else if (sig == SIGSEGV && nativeInstruction_at(pc)->is_zombie()) {
 470         // zombie method (ld [%g0],%o7 instruction)
 471         stub = SharedRuntime::get_handle_wrong_method_stub();
 472 
 473         // At the stub it needs to look like a call from the caller of this
 474         // method (not a call from the segv site).
 475         pc = (address)uc->uc_mcontext.gregs[REG_O7];
 476       }
 477       else if (sig == SIGBUS && info->si_code == BUS_OBJERR) {
 478         // BugId 4454115: A read from a MappedByteBuffer can fault
 479         // here if the underlying file has been truncated.
 480         // Do not crash the VM in such a case.
 481         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
 482         CompiledMethod* nm = cb->as_compiled_method_or_null();
 483         bool is_unsafe_arraycopy = (thread->doing_unsafe_access() && UnsafeCopyMemory::contains_pc(pc));
 484         if ((nm != NULL && nm->has_unsafe_access()) || is_unsafe_arraycopy) {
 485           if (is_unsafe_arraycopy) {
 486             npc = UnsafeCopyMemory::page_error_continue_pc(pc);
 487           }
 488           stub = SharedRuntime::handle_unsafe_access(thread, npc);
 489         }
 490       }
 491 
 492       else if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
 493         // integer divide by zero
 494         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 495       }
 496       else if (sig == SIGFPE && info->si_code == FPE_FLTDIV) {
 497         // floating-point divide by zero
 498         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 499       }
 500 #ifdef COMPILER2
 501       else if (sig == SIGILL && nativeInstruction_at(pc)->is_ic_miss_trap()) {
 502 #ifdef ASSERT
 503   #ifdef TIERED
 504         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
 505         assert(cb->is_compiled_by_c2(), "Wrong compiler");
 506   #endif // TIERED
 507 #endif // ASSERT


   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  *


 419           thread->disable_stack_yellow_reserved_zone();
 420           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
 421         } else {
 422           // Thread was in the vm or native code.  Return and try to finish.
 423           thread->disable_stack_yellow_reserved_zone();
 424           return true;
 425         }
 426       } else if (thread->in_stack_red_zone(addr)) {
 427         // Fatal red zone violation.  Disable the guard pages and fall through
 428         // to handle_unexpected_exception way down below.
 429         thread->disable_stack_red_zone();
 430         tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
 431         // Sometimes the register windows are not properly flushed.
 432         if(uc->uc_mcontext.gwins != NULL) {
 433           ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
 434         }
 435       }
 436     }
 437 
 438 
 439     if (thread->thread_state() == _thread_in_vm) {

 440       if (sig == SIGBUS && thread->doing_unsafe_access()) {



 441         stub = SharedRuntime::handle_unsafe_access(thread, npc);
 442       }
 443     }
 444 
 445     else if (thread->thread_state() == _thread_in_Java) {
 446       // Java thread running in Java code => find exception handler if any
 447       // a fault inside compiled code, the interpreter, or a stub
 448 
 449       // Support Safepoint Polling
 450       if (sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
 451         stub = SharedRuntime::get_poll_stub(pc);
 452       }
 453 
 454       // Not needed on x86 solaris because verify_oops doesn't generate
 455       // SEGV/BUS like sparc does.
 456       if ( (sig == SIGSEGV || sig == SIGBUS)
 457            && pc >= MacroAssembler::_verify_oop_implicit_branch[0]
 458            && pc <  MacroAssembler::_verify_oop_implicit_branch[1] ) {
 459         stub     =  MacroAssembler::_verify_oop_implicit_branch[2];
 460         warning("fixed up memory fault in +VerifyOops at address " INTPTR_FORMAT, info->si_addr);
 461       }
 462 
 463       // This is not factored because on x86 solaris the patching for
 464       // zombies does not generate a SEGV.
 465       else if (sig == SIGSEGV && nativeInstruction_at(pc)->is_zombie()) {
 466         // zombie method (ld [%g0],%o7 instruction)
 467         stub = SharedRuntime::get_handle_wrong_method_stub();
 468 
 469         // At the stub it needs to look like a call from the caller of this
 470         // method (not a call from the segv site).
 471         pc = (address)uc->uc_mcontext.gregs[REG_O7];
 472       }
 473       else if (sig == SIGBUS && info->si_code == BUS_OBJERR) {
 474         // BugId 4454115: A read from a MappedByteBuffer can fault
 475         // here if the underlying file has been truncated.
 476         // Do not crash the VM in such a case.
 477         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
 478         CompiledMethod* nm = cb->as_compiled_method_or_null();
 479         if (nm != NULL && nm->has_unsafe_access()) {




 480           stub = SharedRuntime::handle_unsafe_access(thread, npc);
 481         }
 482       }
 483 
 484       else if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
 485         // integer divide by zero
 486         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 487       }
 488       else if (sig == SIGFPE && info->si_code == FPE_FLTDIV) {
 489         // floating-point divide by zero
 490         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 491       }
 492 #ifdef COMPILER2
 493       else if (sig == SIGILL && nativeInstruction_at(pc)->is_ic_miss_trap()) {
 494 #ifdef ASSERT
 495   #ifdef TIERED
 496         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
 497         assert(cb->is_compiled_by_c2(), "Wrong compiler");
 498   #endif // TIERED
 499 #endif // ASSERT


< prev index next >