< prev index next >

src/hotspot/os_cpu/linux_zero/os_linux_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.


 190           // code with MAP_GROWSDOWN flag and then attached to VM.
 191           // See notes in os_linux.cpp.
 192           if (thread->osthread()->expanding_stack() == 0) {
 193             thread->osthread()->set_expanding_stack();
 194             if (os::Linux::manually_expand_stack(thread, addr)) {
 195               thread->osthread()->clear_expanding_stack();
 196               return true;
 197             }
 198             thread->osthread()->clear_expanding_stack();
 199           }
 200           else {
 201             fatal("recursive segv. expanding stack.");
 202           }
 203         }
 204       }
 205     }
 206 
 207     /*if (thread->thread_state() == _thread_in_Java) {
 208       ShouldNotCallThis();
 209     }
 210     else*/ if ((thread->thread_state() == _thread_in_vm ||
 211                thread->thread_state() == _thread_in_native) &&
 212                sig == SIGBUS && thread->doing_unsafe_access()) {
 213       ShouldNotCallThis();
 214     }
 215 
 216     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC
 217     // kicks in and the heap gets shrunk before the field access.
 218     /*if (sig == SIGSEGV || sig == SIGBUS) {
 219       address addr = JNI_FastGetField::find_slowcase_pc(pc);
 220       if (addr != (address)-1) {
 221         stub = addr;
 222       }
 223     }*/
 224   }
 225 
 226   // signal-chaining
 227   if (os::Linux::chained_handler(sig, info, ucVoid)) {
 228      return true;
 229   }
 230 
 231   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.


 190           // code with MAP_GROWSDOWN flag and then attached to VM.
 191           // See notes in os_linux.cpp.
 192           if (thread->osthread()->expanding_stack() == 0) {
 193             thread->osthread()->set_expanding_stack();
 194             if (os::Linux::manually_expand_stack(thread, addr)) {
 195               thread->osthread()->clear_expanding_stack();
 196               return true;
 197             }
 198             thread->osthread()->clear_expanding_stack();
 199           }
 200           else {
 201             fatal("recursive segv. expanding stack.");
 202           }
 203         }
 204       }
 205     }
 206 
 207     /*if (thread->thread_state() == _thread_in_Java) {
 208       ShouldNotCallThis();
 209     }
 210     else*/ if (thread->thread_state() == _thread_in_vm &&

 211                sig == SIGBUS && thread->doing_unsafe_access()) {
 212       ShouldNotCallThis();
 213     }
 214 
 215     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC
 216     // kicks in and the heap gets shrunk before the field access.
 217     /*if (sig == SIGSEGV || sig == SIGBUS) {
 218       address addr = JNI_FastGetField::find_slowcase_pc(pc);
 219       if (addr != (address)-1) {
 220         stub = addr;
 221       }
 222     }*/
 223   }
 224 
 225   // signal-chaining
 226   if (os::Linux::chained_handler(sig, info, ucVoid)) {
 227      return true;
 228   }
 229 
 230   if (!abort_if_unrecognized) {


< prev index next >