Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 69748 invoked from network); 17 Nov 2006 15:47:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Nov 2006 15:47:30 -0000 Received: (qmail 98049 invoked by uid 500); 17 Nov 2006 15:47:40 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 98023 invoked by uid 500); 17 Nov 2006 15:47:40 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 98012 invoked by uid 99); 17 Nov 2006 15:47:40 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Nov 2006 07:47:40 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Nov 2006 07:47:29 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 5F4901A984D; Fri, 17 Nov 2006 07:46:57 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r476183 [2/2] - in /incubator/harmony/enhanced/drlvm/trunk/vm: vmcore/include/ vmcore/src/class_support/ vmcore/src/init/ vmcore/src/jit/ vmcore/src/jni/ vmcore/src/kernel_classes/javasrc/java/lang/ vmcore/src/kernel_classes/javasrc/org/apa... Date: Fri, 17 Nov 2006 15:46:46 -0000 To: harmony-commits@incubator.apache.org From: gshimansky@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061117154657.5F4901A984D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp?view=diff&rev=476183&r1=476182&r2=476183 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp Fri Nov 17 07:46:44 2006 @@ -28,8 +28,6 @@ #include "stack_dump.h" #include "jvmti_break_intf.h" -#include "m2n.h" - // Windows specific #include #include @@ -302,92 +300,44 @@ bool run_default_handler = true; PCONTEXT context = nt_exception->ContextRecord; - - if (VM_Global_State::loader_env->shutting_down == 0) { - - TRACE2("signals", "VEH received an exception: code = 0x" << - ((void*)nt_exception->ExceptionRecord->ExceptionCode) << - " location IP = 0x" << ((void*)context->Eip)); - - // this filter catches _all_ hardware exceptions including those caused by - // VM internal code. To elimate confusion over what caused the - // exception, we first make sure the exception was thrown inside a Java - // method else crash handler or default handler is executed, this means that - // it was thrown by VM C/C++ code. - if (((code == STATUS_ACCESS_VIOLATION || - code == STATUS_INTEGER_DIVIDE_BY_ZERO || - code == STATUS_STACK_OVERFLOW) && - vm_identify_eip((void *)context->Eip) == VM_TYPE_JAVA) || - code == JVMTI_EXCEPTION_STATUS) - { + + TRACE2("signals", "VEH received an exception: code = 0x" << + ((void*)nt_exception->ExceptionRecord->ExceptionCode) << + " location IP = 0x" << ((void*)context->Eip)); + + // this filter catches _all_ hardware exceptions including those caused by + // VM internal code. To elimate confusion over what caused the + // exception, we first make sure the exception was thrown inside a Java + // method else crash handler or default handler is executed, this means that + // it was thrown by VM C/C++ code. + if (((code == STATUS_ACCESS_VIOLATION || + code == STATUS_INTEGER_DIVIDE_BY_ZERO || + code == STATUS_STACK_OVERFLOW) && + vm_identify_eip((void *)context->Eip) == VM_TYPE_JAVA) || + code == JVMTI_EXCEPTION_STATUS) { run_default_handler = false; - } else if (code == STATUS_STACK_OVERFLOW) { - if (is_unwindable()) { - if (hythread_is_suspend_enabled()) { - tmn_suspend_disable(); - } - run_default_handler = false; - } else { - M2nFrame* frame = m2n_get_last_frame(); - Global_Env *env = VM_Global_State::loader_env; - exn_raise_by_class(env->java_lang_StackOverflowError_Class); - p_TLS_vmthread->restore_guard_page = true; - return EXCEPTION_CONTINUE_EXECUTION; + } else if (code == STATUS_STACK_OVERFLOW) { + if (is_unwindable()) { + if (hythread_is_suspend_enabled()) { + tmn_suspend_disable(); } - } - - } else { - if (VM_Global_State::loader_env->shutting_down > 1) { - // Deadly errors in shutdown. - fprintf(stderr, "SEH handler: too many shutdown errors"); - return EXCEPTION_CONTINUE_SEARCH; + run_default_handler = false; } else { - fprintf(stderr, "SEH handler: shutdown error"); + Global_Env *env = VM_Global_State::loader_env; + exn_raise_by_class(env->java_lang_StackOverflowError_Class); + p_TLS_vmthread->restore_guard_page = true; + return EXCEPTION_CONTINUE_EXECUTION; } } if (run_default_handler) { - const char *msg = 0; - switch (code) { - // list of errors we can handle: - case STATUS_ACCESS_VIOLATION: msg = "ACCESS_VIOLATION"; break; - case STATUS_INTEGER_DIVIDE_BY_ZERO: msg = "INTEGER_DIVIDE_BY_ZERO"; break; - case STATUS_PRIVILEGED_INSTRUCTION: msg = "PRIVILEGED_INSTRUCTION"; break; - case STATUS_SINGLE_STEP: msg = "SINGLE_STEP"; break; - case STATUS_BREAKPOINT: msg = "BREAKPOINT"; break; - case STATUS_ILLEGAL_INSTRUCTION: msg = "ILLEGAL_INSTRUCTION"; break; - case STATUS_GUARD_PAGE_VIOLATION: msg = "GUARD_PAGE_VIOLATION"; break; - case STATUS_INVALID_HANDLE: msg = "INVALID_HANDLE"; break; - case STATUS_DATATYPE_MISALIGNMENT: msg = "DATATYPE_MISALIGNMENT"; break; - case STATUS_FLOAT_INVALID_OPERATION: msg = "FLOAT_INVALID_OPERATION"; break; - case STATUS_NONCONTINUABLE_EXCEPTION: msg = "NONCONTINUABLE_EXCEPTION"; break; - case STATUS_STACK_OVERFLOW: msg = "STACK_OVERFLOW"; break; - case STATUS_CONTROL_C_EXIT: msg = "CONTROL_C_EXIT"; break; - case STATUS_ARRAY_BOUNDS_EXCEEDED: msg = "ARRAY_BOUNDS_EXCEEDED"; break; - case STATUS_FLOAT_DENORMAL_OPERAND: msg = "FLOAT_DENORMAL_OPERAND"; break; - case STATUS_FLOAT_INEXACT_RESULT: msg = "FLOAT_INEXACT_RESULT"; break; - case STATUS_FLOAT_OVERFLOW: msg = "FLOAT_OVERFLOW"; break; - case STATUS_FLOAT_STACK_CHECK: msg = "FLOAT_STACK_CHECK"; break; - case STATUS_FLOAT_UNDERFLOW: msg = "FLOAT_UNDERFLOW"; break; - case STATUS_INTEGER_OVERFLOW: msg = "INTEGER_OVERFLOW"; break; - case STATUS_IN_PAGE_ERROR: msg = "IN_PAGE_ERROR"; break; - case STATUS_INVALID_DISPOSITION: msg = "INVALID_DISPOSITION"; break; - - default: - return EXCEPTION_CONTINUE_SEARCH; - } - - - - VM_Global_State::loader_env->shutting_down++; - - if (!vm_get_boolean_property_value_with_default("vm.assert_dialog")) { - print_state(nt_exception, msg); - - print_callstack(nt_exception); - LOGGER_EXIT(-1); - +#ifndef NDEBUG + if (vm_get_boolean_property_value_with_default("vm.assert_dialog")) { + if (UnhandledExceptionFilter(nt_exception) == EXCEPTION_CONTINUE_SEARCH) { + DebugBreak(); + } } +#endif return EXCEPTION_CONTINUE_SEARCH; } @@ -461,6 +411,7 @@ uint32 exception_esp = regs.esp; DebugUtilsTI* ti = VM_Global_State::loader_env->TI; + // TODO: We already checked that above. Is it possible to reuse the result? bool java_code = (vm_identify_eip((void *)regs.eip) == VM_TYPE_JAVA); exn_athrow_regs(®s, exc_clss, java_code); Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ipf/nt_exception_filter.cpp URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ipf/nt_exception_filter.cpp?view=diff&rev=476183&r1=476182&r2=476183 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ipf/nt_exception_filter.cpp (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ipf/nt_exception_filter.cpp Fri Nov 17 07:46:44 2006 @@ -23,7 +23,6 @@ #include "Class.h" #include "Environment.h" #include "exceptions.h" -#include "vm_synch.h" #include "method_lookup.h" #include "vm_strings.h" #include "vm_threads.h" Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp?view=diff&rev=476183&r1=476182&r2=476183 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp Fri Nov 17 07:46:44 2006 @@ -384,7 +384,7 @@ ComponentInfoHandle component_info = component_manager_impl->components; while (NULL != component_info) { ComponentInfoHandle component_info_next = component_info->next; - ret_new = FreeComponentInfo(component_info_next); + ret_new = FreeComponentInfo(component_info); if (APR_SUCCESS == ret) { ret = ret_new; }