comparison src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @ 6085:4073d9478a90

7167254: Crash on OSX in Enumerator.nextElement() with compressed oops Summary: null checks in "compressed oops with base" mode may trigger a SIGBUS rather than a SIGSEGV. Reviewed-by: dsamersoff, dcubed, rbackman, kvn
author roland
date Fri, 18 May 2012 15:50:09 +0200
parents da4be62fb889
children 40782a131183
comparison
equal deleted inserted replaced
6084:6759698e3140 6085:4073d9478a90
520 // Java thread running in Java code => find exception handler if any 520 // Java thread running in Java code => find exception handler if any
521 // a fault inside compiled code, the interpreter, or a stub 521 // a fault inside compiled code, the interpreter, or a stub
522 522
523 if ((sig == SIGSEGV || sig == SIGBUS) && os::is_poll_address((address)info->si_addr)) { 523 if ((sig == SIGSEGV || sig == SIGBUS) && os::is_poll_address((address)info->si_addr)) {
524 stub = SharedRuntime::get_poll_stub(pc); 524 stub = SharedRuntime::get_poll_stub(pc);
525 #if defined(__APPLE__) && !defined(AMD64) 525 #if defined(__APPLE__)
526 // 32-bit Darwin reports a SIGBUS for nearly all memory access exceptions. 526 // 32-bit Darwin reports a SIGBUS for nearly all memory access exceptions.
527 // 64-bit Darwin may also use a SIGBUS (seen with compressed oops).
527 // Catching SIGBUS here prevents the implicit SIGBUS NULL check below from 528 // Catching SIGBUS here prevents the implicit SIGBUS NULL check below from
528 // being called, so only do so if the implicit NULL check is not necessary. 529 // being called, so only do so if the implicit NULL check is not necessary.
529 } else if (sig == SIGBUS && MacroAssembler::needs_explicit_null_check((int)info->si_addr)) { 530 } else if (sig == SIGBUS && MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
530 #else 531 #else
531 } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) { 532 } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) {
532 #endif 533 #endif
533 // BugId 4454115: A read from a MappedByteBuffer can fault 534 // BugId 4454115: A read from a MappedByteBuffer can fault
534 // here if the underlying file has been truncated. 535 // here if the underlying file has been truncated.