Return-Path: Delivered-To: apmail-xml-xerces-c-dev-archive@xml.apache.org Received: (qmail 72750 invoked by uid 500); 9 Aug 2002 15:20:47 -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 72738 invoked from network); 9 Aug 2002 15:20:46 -0000 Subject: Re: rethrowing an exception causes assertion failure (Win32) To: "'xerces-c-dev@xml.apache.org'" X-Mailer: Lotus Notes Release 5.0.6a January 17, 2001 Message-ID: From: David N Bertoni/Cambridge/IBM Date: Fri, 9 Aug 2002 08:13:26 -0700 X-MIMETrack: Serialize by Router on A3MAIL/CAM/H/Lotus(Build V60_M14_08012002 Release Candidate|August 01, 2002) at 08/09/2002 11:20:53 AM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N It's likely you're mixing run-time libraries. See the FAQ: http://xml.apache.org/xerces-c/faq-build.html#faq-11 Dave "Barker, Peter" fid-intl.com> cc: (bcc: David N Bertoni/Cambridge/IBM) Subject: rethrowing an exception causes assertion failure (Win32) 08/09/2002 07:22 AM Please respond to xerces-c-dev Hello, I have a problem in my program which I've narrowed down and extracted into a small test program below (VC++ console program). I get the program to cause a parsing exception by creating non XML compliant input. I catch this exception in an ellipsis handler, then call a function which re-throws it to determine it's correct type. After this completes, I get a assertion failure BLOCK_TYPE_IS_VALID(pHead->nBlockUse). I am compiling in DEBUG mode and using the DEBUG version of the Xerces library. The error doesn't happen if I don't re-throw the exception. Regards, Peter Barker // XercesExceptionTest.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "XercesExceptionTest.h" #include #include #include #include #include // Required to catch XMLException #include // Required to catch DOM_DOMException #include // Required to catch SAXException CWinApp theApp; void ShowException() { try { throw; } catch(const SAXException& e) { char* xCodedMess = XMLString::transcode(e. getMessage()); std::cout << "SAXException: " << xCodedMess << std::endl; delete[] xCodedMess; } catch(const XMLException& e) { char* xCodedMess = XMLString::transcode(e. getMessage()); std::cout << "XMLException: " << xCodedMess << std::endl; delete[] xCodedMess; } catch(const DOM_DOMException& e) { char* xCodedMess = e.msg.transcode(); std::cout << "DOM_DOMException: " << xCodedMess << std::endl; delete[] xCodedMess; } } int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; XMLPlatformUtils::Initialize(); { try { MemBufInputSource is(reinterpret_cast(""),14,""); DOMParser parser; DefaultHandler handler; parser.setErrorHandler(&handler); parser.parse(is); } catch(...) { ShowException(); } } XMLPlatformUtils::Terminate(); return nRetCode; } --------------------------------------------------------------------- To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org For additional commands, e-mail: xerces-c-dev-help@xml.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org For additional commands, e-mail: xerces-c-dev-help@xml.apache.org