< prev index next >

src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp

Print this page
rev 8111 : 8078482: ppc: pass thread to throw_AbstractMethodError
Summary: Also improve check for Safepoints in signal handler.
Reviewed-by: kvn, simonis
   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2012, 2014 SAP AG. All rights reserved.
   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 hat
  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.
  23  *


 281           }
 282         }
 283       }
 284     }
 285 
 286     if (thread->thread_state() == _thread_in_Java) {
 287       // Java thread running in Java code => find exception handler if any
 288       // a fault inside compiled code, the interpreter, or a stub
 289 
 290       // A VM-related SIGILL may only occur if we are not in the zero page.
 291       // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else
 292       // in the zero page, because it is filled with 0x0. We ignore
 293       // explicit SIGILLs in the zero page.
 294       if (sig == SIGILL && (pc < (address) 0x200)) {
 295         if (TraceTraps) {
 296           tty->print_raw_cr("SIGILL happened inside zero page.");
 297         }
 298         goto report_and_die;
 299       }
 300 

 301       // Handle signal from NativeJump::patch_verified_entry().
 302       if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
 303           (!TrapBasedNotEntrantChecks && sig == SIGILL  && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
 304         if (TraceTraps) {
 305           tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
 306         }
 307         stub = SharedRuntime::get_handle_wrong_method_stub();
 308       }
 309 
 310       else if (sig == SIGSEGV &&
 311                // A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
 312                // in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6),
 313                // especially when we try to read from the safepoint polling page. So the check
 314                //   (address)info->si_addr == os::get_standard_polling_page()
 315                // doesn't work for us. We use:
 316                ((NativeInstruction*)pc)->is_safepoint_poll()) {



 317         if (TraceTraps) {
 318           tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
 319         }
 320         stub = SharedRuntime::get_poll_stub(pc);
 321       }
 322 
 323       // SIGTRAP-based ic miss check in compiled code.
 324       else if (sig == SIGTRAP && TrapBasedICMissChecks &&
 325                nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
 326         if (TraceTraps) {
 327           tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
 328         }
 329         stub = SharedRuntime::get_ic_miss_stub();
 330       }
 331 
 332       // SIGTRAP-based implicit null check in compiled code.
 333       else if (sig == SIGTRAP && TrapBasedNullChecks &&
 334                nativeInstruction_at(pc)->is_sigtrap_null_check()) {
 335         if (TraceTraps) {
 336           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));


   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2012, 2015 SAP AG. All rights reserved.
   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 hat
  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.
  23  *


 281           }
 282         }
 283       }
 284     }
 285 
 286     if (thread->thread_state() == _thread_in_Java) {
 287       // Java thread running in Java code => find exception handler if any
 288       // a fault inside compiled code, the interpreter, or a stub
 289 
 290       // A VM-related SIGILL may only occur if we are not in the zero page.
 291       // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else
 292       // in the zero page, because it is filled with 0x0. We ignore
 293       // explicit SIGILLs in the zero page.
 294       if (sig == SIGILL && (pc < (address) 0x200)) {
 295         if (TraceTraps) {
 296           tty->print_raw_cr("SIGILL happened inside zero page.");
 297         }
 298         goto report_and_die;
 299       }
 300 
 301       CodeBlob *cb = NULL;
 302       // Handle signal from NativeJump::patch_verified_entry().
 303       if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
 304           (!TrapBasedNotEntrantChecks && sig == SIGILL  && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
 305         if (TraceTraps) {
 306           tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
 307         }
 308         stub = SharedRuntime::get_handle_wrong_method_stub();
 309       }
 310 
 311       else if (sig == SIGSEGV &&
 312                // A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
 313                // in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6),
 314                // especially when we try to read from the safepoint polling page. So the check
 315                //   (address)info->si_addr == os::get_standard_polling_page()
 316                // doesn't work for us. We use:
 317                ((NativeInstruction*)pc)->is_safepoint_poll() &&
 318                CodeCache::contains((void*) pc) &&
 319                ((cb = CodeCache::find_blob(pc)) != NULL) &&
 320                cb->is_nmethod()) {
 321         if (TraceTraps) {
 322           tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
 323         }
 324         stub = SharedRuntime::get_poll_stub(pc);
 325       }
 326 
 327       // SIGTRAP-based ic miss check in compiled code.
 328       else if (sig == SIGTRAP && TrapBasedICMissChecks &&
 329                nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
 330         if (TraceTraps) {
 331           tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
 332         }
 333         stub = SharedRuntime::get_ic_miss_stub();
 334       }
 335 
 336       // SIGTRAP-based implicit null check in compiled code.
 337       else if (sig == SIGTRAP && TrapBasedNullChecks &&
 338                nativeInstruction_at(pc)->is_sigtrap_null_check()) {
 339         if (TraceTraps) {
 340           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));


< prev index next >