< prev index next >

src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp

Print this page


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


 176     if (sig == SIGSEGV || sig == SIGBUS) {
 177       address addr = (address) info->si_addr;
 178 
 179       // check if fault address is within thread stack
 180       if (thread->on_local_stack(addr)) {
 181         // stack overflow
 182         if (thread->in_stack_yellow_reserved_zone(addr)) {
 183           thread->disable_stack_yellow_reserved_zone();
 184           ShouldNotCallThis();
 185         }
 186         else if (thread->in_stack_red_zone(addr)) {
 187           thread->disable_stack_red_zone();
 188           ShouldNotCallThis();
 189         }
 190       }
 191     }
 192 
 193     /*if (thread->thread_state() == _thread_in_Java) {
 194       ShouldNotCallThis();
 195     }
 196     else*/ if ((thread->thread_state() == _thread_in_vm ||
 197                thread->thread_state() == _thread_in_native) &&
 198                sig == SIGBUS && thread->doing_unsafe_access()) {
 199       ShouldNotCallThis();
 200     }
 201 
 202     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC
 203     // kicks in and the heap gets shrunk before the field access.
 204     /*if (sig == SIGSEGV || sig == SIGBUS) {
 205       address addr = JNI_FastGetField::find_slowcase_pc(pc);
 206       if (addr != (address)-1) {
 207         stub = addr;
 208       }
 209     }*/
 210   }
 211 
 212   // signal-chaining
 213   if (os::Bsd::chained_handler(sig, info, ucVoid)) {
 214      return true;
 215   }
 216 
 217   if (!abort_if_unrecognized) {


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


 176     if (sig == SIGSEGV || sig == SIGBUS) {
 177       address addr = (address) info->si_addr;
 178 
 179       // check if fault address is within thread stack
 180       if (thread->on_local_stack(addr)) {
 181         // stack overflow
 182         if (thread->in_stack_yellow_reserved_zone(addr)) {
 183           thread->disable_stack_yellow_reserved_zone();
 184           ShouldNotCallThis();
 185         }
 186         else if (thread->in_stack_red_zone(addr)) {
 187           thread->disable_stack_red_zone();
 188           ShouldNotCallThis();
 189         }
 190       }
 191     }
 192 
 193     /*if (thread->thread_state() == _thread_in_Java) {
 194       ShouldNotCallThis();
 195     }
 196     else*/ if (thread->thread_state() == _thread_in_vm &&

 197                sig == SIGBUS && thread->doing_unsafe_access()) {
 198       ShouldNotCallThis();
 199     }
 200 
 201     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC
 202     // kicks in and the heap gets shrunk before the field access.
 203     /*if (sig == SIGSEGV || sig == SIGBUS) {
 204       address addr = JNI_FastGetField::find_slowcase_pc(pc);
 205       if (addr != (address)-1) {
 206         stub = addr;
 207       }
 208     }*/
 209   }
 210 
 211   // signal-chaining
 212   if (os::Bsd::chained_handler(sig, info, ucVoid)) {
 213      return true;
 214   }
 215 
 216   if (!abort_if_unrecognized) {


< prev index next >