From c-usersrachel17@example.net Mon Jun 02 07:44:44 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 26529 invoked from network); 2 Jun 2008 07:44:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jun 2008 07:44:43 -0000 Received: (qmail 74035 invoked by uid 500); 2 Jun 2008 07:44:45 -0000 Delivered-To: rachel17@example.net Received: (qmail 73990 invoked by uid 500); 2 Jun 2008 07:44:45 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 73969 invoked by uid 99); 2 Jun 2008 07:44:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 00:44:45 -0700 X-ASF-Spam-Status: No, hits=-8.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-gw11.credit-suisse.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 07:43:50 +0000 Received: by mail-gw11.credit-suisse.com; Mon, 2 Jun 2008 09:43:38 +0200 (MEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: Crash in DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement() when name an empty string Date: Mon, 2 Jun 2008 09:42:48 +0200 Message-ID: <rachel17@example.net> In-Reply-To: <rachel17@example.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Crash in DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement() when name an empty string thread-index: AcjBsIaowKObNW38S0idMAl8tXhzTAC0kdlg References: <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> From: "Piras Sandro (KSDB 121)" <rachel17@example.net> To: <rachel17@example.net> X-OriginalArrivalTime: 02 Jun 2008 07:42:49.0094 (UTC) FILETIME=[4155FA60:01C8C484] X-Virus-Checked: Checked by ClamAV on apache.org Hi Dave, yes, it compiles.. at least the Sun compiler version 5.3 I'm actually using. I copied the code from our project in a single sourcefile and without all the object oriented stuff only to see how it works. Like in the project, calling DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement("") generates a core file, the same when calling DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement(name) when name contains an empty string, it doesn't throw an exception.. I tried filling name with a space -> name =3D " ", then createElement() throws = an exception. See the function createNameValue(), the function createNameValue() will be callend in main() in a try block.=20 Regards Sandro Code: #include <iostream> #include <xercesc/dom/deprecated/DOM.hpp> using namespace XERCES_CPP_NAMESPACE; using st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cout; using st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4endl; DOM_Document myDocument; DOM_Node makeChild(const char* childName, DOM_Node parentNode, bool bAllowDuplicate) //********************************************************************** ************ { // Create child node if it does not exist, returns existing one otherwise DOM_Node child =3D parentNode; if (!parentNode.isNull() && (strlen(childName) > 0)) { child =3D parentNode.getFirstChild(); while (!child.isNull() && !child.getNodeName().equals(DOMString(childName)) && !bAllowDuplicate) { child =3D child.getNextSibling(); } // end while if (child.isNull() || bAllowDuplicate) { child =3D myDocument.createElement(childName); parentNode.appendChild(child); } // end if (child.isNull() -> TRUE || (bAllowDuplicate -> TRUE) } // end if return child; } // end makeChild() DOM_Node makePath(const char* path, DOM_Node parentNode) //****************************************************** { char* copyOfPath =3D new char[strlen(path) + 1]; copyOfPath[strlen(path)] =3D '\0'; strncpy(copyOfPath, path, strlen(path)); char* pStart =3D (char*)copyOfPath; char* pEnd =3D pStart; bool bContinue =3D pEnd && *pEnd; while (bContinue) { if ((*pEnd =3D=3D '/') || (*pEnd =3D=3D '\0')) // Found the = limiter { if ((*pEnd =3D=3D '\0')) bContinue =3D false; *pEnd =3D '\0'; // Create child node if it does not exist, returns existing one otherwise parentNode =3D makeChild(pStart, parentNode, false); pStart =3D pEnd + 1; } // end if (*pEnd -> '/') OR (*pEnd -> '\0') pEnd++; } // end while (bContinue -> TRUE) return parentNode; } // end makePath() DOM_Node makePath(const char* path) //********************************* { DOM_Node nodeRet; if (myDocument.isNull()) myDocument =3D = DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateDocument(); nodeRet =3D myDocument; nodeRet =3D makePath(path, nodeRet); return nodeRet; } // end makePath() void createNameValue(const char* name, const char* value, DOM_Node parent) //********************************************************************** ** { if (!parent.isNull() && (name !=3D NULL) && (value !=3D NULL)) { cout << "CreateNameValue() : " << "name =3D \"" << name << "\", value =3D \"" << value << "\"" << endl; // Crashes when name is an empty string instead to throw an exception //DOM_Element element =3D myDocument.createElement(name); // XXX check whats wrong DOM_Element element; if (strcmp(name, "") =3D=3D 0) { cout << "createNameValue() : call createElement with empty string" << endl; element =3D myDocument.createElement(""); //cout << "createNameValue() : call createElement with one space" << endl; //element =3D myDocument.createElement(" "); cout << "createNameValue() : createElement() was successfull" << endl; } else { cout << "createNameValue() : call createElement with name =3D = \"" << name << "\"" << endl; element =3D myDocument.createElement(name); } // XXX DOM_Text text =3D myDocument.createTextNode(value); element.appendChild(text); parent.appendChild(element); } // end if (parent.isNull() -> FALSE) AND (name <> NULL) AND (value <> NULL) } // end createNameValue() int main() { cout << "start" << endl; XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Initialize(); DOM_Node nodeProd =3D makePath("CMF/Trade/Product"); const char* name =3D ""; const char* value =3D ""; cout << "name =3D \"" << name << "\"" << endl; cout << "value =3D \"" << value << "\"" << endl; try { createNameValue(name, value, makePath("Identifiers", nodeProd)); } catch(...) { cout << "Exception caught in createNameValue()" << endl; } } // end main() -----Original Message----- From: David Bertoni [mailto:rachel17@example.net]=20 Sent: Donnerstag, 29. Mai 2008 19:22 To: rachel17@example.net Subject: Re: Crash in DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement() when name an empty string Piras Sandro (KSDB 121) wrote: > Hi all > thx for your help. >=20 > I tested also when filling directly an empty string with > DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement("") -> crashes How does this even compile? "" is not a pointer to a UTF-16 string.=20 Can you please provide a small, isolated program that reproduces the crash? Dave From c-usersrachel17@example.net Mon Jun 02 14:37:02 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 79181 invoked from network); 2 Jun 2008 14:37:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jun 2008 14:37:02 -0000 Received: (qmail 58855 invoked by uid 500); 2 Jun 2008 14:37:04 -0000 Delivered-To: rachel17@example.net Received: (qmail 58843 invoked by uid 500); 2 Jun 2008 14:37:04 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 58832 invoked by uid 99); 2 Jun 2008 14:37:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 07:37:04 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO eureka.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 14:36:15 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: MemBufInputSource: Unknown Exception Date: Mon, 2 Jun 2008 16:36:29 +0200 Message-ID: <rachel17@example.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: MemBufInputSource: Unknown Exception thread-index: AcjEvgsh8izkBMQhSeCpiTMzIWoD8Q== From: =?US-ASCII?Q?Matthias_Hopfer?= <rachel17@example.net> To: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Hi all, Currently i'm trying to parse a well formed xml from memory via MemBufInputSource. // init above works fine // code start int CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseData ( const unsigned a_size, const unsigned char* a_data ) { XMLByte* xmlData =3D (XMLByte*)a_data; MemBufInputSource source ( xmlData, a_size, CUnicodeConv ( _T("dummyID") ).getXMLCh() ); try=20 { // parsing from memory m_pDOMparser->parse ( source ); } catch ( const XMLException& toCatch )=20 { char* message =3D XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode ( toCatch.getMessage() ); TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched XMLException: %s\n"), message ); XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release(&message); } catch ( const DOMException& toCatch )=20 { char* message =3D XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode ( toCatch.msg ); TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched DOMException: %s\n"), message ); XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release(&message); } catch ( const NetAccessorException& toCatch )=20 { char* message =3D XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode ( toCatch.getMessage() ); TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched NetAccessorException: %s\n"), message ); XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release(&message); } catch (...)=20 { TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched UKNOWN Exception\n") ); } //... } // code end Every time i catch an 'Unknown Exception' and i don't know why. If i'm parsing the file directly from HDD, it works without any errors. The file itself is a wellformed xml but pretty 'huge' (39610 bytes). Assuming that there are no mistakes reading the file into memory (did it quite often...=3D), i have absolutely no clue what i'm doing wrong. Anybody hints? Matthias From c-usersrachel17@example.net Mon Jun 02 15:34:00 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 53637 invoked from network); 2 Jun 2008 15:34:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jun 2008 15:34:00 -0000 Received: (qmail 74532 invoked by uid 500); 2 Jun 2008 15:34:03 -0000 Delivered-To: rachel17@example.net Received: (qmail 74515 invoked by uid 500); 2 Jun 2008 15:34:02 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 74504 invoked by uid 99); 2 Jun 2008 15:34:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 08:34:02 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail14b.g14.rapidsite.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 02 Jun 2008 15:33:06 +0000 Received: from ca1-mx38.mlpsca01.us.mxservers.net (83.161.120.155) by mail14b.g14.rapidsite.net (RS ver 1.0.95vs) with SMTP id 0-036592805 for <rachel17@example.net>; Mon, 2 Jun 2008 11:33:26 -0400 (EDT) Received: from unknown [83.161.120.155] (EHLO mmm1407.sanjose14-verio.com) by ca1-mx38.mlpsca01.us.mxservers.net (mxl_mta-3.1.0-03) with ESMTP id 6c214484.(865)237-8273.1201053.00-009.ca1-mx38.mlpsca01.us.mxservers.net (envelope-from <rachel17@example.net>); Mon, 02 Jun 2008 11:33:26 -0400 (EDT) Received: (qmail 49483 invoked from network); 2 Jun 2008 15:33:25 -0000 Received: from unknown (HELO ?83.161.120.155?) (rachel17@example.net) by with ESMTPA; 2 Jun 2008 15:33:25 -0000 Message-ID: <rachel17@example.net> Date: Mon, 02 Jun 2008 11:33:25 -0400 From: Robert William Vesterman <rachel17@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20080421) MIME-Version: 1.0 To: rachel17@example.net Subject: A streamed InputSource? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: [F=0.0100000000; S=0.010(2008012801); MH=0.500(2008031032)] X-MAIL-FROM: <rachel17@example.net> X-SOURCE-IP: [83.161.120.155] X-SF-Loop: 1 X-Virus-Checked: Checked by ClamAV on apache.org I've been using SAX2XMLReader for quite some time to read an XML file. I just pass the name of the file to the parse() function. Now, I have a new requirement: I have to optionally be able to read a file which is encrypted, the underlying contents of which are XML. My first thought was perhaps there is a way to pass memory, instead of a filename, to parse(), and I could just decrypt the contents and pass them to parse() as I do so. In fact, there is a version of parse() that takes an "InputSource", and there's a class derived from InputSource called "MemBufInputSource". So this looked promising. But then I realized that the files I'm decoding are potentially huge. MemBufInputSource seems to require that the buffer be completely populated before passing it off to parse(). It would be much, much nicer if, instead, there were some InputSource (or something) that would have some callback function that would automatically ask for more data whenever parse() has run out of stuff to parse. That way, I could read and decrypt the file in reasonably-sized chunks (the crypto algorithm in use supports streaming decryption). So, first of all, is there such a thing? In case it matters, I am using Xerces 2.6; I could upgrade if absolutely necessary, but I would prefer not to at this point. If not, I'm guessing I can build my own InputSource-derived class. But the documentation is not entirely clear. Obviously I have to implement the pure virtual function, makeStream(). This is supposed to return a BinInputStream. This has two pure virtual functions, curPos() and readBytes(). Neither of these has informative documentation, at least not that I have found. I assume that, in curPos(), I am supposed to return the total number of bytes that have been read (using readBytes()) so far. Correct? Then, readBytes(): I assume I am supposed to return the number of bytes read during this call. Correct? What if an error occurs (such as me being unable to read from the underlying file)? I throw... something? Or what? When there are no more bytes to read (and not because of an error condition), I assume I am supposed to return zero. Correct? Or do I throw something? Or what? Any help, regarding these questions specifically, or a better way to accomplish what I want, or some hints in general, would be appreciated. Thanks. From c-usersrachel17@example.net Mon Jun 02 17:16:30 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 10993 invoked from network); 2 Jun 2008 17:16:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jun 2008 17:16:30 -0000 Received: (qmail 99536 invoked by uid 500); 2 Jun 2008 17:16:33 -0000 Delivered-To: rachel17@example.net Received: (qmail 99276 invoked by uid 500); 2 Jun 2008 17:16:32 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 99265 invoked by uid 99); 2 Jun 2008 17:16:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 10:16:32 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 02 Jun 2008 17:15:44 +0000 Received: (qmail 10900 invoked from network); 2 Jun 2008 17:16:05 -0000 Received: from localhost (HELO ?IPv888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4:1?) (83.161.120.155) by localhost with SMTP; 2 Jun 2008 17:16:05 -0000 Message-ID: <rachel17@example.net> Date: Mon, 02 Jun 2008 10:16:05 -0700 From: David Bertoni <rachel17@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20080421) MIME-Version: 1.0 To: rachel17@example.net Subject: Re: A streamed InputSource? References: <rachel17@example.net> In-Reply-To: <rachel17@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Robert William Vesterman wrote: > I've been using SAX2XMLReader for quite some time to read an XML file. > I just pass the name of the file to the parse() function. Now, I have a > new requirement: I have to optionally be able to read a file which is > encrypted, the underlying contents of which are XML. > > My first thought was perhaps there is a way to pass memory, instead of a > filename, to parse(), and I could just decrypt the contents and pass > them to parse() as I do so. In fact, there is a version of parse() that > takes an "InputSource", and there's a class derived from InputSource > called "MemBufInputSource". So this looked promising. > > But then I realized that the files I'm decoding are potentially huge. > MemBufInputSource seems to require that the buffer be completely > populated before passing it off to parse(). It would be much, much > nicer if, instead, there were some InputSource (or something) that would > have some callback function that would automatically ask for more data > whenever parse() has run out of stuff to parse. That way, I could read > and decrypt the file in reasonably-sized chunks (the crypto algorithm in > use supports streaming decryption). > > So, first of all, is there such a thing? In case it matters, I am using > Xerces 2.6; I could upgrade if absolutely necessary, but I would prefer > not to at this point. > > If not, I'm guessing I can build my own InputSource-derived class. But > the documentation is not entirely clear. > > Obviously I have to implement the pure virtual function, makeStream(). > This is supposed to return a BinInputStream. This has two pure virtual > functions, curPos() and readBytes(). Neither of these has informative > documentation, at least not that I have found. That needs to be fixed. Please file a Jira issue so we can update the headers files. > > I assume that, in curPos(), I am supposed to return the total number of > bytes that have been read (using readBytes()) so far. Correct? yes > > Then, readBytes(): I assume I am supposed to return the number of bytes > read during this call. Correct? yes > > What if an error occurs (such as me being unable to read from the > underlying file)? I throw... something? Or what? You can throw any exception you want. > > When there are no more bytes to read (and not because of an error > condition), I assume I am supposed to return zero. Correct? Or do I > throw something? Or what? You return 0 bytes read. The underlying code will call readBytes() one more time to make sure you really meant no more bytes are left. > > Any help, regarding these questions specifically, or a better way to > accomplish what I want, or some hints in general, would be appreciated. > Thanks. You can look at any of the existing implementations: BinFileInputStream BinMemInputStream BinURLInputStream URLAccessBinInputStream URLAccessCFBinInputStream UnixHTTPURLInputStream BinHTTPURLInputStream Dave From c-usersrachel17@example.net Mon Jun 02 17:38:55 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 21906 invoked from network); 2 Jun 2008 17:38:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jun 2008 17:38:55 -0000 Received: (qmail 24253 invoked by uid 500); 2 Jun 2008 17:38:57 -0000 Delivered-To: rachel17@example.net Received: (qmail 24237 invoked by uid 500); 2 Jun 2008 17:38:57 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 24226 invoked by uid 99); 2 Jun 2008 17:38:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 10:38:57 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 02 Jun 2008 17:38:10 +0000 Received: (qmail 21786 invoked from network); 2 Jun 2008 17:38:31 -0000 Received: from localhost (HELO ?IPv888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4:1?) (83.161.120.155) by localhost with SMTP; 2 Jun 2008 17:38:31 -0000 Message-ID: <rachel17@example.net> Date: Mon, 02 Jun 2008 10:38:30 -0700 From: David Bertoni <rachel17@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20080421) MIME-Version: 1.0 To: rachel17@example.net Subject: Re: Crash in DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement() when name an empty string References: <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> In-Reply-To: <rachel17@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Piras Sandro (KSDB 121) wrote: > Hi Dave, > yes, it compiles.. at least the Sun compiler version 5.3 I'm actually > using. Uggh. I just noticed that you're using the deprecated DOM, which gone in 3.0. I think you'd be better off by spending your time porting to the new DOM. > > I copied the code from our project in a single sourcefile and without > all the object oriented stuff only to see how it works. Like in the > project, calling DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement("") generates a core file, > the same when calling DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement(name) when name > contains an empty string, it doesn't throw an exception.. I tried > filling name with a space -> name = " ", then createElement() throws an > exception. It's definitely a regression, due to some performance enhancement work that assumed isValidName() would never be passed a string of length 0. Can you please file a Jira issue and assign it to me? Dave From c-usersrachel17@example.net Mon Jun 02 17:45:24 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 24782 invoked from network); 2 Jun 2008 17:45:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Jun 2008 17:45:24 -0000 Received: (qmail 31350 invoked by uid 500); 2 Jun 2008 17:45:26 -0000 Delivered-To: rachel17@example.net Received: (qmail 31330 invoked by uid 500); 2 Jun 2008 17:45:26 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 31319 invoked by uid 99); 2 Jun 2008 17:45:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 10:45:26 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 02 Jun 2008 17:44:45 +0000 Received: (qmail 24620 invoked from network); 2 Jun 2008 17:45:02 -0000 Received: from localhost (HELO ?IPv888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4:1?) (83.161.120.155) by localhost with SMTP; 2 Jun 2008 17:45:02 -0000 Message-ID: <rachel17@example.net> Date: Mon, 02 Jun 2008 10:45:02 -0700 From: David Bertoni <rachel17@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20080421) MIME-Version: 1.0 To: rachel17@example.net Subject: Re: MemBufInputSource: Unknown Exception References: <rachel17@example.net> In-Reply-To: <rachel17@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Matthias Hopfer wrote: > Hi all, > > Currently i'm trying to parse a well formed xml from memory via > MemBufInputSource. > > // init above works fine > // code start ... > catch (...) > { > TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched UKNOWN > Exception\n") ); > } > //... > } > // code end > > Every time i catch an 'Unknown Exception' and i don't know why. If i'm > parsing the file directly from HDD, it works without any errors. The > file itself is a wellformed xml but pretty 'huge' (39610 bytes). > Assuming that there are no mistakes reading the file into memory (did it > quite often...=), i have absolutely no clue what i'm doing wrong. > > Anybody hints? If I had to guess, I would say it's an access violation. However, instead of having us guess, you might want to run this in the debugger. It looks like you're using Visual Studio, so the debugger will display the type of exception in the output window. You can also configure the debugger to break when an exception is thrown, which will help you determine where the exception is thrown. Dave From c-usersrachel17@example.net Tue Jun 03 07:00:18 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 32380 invoked from network); 3 Jun 2008 07:00:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jun 2008 07:00:18 -0000 Received: (qmail 11875 invoked by uid 500); 3 Jun 2008 07:00:21 -0000 Delivered-To: rachel17@example.net Received: (qmail 11618 invoked by uid 500); 3 Jun 2008 07:00:20 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 11607 invoked by uid 99); 3 Jun 2008 07:00:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 00:00:20 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO eureka.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 06:59:24 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: MemBufInputSource: Unknown Exception Date: Tue, 3 Jun 2008 08:59:45 +0200 Message-ID: <rachel17@example.net> In-Reply-To: <rachel17@example.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: MemBufInputSource: Unknown Exception thread-index: AcjE2DbyPv5+ehRxQzmnJQiQR3rMSQAaOukg From: =?iso-8859-1?Q?Matthias_H=F6pfer?= <rachel17@example.net> To: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Dave: You're right, i'm using Visual Studio (6.0 beeing exactly). I catch an = '...(KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.'. Stepping = through the calling stack didn't help me (me, but maybe someone = else...) any further. KERNEL32! 7c812a5b() MSVCRTD! _CxxThrowException@8 + 57 bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4heckTrailingBytes(const unsigned char = 205, const unsigned int 1, const unsigned int 1) line 110 xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcodeFrom(const unsigned char * = const 0x01afcc67, const unsigned int 6807, unsigned short * const = 0x01ad8c24, const unsigned int 16384, unsigned int & 36826000, unsigned = char * const 0x01ae0c28) line 246 xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xcodeMoreChars(unsigned short * const = 0x01ad8c24, unsigned char * const 0x01ae0c28, const unsigned int 16384) = line 1751 + 78 bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4refreshCharBuffer() line 547 + 42 bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar(unsigned short & 59792) line 714 + 8 = bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ReaderMgr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar() line 95 + 15 bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanAttValue(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLAttDef * = const 0x00000000, const unsigned short * const 0x01b0cb88, = xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLBuffer & {...}) line 2319 + 14 bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanStartTag(unsigned char & 1) line 1860 + = 32 bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanContent() line 899 xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanDocument(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource & = {...}) line 214 + 8 bytes xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4AbstractDOMParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parse(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource & = {...}) line 519 CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(const unsigned int 39610, const unsigned = char * 0x01ec2b10) line 66 + 17 bytes I still don't know what's wrong. (Therefore i included the calling = stack. Maybe someone's got a clue...) At the moment i'm thinking about inserting an switch deciding between = memory or file input. But i'd definitely prefer the memory input source. Matthias -----Original Message----- From: David Bertoni [mailto:rachel17@example.net]=20 Sent: Monday, June 02, 2008 7:45 PM To: rachel17@example.net Subject: Re: MemBufInputSource: Unknown Exception Matthias Hopfer wrote: > Hi all, >=20 > Currently i'm trying to parse a well formed xml from memory via=20 > MemBufInputSource. >=20 > // init above works fine > // code start ... > catch (...)=20 > { > TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched UKNOWN > Exception\n") ); > } > //... > } > // code end >=20 > Every time i catch an 'Unknown Exception' and i don't know why. If i'm = > parsing the file directly from HDD, it works without any errors. The=20 > file itself is a wellformed xml but pretty 'huge' (39610 bytes). > Assuming that there are no mistakes reading the file into memory (did=20 > it quite often...=3D), i have absolutely no clue what i'm doing wrong. >=20 > Anybody hints? If I had to guess, I would say it's an access violation. However, = instead of having us guess, you might want to run this in the debugger.=20 It looks like you're using Visual Studio, so the debugger will display = the type of exception in the output window. You can also configure the = debugger to break when an exception is thrown, which will help you = determine where the exception is thrown. Dave From c-usersrachel17@example.net Tue Jun 03 08:06:41 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 54186 invoked from network); 3 Jun 2008 08:06:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jun 2008 08:06:41 -0000 Received: (qmail 85461 invoked by uid 500); 3 Jun 2008 08:06:43 -0000 Delivered-To: rachel17@example.net Received: (qmail 85440 invoked by uid 500); 3 Jun 2008 08:06:43 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 85429 invoked by uid 99); 3 Jun 2008 08:06:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 01:06:43 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mx1.progress.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 08:05:46 +0000 Received: from mx1.progress.com (83.161.120.155) by mx1.progress.com (MlfMTA v3.2r9) id h8jtoa0171su for <rachel17@example.net>; Tue, 3 Jun 2008 04:06:08 -0400 (envelope-from <rachel17@example.net>) Received: from progress.com ([83.161.120.155]) by mx1.progress.com (SonicWALL 83.161.120.15557) with ESMTP; Tue, 03 Jun 2008 04:06:08 -0400 Received: from NTEXFE02.bedford.progress.com (ntexfe02 [83.161.120.155]) by progress.com (8.13.8/8.13.8) with ESMTP id m538682j021490 for <rachel17@example.net>; Tue, 3 Jun 2008 04:06:08 -0400 (EDT) Received: from [83.161.120.155] ([83.161.120.155]) by NTEXFE02.bedford.progress.com over TLS secured channel with Microsoft SMTPSVC(865)237-8273); Tue, 3 Jun 2008 04:06:07 -0400 Message-ID: <rachel17@example.net> Date: Tue, 03 Jun 2008 10:06:05 +0200 From: Alberto Massari <rachel17@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20080421) MIME-Version: 1.0 To: rachel17@example.net Subject: Re: MemBufInputSource: Unknown Exception References: <rachel17@example.net> In-Reply-To: <rachel17@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 03 Jun 2008 08:06:08.0080 (UTC) FILETIME=[AD9C0D00:01C8C550] X-Mlf-Version: 83.161.120.15557 X-Mlf-UniqueId: o200806030806080054085 X-Virus-Checked: Checked by ClamAV on apache.org The exception should be an UTFDataFormatException, that complains about an invalid UTF-8 structure; if the XML can be parsed when is on the disk, maybe the code that loads it has a bug (maybe you are opening it as a text stream, and single \n gets turned into \n\r) Alberto Matthias Höpfer wrote: > Dave: > You're right, i'm using Visual Studio (6.0 beeing exactly). I catch an '...(KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.'. Stepping through the calling stack didn't help me (me, but maybe someone else...) any further. > > KERNEL32! 7c812a5b() > MSVCRTD! _CxxThrowException@8 + 57 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4heckTrailingBytes(const unsigned char 205, const unsigned int 1, const unsigned int 1) line 110 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcodeFrom(const unsigned char * const 0x01afcc67, const unsigned int 6807, unsigned short * const 0x01ad8c24, const unsigned int 16384, unsigned int & 36826000, unsigned char * const 0x01ae0c28) line 246 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xcodeMoreChars(unsigned short * const 0x01ad8c24, unsigned char * const 0x01ae0c28, const unsigned int 16384) line 1751 + 78 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4refreshCharBuffer() line 547 + 42 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar(unsigned short & 59792) line 714 + 8 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ReaderMgr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar() line 95 + 15 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanAttValue(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLAttDef * const 0x00000000, const unsigned short * const 0x01b0cb88, xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLBuffer & {...}) line 2319 + 14 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanStartTag(unsigned char & 1) line 1860 + 32 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanContent() line 899 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanDocument(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource & {...}) line 214 + 8 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4AbstractDOMParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parse(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource & {...}) line 519 > CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(const unsigned int 39610, const unsigned char * 0x01ec2b10) line 66 + 17 bytes > > I still don't know what's wrong. (Therefore i included the calling stack. Maybe someone's got a clue...) > > At the moment i'm thinking about inserting an switch deciding between memory or file input. But i'd definitely prefer the memory input source. > > Matthias > > -----Original Message----- > From: David Bertoni [mailto:rachel17@example.net] > Sent: Monday, June 02, 2008 7:45 PM > To: rachel17@example.net > Subject: Re: MemBufInputSource: Unknown Exception > > Matthias Hopfer wrote: > >> Hi all, >> >> Currently i'm trying to parse a well formed xml from memory via >> MemBufInputSource. >> >> // init above works fine >> // code start >> > ... > > >> catch (...) >> { >> TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched UKNOWN >> Exception\n") ); >> } >> //... >> } >> // code end >> >> Every time i catch an 'Unknown Exception' and i don't know why. If i'm >> parsing the file directly from HDD, it works without any errors. The >> file itself is a wellformed xml but pretty 'huge' (39610 bytes). >> Assuming that there are no mistakes reading the file into memory (did >> it quite often...=), i have absolutely no clue what i'm doing wrong. >> >> Anybody hints? >> > If I had to guess, I would say it's an access violation. However, instead of having us guess, you might want to run this in the debugger. > It looks like you're using Visual Studio, so the debugger will display the type of exception in the output window. You can also configure the debugger to break when an exception is thrown, which will help you determine where the exception is thrown. > > Dave > > From c-usersrachel17@example.net Tue Jun 03 08:25:58 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 61042 invoked from network); 3 Jun 2008 08:25:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jun 2008 08:25:57 -0000 Received: (qmail 14016 invoked by uid 500); 3 Jun 2008 08:25:54 -0000 Delivered-To: rachel17@example.net Received: (qmail 13999 invoked by uid 500); 3 Jun 2008 08:25:53 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 13971 invoked by uid 99); 3 Jun 2008 08:25:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 01:25:53 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO eureka.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 08:25:04 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: [solved/workaround]RE: MemBufInputSource: Unknown Exception Date: Tue, 3 Jun 2008 10:25:18 +0200 Message-ID: <rachel17@example.net> In-Reply-To: <rachel17@example.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [solved/workaround]RE: MemBufInputSource: Unknown Exception thread-index: AcjFUITH4378C9icQdmkF3bI/nR7KQAAKamA From: =?iso-8859-1?Q?Matthias_H=F6pfer?= <rachel17@example.net> To: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Alberto: Thanks for your hint. Steps were as follows: - receive xml fragments time by time - save to hdd - load xml into buffer - forward buffer to xmlhandler - parse with xerces Below is the code i loaded the xml into buffer: // reading from file, then forward buffer to xml handler st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string strfile ( (char*)a_data ); ifstream file ( strfile.c_str(), ios888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4in ); char* buffer =3D new char [a_size]; file.read ( buffer, a_size ); // fwd buffer to xmlhandler an parse with xerces Anyway, i left the 'load xml to buffer' completely and forwarded just = the filename to xerces. Which seems a cleaner solution to me. Adding = ios888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4inary didn't work either. The problem just occurs on this special = kind of buffer/filelenght. There's no problem if the size is smaler. The new steps are: - receive xml fragments time by time - save to hdd - forward filename to xmlhandler - parse with xerces Thanks for your help, folks. Issue solved due to my needs. Matthias -----Original Message----- From: Alberto Massari [mailto:rachel17@example.net]=20 Sent: Tuesday, June 03, 2008 10:06 AM To: rachel17@example.net Subject: Re: MemBufInputSource: Unknown Exception The exception should be an UTFDataFormatException, that complains about = an invalid UTF-8 structure; if the XML can be parsed when is on the = disk, maybe the code that loads it has a bug (maybe you are opening it = as a text stream, and single \n gets turned into \n\r) Alberto Matthias H=F6pfer wrote: > Dave: > You're right, i'm using Visual Studio (6.0 beeing exactly). I catch an = '...(KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.'. Stepping = through the calling stack didn't help me (me, but maybe someone = else...) any further. > > KERNEL32! 7c812a5b() > MSVCRTD! _CxxThrowException@8 + 57 bytes=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4heckTrailingBytes(const unsigned char = > 205, const unsigned int 1, const unsigned int 1) line 110=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcodeFrom(const unsigned char *=20 > const 0x01afcc67, const unsigned int 6807, unsigned short * const=20 > 0x01ad8c24, const unsigned int 16384, unsigned int & 36826000,=20 > unsigned char * const 0x01ae0c28) line 246=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xcodeMoreChars(unsigned short * const=20 > 0x01ad8c24, unsigned char * const 0x01ae0c28, const unsigned int=20 > 16384) line 1751 + 78 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4refreshCharBuffer() line 547 + 42 bytes=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar(unsigned short & 59792) line 714 + = > 8 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ReaderMgr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar() line 95 + 15 bytes=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanAttValue(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLAttDef * = > const 0x00000000, const unsigned short * const 0x01b0cb88,=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLBuffer & {...}) line 2319 + 14 bytes=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanStartTag(unsigned char & 1) line 1860 + = > 32 bytes > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanContent() line 899=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanDocument(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource = > & {...}) line 214 + 8 bytes=20 > xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4AbstractDOMParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parse(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource & = > {...}) line 519 CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(const unsigned int=20 > 39610, const unsigned char * 0x01ec2b10) line 66 + 17 bytes > > I still don't know what's wrong. (Therefore i included the calling=20 > stack. Maybe someone's got a clue...) > > At the moment i'm thinking about inserting an switch deciding between = memory or file input. But i'd definitely prefer the memory input source. > > Matthias > > -----Original Message----- > From: David Bertoni [mailto:rachel17@example.net] > Sent: Monday, June 02, 2008 7:45 PM > To: rachel17@example.net > Subject: Re: MemBufInputSource: Unknown Exception > > Matthias Hopfer wrote: > =20 >> Hi all, >> >> Currently i'm trying to parse a well formed xml from memory via=20 >> MemBufInputSource. >> >> // init above works fine >> // code start >> =20 > ... > > =20 >> catch (...)=20 >> { >> TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched UKNOWN >> Exception\n") ); >> } >> //... >> } >> // code end >> >> Every time i catch an 'Unknown Exception' and i don't know why. If=20 >> i'm parsing the file directly from HDD, it works without any errors.=20 >> The file itself is a wellformed xml but pretty 'huge' (39610 bytes). >> Assuming that there are no mistakes reading the file into memory (did = >> it quite often...=3D), i have absolutely no clue what i'm doing = wrong. >> >> Anybody hints? >> =20 > If I had to guess, I would say it's an access violation. However, = instead of having us guess, you might want to run this in the debugger.=20 > It looks like you're using Visual Studio, so the debugger will display = the type of exception in the output window. You can also configure the = debugger to break when an exception is thrown, which will help you = determine where the exception is thrown. > > Dave > > =20 From c-usersrachel17@example.net Tue Jun 03 08:30:06 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 64339 invoked from network); 3 Jun 2008 08:30:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jun 2008 08:30:06 -0000 Received: (qmail 21311 invoked by uid 500); 3 Jun 2008 08:30:09 -0000 Delivered-To: rachel17@example.net Received: (qmail 21065 invoked by uid 500); 3 Jun 2008 08:30:08 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 21054 invoked by uid 99); 3 Jun 2008 08:30:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 01:30:08 -0700 X-ASF-Spam-Status: No, hits=-8.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-gw10.credit-suisse.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 08:29:13 +0000 Received: by mail-gw10.credit-suisse.com; Tue, 3 Jun 2008 10:29:20 +0200 (MEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: Crash in DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement() when name an empty string Date: Tue, 3 Jun 2008 10:29:04 +0200 Message-ID: <rachel17@example.net> In-Reply-To: <rachel17@example.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Crash in DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement() when name an empty string thread-index: AcjE15Dwr+HKyPEkTc2/wB+iReu9ZAAfDsfQ References: <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> <rachel17@example.net> From: "Piras Sandro (KSDB 121)" <rachel17@example.net> To: <rachel17@example.net> X-OriginalArrivalTime: 03 Jun 2008 08:29:05.0425 (UTC) FILETIME=[E2923810:01C8C553] X-Virus-Checked: Checked by ClamAV on apache.org Hi Dave, I created the Jira issue XERCESC-1806, but was not able to assign it to you. Regards Sandro=20 -----Original Message----- From: David Bertoni [mailto:rachel17@example.net]=20 Sent: Montag, 2. Juni 2008 19:39 To: rachel17@example.net Subject: Re: Crash in DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement() when name an empty string Piras Sandro (KSDB 121) wrote: > Hi Dave, > yes, it compiles.. at least the Sun compiler version 5.3 I'm actually=20 > using. Uggh. I just noticed that you're using the deprecated DOM, which gone in 3.0. I think you'd be better off by spending your time porting to the new DOM. >=20 > I copied the code from our project in a single sourcefile and without=20 > all the object oriented stuff only to see how it works. Like in the=20 > project, calling DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement("") generates a core=20 > file, the same when calling DOM_Document888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateElement(name) when=20 > name contains an empty string, it doesn't throw an exception.. I tried > filling name with a space -> name =3D " ", then createElement() throws = > an exception. It's definitely a regression, due to some performance enhancement work that assumed isValidName() would never be passed a string of length 0.=20 Can you please file a Jira issue and assign it to me? Dave From c-usersrachel17@example.net Tue Jun 03 08:49:38 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 73475 invoked from network); 3 Jun 2008 08:49:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jun 2008 08:49:37 -0000 Received: (qmail 52168 invoked by uid 500); 3 Jun 2008 08:49:40 -0000 Delivered-To: rachel17@example.net Received: (qmail 52093 invoked by uid 500); 3 Jun 2008 08:49:39 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 52082 invoked by uid 99); 3 Jun 2008 08:49:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 01:49:39 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mx1.progress.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 08:48:43 +0000 Received: from mx1.progress.com (83.161.120.155) by mx1.progress.com (MlfMTA v3.2r9) id h8k2pc0171s1 for <rachel17@example.net>; Tue, 3 Jun 2008 04:49:06 -0400 (envelope-from <rachel17@example.net>) Received: from progress.com ([83.161.120.155]) by mx1.progress.com (SonicWALL 83.161.120.15557) with ESMTP; Tue, 03 Jun 2008 04:49:06 -0400 Received: from NTEXFE02.bedford.progress.com (ntexfe02 [83.161.120.155]) by progress.com (8.13.8/8.13.8) with ESMTP id m538n54s027261 for <rachel17@example.net>; Tue, 3 Jun 2008 04:49:05 -0400 (EDT) Received: from [83.161.120.155] ([83.161.120.155]) by NTEXFE02.bedford.progress.com over TLS secured channel with Microsoft SMTPSVC(865)237-8273); Tue, 3 Jun 2008 04:49:05 -0400 Message-ID: <rachel17@example.net> Date: Tue, 03 Jun 2008 10:49:02 +0200 From: Alberto Massari <rachel17@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20080421) MIME-Version: 1.0 To: rachel17@example.net Subject: Re: [solved/workaround]RE: MemBufInputSource: Unknown Exception References: <rachel17@example.net> In-Reply-To: <rachel17@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 03 Jun 2008 08:49:05.0564 (UTC) FILETIME=[ADE8E5C0:01C8C556] X-Mlf-Version: 83.161.120.15557 X-Mlf-UniqueId: o200806030849060059660 X-Virus-Checked: Checked by ClamAV on apache.org Maybe it's just bad naming, but couldn't be that the a_data you are using in the function is the same a_data where you store the file name? Are you invoking parseData(a_size, buffer)? Alberto Matthias Höpfer wrote: > Alberto: > Thanks for your hint. > > Steps were as follows: > - receive xml fragments time by time > - save to hdd > - load xml into buffer > - forward buffer to xmlhandler > - parse with xerces > > Below is the code i loaded the xml into buffer: > > // reading from file, then forward buffer to xml handler > st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string strfile ( (char*)a_data ); > ifstream file ( strfile.c_str(), ios888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4in ); > char* buffer = new char [a_size]; > > file.read ( buffer, a_size ); > > // fwd buffer to xmlhandler an parse with xerces > > Anyway, i left the 'load xml to buffer' completely and forwarded just the filename to xerces. Which seems a cleaner solution to me. Adding ios888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4inary didn't work either. The problem just occurs on this special kind of buffer/filelenght. There's no problem if the size is smaler. > > The new steps are: > - receive xml fragments time by time > - save to hdd > - forward filename to xmlhandler > - parse with xerces > > Thanks for your help, folks. Issue solved due to my needs. > > Matthias > > -----Original Message----- > From: Alberto Massari [mailto:rachel17@example.net] > Sent: Tuesday, June 03, 2008 10:06 AM > To: rachel17@example.net > Subject: Re: MemBufInputSource: Unknown Exception > > The exception should be an UTFDataFormatException, that complains about an invalid UTF-8 structure; if the XML can be parsed when is on the disk, maybe the code that loads it has a bug (maybe you are opening it as a text stream, and single \n gets turned into \n\r) > > Alberto > > > Matthias Höpfer wrote: > >> Dave: >> You're right, i'm using Visual Studio (6.0 beeing exactly). I catch an '...(KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.'. Stepping through the calling stack didn't help me (me, but maybe someone else...) any further. >> >> KERNEL32! 7c812a5b() >> MSVCRTD! _CxxThrowException@8 + 57 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4heckTrailingBytes(const unsigned char >> 205, const unsigned int 1, const unsigned int 1) line 110 >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcodeFrom(const unsigned char * >> const 0x01afcc67, const unsigned int 6807, unsigned short * const >> 0x01ad8c24, const unsigned int 16384, unsigned int & 36826000, >> unsigned char * const 0x01ae0c28) line 246 >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xcodeMoreChars(unsigned short * const >> 0x01ad8c24, unsigned char * const 0x01ae0c28, const unsigned int >> 16384) line 1751 + 78 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4refreshCharBuffer() line 547 + 42 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar(unsigned short & 59792) line 714 + >> 8 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ReaderMgr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar() line 95 + 15 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanAttValue(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLAttDef * >> const 0x00000000, const unsigned short * const 0x01b0cb88, >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLBuffer & {...}) line 2319 + 14 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanStartTag(unsigned char & 1) line 1860 + >> 32 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanContent() line 899 >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IGXMLScanner888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4scanDocument(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource >> & {...}) line 214 + 8 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4AbstractDOMParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parse(const xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4InputSource & >> {...}) line 519 CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(const unsigned int >> 39610, const unsigned char * 0x01ec2b10) line 66 + 17 bytes >> >> I still don't know what's wrong. (Therefore i included the calling >> stack. Maybe someone's got a clue...) >> >> At the moment i'm thinking about inserting an switch deciding between memory or file input. But i'd definitely prefer the memory input source. >> >> Matthias >> >> -----Original Message----- >> From: David Bertoni [mailto:rachel17@example.net] >> Sent: Monday, June 02, 2008 7:45 PM >> To: rachel17@example.net >> Subject: Re: MemBufInputSource: Unknown Exception >> >> Matthias Hopfer wrote: >> >> >>> Hi all, >>> >>> Currently i'm trying to parse a well formed xml from memory via >>> MemBufInputSource. >>> >>> // init above works fine >>> // code start >>> >>> >> ... >> >> >> >>> catch (...) >>> { >>> TRACE ( _T("CXmlHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parseDataRequest(): catched UKNOWN >>> Exception\n") ); >>> } >>> //... >>> } >>> // code end >>> >>> Every time i catch an 'Unknown Exception' and i don't know why. If >>> i'm parsing the file directly from HDD, it works without any errors. >>> The file itself is a wellformed xml but pretty 'huge' (39610 bytes). >>> Assuming that there are no mistakes reading the file into memory (did >>> it quite often...=), i have absolutely no clue what i'm doing wrong. >>> >>> Anybody hints? >>> >>> >> If I had to guess, I would say it's an access violation. However, instead of having us guess, you might want to run this in the debugger. >> It looks like you're using Visual Studio, so the debugger will display the type of exception in the output window. You can also configure the debugger to break when an exception is thrown, which will help you determine where the exception is thrown. >> >> Dave >> >> >> > > > From c-usersrachel17@example.net Tue Jun 03 09:03:38 2008 Return-Path: <c-usersrachel17@example.net> Delivered-To: rachel17@example.net Received: (qmail 80075 invoked from network); 3 Jun 2008 09:03:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Jun 2008 09:03:38 -0000 Received: (qmail 75470 invoked by uid 500); 3 Jun 2008 09:03:40 -0000 Delivered-To: rachel17@example.net Received: (qmail 75457 invoked by uid 500); 3 Jun 2008 09:03:39 -0000 Mailing-List: contact rachel17@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:rachel17@example.net> List-Unsubscribe: <mailto:rachel17@example.net> List-Post: <mailto:rachel17@example.net> List-Id: <c-users.xerces.apache.org> Reply-To: rachel17@example.net Delivered-To: mailing list rachel17@example.net Received: (qmail 75446 invoked by uid 99); 3 Jun 2008 09:03:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 02:03:39 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO eureka.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 09:02:51 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [solved/workaround]RE: MemBufInputSource: Unknown Exception Date: Tue, 3 Jun 2008 11:03:06 +0200 Message-ID: <rachel17@example.net> In-Reply-To: <rachel17@example.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [solved/workaround]RE: MemBufInputSource: Unknown Exception thread-index: AcjFVoa/Z0CkspEhSrCm96CEii1mpQAAPtxQ From: =?iso-8859-1?Q?Matthias_H=F6pfer?= <rachel17@example.net> To: <rachel17@example.net> X-Virus-Checked: Checked by ClamAV on apache.org parseData (...) WAS invoked eithter with: a_data already containing wellformed xml-data (due to size no buffering = to hdd was needed). buffer filled with xml-data read from file were a_data contained the = filename. Xmlhandler just parses from memory. parseData (...) NOW is invoked with: a_data containing either xml-data OR filename (a_size =3D=3D 0: a_data = contains filename->parse from hdd, otherwise allocate MemBufInputSource = object). Xmlhandler decides from which source to parse. Matthias -----Original Message----- From: Alberto Massari [mailto:rachel17@example.net]=20 Sent: Tuesday, June 03, 2008 10:49 AM To: rachel17@example.net Subject: Re: [solved/workaround]RE: MemBufInputSource: Unknown Exception Maybe it's just bad naming, but couldn't be that the a_data you are = using in the function is the same a_data where you store the file name?=20 Are you invoking parseData(a_size, buffer)? Alberto Matthias H=F6pfer wrote: > Alberto: > Thanks for your hint. > > Steps were as follows: > - receive xml fragments time by time > - save to hdd > - load xml into buffer > - forward buffer to xmlhandler > - parse with xerces > > Below is the code i loaded the xml into buffer: > > // reading from file, then forward buffer to xml handler > st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4string strfile ( (char*)a_data ); > ifstream file ( strfile.c_str(), ios888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4in ); > char* buffer =3D new char [a_size]; > > file.read ( buffer, a_size ); > > // fwd buffer to xmlhandler an parse with xerces > > Anyway, i left the 'load xml to buffer' completely and forwarded just = the filename to xerces. Which seems a cleaner solution to me. Adding = ios888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4inary didn't work either. The problem just occurs on this special = kind of buffer/filelenght. There's no problem if the size is smaler. > > The new steps are: > - receive xml fragments time by time > - save to hdd > - forward filename to xmlhandler > - parse with xerces > > Thanks for your help, folks. Issue solved due to my needs. > > Matthias > > -----Original Message----- > From: Alberto Massari [mailto:rachel17@example.net] > Sent: Tuesday, June 03, 2008 10:06 AM > To: rachel17@example.net > Subject: Re: MemBufInputSource: Unknown Exception > > The exception should be an UTFDataFormatException, that complains=20 > about an invalid UTF-8 structure; if the XML can be parsed when is on=20 > the disk, maybe the code that loads it has a bug (maybe you are=20 > opening it as a text stream, and single \n gets turned into \n\r) > > Alberto > > > Matthias H=F6pfer wrote: > =20 >> Dave: >> You're right, i'm using Visual Studio (6.0 beeing exactly). I catch = an '...(KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.'. Stepping = through the calling stack didn't help me (me, but maybe someone = else...) any further. >> >> KERNEL32! 7c812a5b() >> MSVCRTD! _CxxThrowException@8 + 57 bytes=20 >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4heckTrailingBytes(const unsigned=20 >> char 205, const unsigned int 1, const unsigned int 1) line 110=20 >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLUTF8Transcoder888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcodeFrom(const unsigned char *=20 >> const 0x01afcc67, const unsigned int 6807, unsigned short * const=20 >> 0x01ad8c24, const unsigned int 16384, unsigned int & 36826000,=20 >> unsigned char * const 0x01ae0c28) line 246=20 >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xcodeMoreChars(unsigned short * const=20 >> 0x01ad8c24, unsigned char * const 0x01ae0c28, const unsigned int >> 16384) line 1751 + 78 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4refreshCharBuffer() line 547 + 42 bytes=20 >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLReader888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar(unsigned short & 59792) line 714=20 >> + >> 8 bytes >> xercesc_2_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ReaderMgr888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4getNextChar() line 95
{'source': 'Apache Software Foundation Public Mail Archives'}