mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8159335: Fix problems with stack overflow handling
Reviewed-by: dlong, coleenp, mdoerr
This commit is contained in:
parent
dd9df0a16c
commit
8a945875b6
33 changed files with 182 additions and 235 deletions
|
@ -3491,13 +3491,15 @@ jint os::init_2(void) {
|
|||
|
||||
// Check minimum allowable stack size for thread creation and to initialize
|
||||
// the java system classes, including StackOverflowError - depends on page
|
||||
// size. Add a page for compiler2 recursion in main thread.
|
||||
// Add in 2*BytesPerWord times page size to account for VM stack during
|
||||
// size. Add two 4K pages for compiler2 recursion in main thread.
|
||||
// Add in 4*BytesPerWord 4K pages to account for VM stack during
|
||||
// class initialization depending on 32 or 64 bit VM.
|
||||
os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed,
|
||||
JavaThread::stack_guard_zone_size() +
|
||||
JavaThread::stack_shadow_zone_size() +
|
||||
(2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size());
|
||||
(4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
|
||||
|
||||
os::Bsd::min_stack_allowed = align_size_up(os::Bsd::min_stack_allowed, os::vm_page_size());
|
||||
|
||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||
if (threadStackSizeInBytes != 0 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue