mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8029873: compiler/uncommontrap/TestStackBangRbp.java crashes with SIGSEGV
May end up in uncommon trap blob/deopt blob with unguarded stack Reviewed-by: kvn, twisti
This commit is contained in:
parent
dd042bf16e
commit
cb7814987c
3 changed files with 373 additions and 1 deletions
|
@ -494,6 +494,13 @@ address SharedRuntime::raw_exception_handler_for_return_address(JavaThread* thre
|
|||
assert(!nm->is_native_method(), "no exception handler");
|
||||
assert(nm->header_begin() != nm->exception_begin(), "no exception handler");
|
||||
if (nm->is_deopt_pc(return_address)) {
|
||||
// If we come here because of a stack overflow, the stack may be
|
||||
// unguarded. Reguard the stack otherwise if we return to the
|
||||
// deopt blob and the stack bang causes a stack overflow we
|
||||
// crash.
|
||||
bool guard_pages_enabled = thread->stack_yellow_zone_enabled();
|
||||
if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack();
|
||||
assert(guard_pages_enabled, "stack banging in deopt blob may cause crash");
|
||||
return SharedRuntime::deopt_blob()->unpack_with_exception();
|
||||
} else {
|
||||
return nm->exception_begin();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue