Mercurial > hg > truffle
comparison src/share/vm/runtime/sharedRuntime.cpp @ 17620:69dc1be43fce
8029873: compiler/uncommontrap/TestStackBangRbp.java crashes with SIGSEGV
Summary: May end up in uncommon trap blob/deopt blob with unguarded stack
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Wed, 08 Jan 2014 09:49:31 +0100 |
parents | d6e7180abab5 |
children | 7b9127b17b7a |
comparison
equal
deleted
inserted
replaced
17619:5231c2210388 | 17620:69dc1be43fce |
---|---|
492 thread->set_is_method_handle_return(nm->is_method_handle_return(return_address)); | 492 thread->set_is_method_handle_return(nm->is_method_handle_return(return_address)); |
493 // native nmethods don't have exception handlers | 493 // native nmethods don't have exception handlers |
494 assert(!nm->is_native_method(), "no exception handler"); | 494 assert(!nm->is_native_method(), "no exception handler"); |
495 assert(nm->header_begin() != nm->exception_begin(), "no exception handler"); | 495 assert(nm->header_begin() != nm->exception_begin(), "no exception handler"); |
496 if (nm->is_deopt_pc(return_address)) { | 496 if (nm->is_deopt_pc(return_address)) { |
497 // If we come here because of a stack overflow, the stack may be | |
498 // unguarded. Reguard the stack otherwise if we return to the | |
499 // deopt blob and the stack bang causes a stack overflow we | |
500 // crash. | |
501 bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); | |
502 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); | |
503 assert(guard_pages_enabled, "stack banging in deopt blob may cause crash"); | |
497 return SharedRuntime::deopt_blob()->unpack_with_exception(); | 504 return SharedRuntime::deopt_blob()->unpack_with_exception(); |
498 } else { | 505 } else { |
499 return nm->exception_begin(); | 506 return nm->exception_begin(); |
500 } | 507 } |
501 } | 508 } |