mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
Reviewed-by: dholmes, dcubed, coleenp
This commit is contained in:
parent
be0d2c98ed
commit
a900715bbf
3 changed files with 20 additions and 10 deletions
|
@ -65,10 +65,10 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
|||
#ifdef AMD64
|
||||
// Very large C++ stack frames using solaris-amd64 optimized builds
|
||||
// due to lack of optimization caused by C++ compiler bugs
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (NOT_WIN64(20) WIN64_ONLY(6) DEBUG_ONLY(+2))
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (NOT_WIN64(20) WIN64_ONLY(7) DEBUG_ONLY(+2))
|
||||
// For those clients that do not use write socket, we allow
|
||||
// the min range value to be below that of the default
|
||||
#define MIN_STACK_SHADOW_PAGES (NOT_WIN64(10) WIN64_ONLY(6) DEBUG_ONLY(+2))
|
||||
#define MIN_STACK_SHADOW_PAGES (NOT_WIN64(10) WIN64_ONLY(7) DEBUG_ONLY(+2))
|
||||
#else
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5))
|
||||
#define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
|
||||
|
|
|
@ -2504,6 +2504,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
|||
// It write enables the page immediately after protecting it
|
||||
// so just return.
|
||||
if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
|
||||
if (t != NULL && t->is_Java_thread()) {
|
||||
JavaThread* thread = (JavaThread*) t;
|
||||
PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
|
||||
address addr = (address) exceptionRecord->ExceptionInformation[1];
|
||||
|
@ -2513,6 +2514,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
|||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((exception_code == EXCEPTION_ACCESS_VIOLATION) &&
|
||||
VM_Version::is_cpuinfo_segv_addr(pc)) {
|
||||
|
@ -2564,7 +2566,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
|||
}
|
||||
#endif
|
||||
if (thread->stack_guards_enabled()) {
|
||||
if (_thread_in_Java) {
|
||||
if (in_java) {
|
||||
frame fr;
|
||||
PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
|
||||
address addr = (address) exceptionRecord->ExceptionInformation[1];
|
||||
|
@ -2576,6 +2578,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
|||
// Yellow zone violation. The o/s has unprotected the first yellow
|
||||
// zone page for us. Note: must call disable_stack_yellow_zone to
|
||||
// update the enabled status, even if the zone contains only one page.
|
||||
assert(thread->thread_state() != _thread_in_vm, "Undersized StackShadowPages");
|
||||
thread->disable_stack_yellow_reserved_zone();
|
||||
// If not in java code, return and hope for the best.
|
||||
return in_java
|
||||
|
|
|
@ -219,6 +219,9 @@ class ThreadInVMfromJava : public ThreadStateTransition {
|
|||
trans_from_java(_thread_in_vm);
|
||||
}
|
||||
~ThreadInVMfromJava() {
|
||||
if (_thread->stack_yellow_reserved_zone_disabled()) {
|
||||
_thread->enable_stack_yellow_reserved_zone();
|
||||
}
|
||||
trans(_thread_in_vm, _thread_in_Java);
|
||||
// Check for pending. async. exceptions or suspends.
|
||||
if (_thread->has_special_runtime_exit_condition()) _thread->handle_special_runtime_exit_condition();
|
||||
|
@ -306,6 +309,9 @@ class ThreadInVMfromJavaNoAsyncException : public ThreadStateTransition {
|
|||
trans_from_java(_thread_in_vm);
|
||||
}
|
||||
~ThreadInVMfromJavaNoAsyncException() {
|
||||
if (_thread->stack_yellow_reserved_zone_disabled()) {
|
||||
_thread->enable_stack_yellow_reserved_zone();
|
||||
}
|
||||
trans(_thread_in_vm, _thread_in_Java);
|
||||
// NOTE: We do not check for pending. async. exceptions.
|
||||
// If we did and moved the pending async exception over into the
|
||||
|
@ -314,6 +320,7 @@ class ThreadInVMfromJavaNoAsyncException : public ThreadStateTransition {
|
|||
// to the _thread_in_vm state. Instead we postpone the handling of
|
||||
// the async exception.
|
||||
|
||||
|
||||
// Check for pending. suspends only.
|
||||
if (_thread->has_special_runtime_exit_condition())
|
||||
_thread->handle_special_runtime_exit_condition(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue