Return-Path: Delivered-To: apmail-xml-xerces-c-dev-archive@www.apache.org Received: (qmail 66695 invoked from network); 8 Mar 2005 07:21:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Mar 2005 07:21:56 -0000 Received: (qmail 19938 invoked by uid 500); 8 Mar 2005 07:21:54 -0000 Delivered-To: apmail-xml-xerces-c-dev-archive@xml.apache.org Received: (qmail 19914 invoked by uid 500); 8 Mar 2005 07:21:54 -0000 Mailing-List: contact xerces-c-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: xerces-c-dev@xml.apache.org list-help: list-unsubscribe: List-Post: Delivered-To: mailing list xerces-c-dev@xml.apache.org Received: (qmail 19886 invoked by uid 99); 8 Mar 2005 07:21:54 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 07 Mar 2005 23:21:53 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (8.12.11/8.12.11) with ESMTP id j2878u55017563 for ; Tue, 8 Mar 2005 08:08:56 +0100 Message-ID: <469088581.1110265736893.JavaMail.jira@ajax.apache.org> Date: Tue, 8 Mar 2005 08:08:56 +0100 (CET) From: "Michael Fuller (JIRA)" To: xerces-c-dev@xml.apache.org Subject: [jira] Commented: (XERCESC-1368) Catch-all handler are problematic on Windows In-Reply-To: <922151207.1110144175194.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/XERCESC-1368?page=comments#action_60410 ] Michael Fuller commented on XERCESC-1368: ----------------------------------------- Ok: I think I did misinterpret your direction, as I strongly agree with the tenets espoused in your follow-up. One quibble: > 3. Never use a catch-all handler that doesn't re-throw the exception > that was caught. This actually happens in many places. "Never" is too strong; it is sometimes (in rare circumstances) right to do this. However, if it's happening in many places that seems wrong. Thanks for clarifying. Michael > Catch-all handler are problematic on Windows > -------------------------------------------- > > Key: XERCESC-1368 > URL: http://issues.apache.org/jira/browse/XERCESC-1368 > Project: Xerces-C++ > Type: Bug > Components: Miscellaneous > Versions: 2.6.0 > Environment: Windows XP with Visual Studio .NET 2003 > Reporter: David Bertoni > > Exception handlers of the form "catch(...)" are causing problems in our product code on Windows, because they are catching hardware exceptions, such as access violations. > There is an article in the MSDN Knowledge Base that describes how this has changed between Visual Studio 6, and Visual Studio .NET: > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_core_exception_handling.3a_.default_synchronous_exception_model.asp > However, my experience with Xerces-C using Visual Studio .NET 2003 is that hardware exceptions (asynchronous exceptions, in the Microsoft parlance) are still being caught in Xerces-C in catch-all handlers. This is problematic because it interferes with normal diagnosis of hardware faults, and can lead to code being executed in Xerces-C when the system is in an unknown state. It is also a makes it difficult to write code that will behave the same on other platforms. > Looking into the code reveals multiple places where a catch-all handler resets some object (or some other similar behavior), then rethrows the same exception. I'd like to propose that we try to eliminate as many of these catch handlers as possible by replaces these actions with stack objects that perform these actions automatically whether or not an exception is thrown (auto_ptr-like behavior). This will also have the benefit of simplifying the code. From a "philosophical" perspective, I also think its better for code to catch the exceptions it's concerned with, and avoid catch-all handlers except when absolutely necessary. > I will attach a proposed patch for a class that does this sort of thing, and some modified code that uses this class. I would also like to see if anyone else has observed this behavior in their Windows applications. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org For additional commands, e-mail: xerces-c-dev-help@xml.apache.org