You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Alberto Massari <am...@datadirect.com> on 2007/08/08 10:02:35 UTC

Re: Validating XML with SOAP envelope against schema without soap definition gives error

Mini,
if you want to validate an XML file that uses soap-env:ENVELOPE, you 
will have to load the schema that defines it.... that is what XMLSpy 
evidently does.

Alberto

At 11.11 08/08/2007 +0530, Minimol M wrote:
>Hi,
>
>I tried to validate an XML document with soap envelope against a schema
>which does not have the soap definition.  I get the error "Unknown element :
>soap-env:ENVELOPE.
>
>I validated the same document against the same schema in Altova XMLSpy where
>it validated successfully.
>
>I am using the following statements to parse the XML.
>
>
>   DOMImplementation *impl =
>DOMImplementationRegistry::getDOMImplementation(gLS);
>   parser =
>((DOMImplementationLS*)impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS,
>0);
>
>   parser->setFeature(XMLUni::fgDOMNamespaces, true);
>   parser->setFeature(XMLUni::fgXercesSchema, true);
>   parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
>   parser->setFeature(XMLUni::fgDOMValidation, true);
>   parser->setFeature(XMLUni::fgDOMValidateIfSchema, true);
>   parser->setFeature(XMLUni::fgXercesCacheGrammarFromParse, true);
>   parser->setFeature(XMLUni::fgDOMDatatypeNormalization, true);
>// enable datatype normalization
>   parser->setFeature(XMLUni::fgDOMWhitespaceInElementContent, false);
>// ignore white spaces
>   parser->setFeature(XMLUni::fgXercesValidationErrorAsFatal, false);
>// continue after validation error
>
>   // Instantiate error handler and install it
>   parser->setErrorHandler(&errorHandler);
>   //reset error count first
>   errorHandler.resetErrors();
>
>   const char* msgInBuf = strMessage.data();
>   MTidyPointer<MemBufInputSource> memBufIS;
>   try {
>     memBufIS = new MemBufInputSource(reinterpret_cast<const
>XMLByte*>(msgInBuf),
>                                                       static_cast<unsigned
>int>(strlen(msgInBuf) * sizeof(XMLByte)),
>                                                       memBufId,
>                                                       false);
>     memBufIS->setEncoding(0);
>     // reset document pool
>     parser->resetDocumentPool();
>     // Load the schema.
>     if (schemaLocation.length() != 0) {
>       if (schemaLocation.contains(" ")) {
>         parser->setProperty (XMLUni::fgXercesSchemaExternalSchemaLocation,
>const_cast<XMLCh*>(XMLStringWrapper(schemaLocation).UnicodeForm()));
>       } else {
>         parser->setProperty
>(XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation,
>const_cast<XMLCh*>(XMLStringWrapper(schemaLocation).UnicodeForm()));
>       }
>     }
>
>     Wrapper4InputSource wrapper(memBufIS);
>     doc = parser->parse(wrapper);
>
>Can anybody tell whether I should add anything more to the validating parser
>to support soap envelope in my XML?  I want to know whether, to support
>this, the schema also should use soap envelope?
>
>Thanks in Advance
>
>Mini.


RE: Getting core dump at xerces::SAXParser::parse function [RefHash2KeysTableOf::removeAll]

Posted by sa...@wipro.com.
Hi Alberto,

I resolved my problem. I used SAXParser::cacheGrammarFromParse  function
to enable the cache. Then started working fine.

Thanks a zillion for your support. Thank you so much..


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Thursday, August 09, 2007 4:53 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function
[RefHash2KeysTableOf::removeAll]

Sasikumar,
the informations I have don't allow me to guess where the error is; try
avoiding global variables and make the SAXParser a private variable of
the class (deleting it in the destructor).

Alberto

At 16.07 09/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>Alberto,
>I am struck with these core dumps. Any idea on these....
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: sasikumar.kandhasamy@wipro.com
>[mailto:sasikumar.kandhasamy@wipro.com]
>Sent: Thursday, August 09, 2007 2:08 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function 
>[RefHash2KeysTableOf::removeAll]
>
>
>Alberto,
>It is single thread application. But We will not recreate the SAXParser

>instance. Because we will check for NULL before creating the instance.
>So first time it will be created and reuses the instance for the reset
.
>
>Sample code is,
>XMResponseParser::XMResponseParser()
>                  : response("")
>{
>  try
>     {
>
>         if (handler == NULL) {
>                 handler = ::new SAXPrintHandlers();
>         }
>         if (Parser == NULL) {
>                 Parser = ::new SAXParser();
>         }
>//  set the SAX parser to validate
>         Parser->setValidationScheme(SAXParser::Val_Always);
>         Parser->setDoNamespaces(true);
>         Parser->setDoSchema(true);
>         Parser->setValidationSchemaFullChecking(true);
>     }
>     catch (const XMLException& toCatch)
>     {
>                 ....
>     }
>}
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function [RefHash2KeysTableOf::removeAll]

Posted by Alberto Massari <am...@datadirect.com>.
Sasikumar,
the informations I have don't allow me to guess where the error is; 
try avoiding global variables and make the SAXParser a private 
variable of the class (deleting it in the destructor).

Alberto

At 16.07 09/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>Alberto,
>I am struck with these core dumps. Any idea on these....
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>-----Original Message-----
>From: sasikumar.kandhasamy@wipro.com
>[mailto:sasikumar.kandhasamy@wipro.com]
>Sent: Thursday, August 09, 2007 2:08 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>[RefHash2KeysTableOf::removeAll]
>
>
>Alberto,
>It is single thread application. But We will not recreate the SAXParser
>instance. Because we will check for NULL before creating the instance.
>So first time it will be created and reuses the instance for the reset .
>
>Sample code is,
>XMResponseParser::XMResponseParser()
>                  : response("")
>{
>  try
>     {
>
>         if (handler == NULL) {
>                 handler = ::new SAXPrintHandlers();
>         }
>         if (Parser == NULL) {
>                 Parser = ::new SAXParser();
>         }
>//  set the SAX parser to validate
>         Parser->setValidationScheme(SAXParser::Val_Always);
>         Parser->setDoNamespaces(true);
>         Parser->setDoSchema(true);
>         Parser->setValidationSchemaFullChecking(true);
>     }
>     catch (const XMLException& toCatch)
>     {
>                 ....
>     }
>}
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam


RE: Getting core dump at xerces::SAXParser::parse function [RefHash2KeysTableOf::removeAll]

Posted by sa...@wipro.com.
Alberto,
I am struck with these core dumps. Any idea on these.... 


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: sasikumar.kandhasamy@wipro.com
[mailto:sasikumar.kandhasamy@wipro.com] 
Sent: Thursday, August 09, 2007 2:08 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function
[RefHash2KeysTableOf::removeAll]


Alberto,
It is single thread application. But We will not recreate the SAXParser
instance. Because we will check for NULL before creating the instance.
So first time it will be created and reuses the instance for the reset .

Sample code is,
XMResponseParser::XMResponseParser()
                 : response("")
{
 try
    {
        
        if (handler == NULL) {
                handler = ::new SAXPrintHandlers();
        }
        if (Parser == NULL) {
                Parser = ::new SAXParser();
        }
//  set the SAX parser to validate
        Parser->setValidationScheme(SAXParser::Val_Always);
        Parser->setDoNamespaces(true);
        Parser->setDoSchema(true);
        Parser->setValidationSchemaFullChecking(true);
    }
    catch (const XMLException& toCatch)
    {
		....
    }
}

Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com]
Sent: Thursday, August 09, 2007 1:27 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function
[RefHash2KeysTableOf::removeAll]

By chance, are you using multiple threads and reusing the same SAXParser
instance from every thread?

Alberto

At 11.58 09/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>
>Alberto/Team,
>
>Now I created a standalone pointer to SAXParser. I am initializing the 
>pointer once in my constructor. And I was reusing the pointer for every

>xml validation request without deleting the pointer to SAXParser.
>
>But I am getting core dump at different  point, again this is happening

>at the third request or fourth request. Below is the back trace from 
>core dump.
>
>#0  0xd6b49384 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+
>0
>x5c ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>(gdb) bt
>#0  0xd6b49384 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+
>0
>x5c ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#1  0xd6b49298 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::~RefHash2K
>e ysTableOf<xerces c_2_7::SchemaAttDef>+0x20 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#2  0xd6b49148 in xercesc_2_7::ComplexTypeInfo::~ComplexTypeInfo+0xe8
()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#3  0xd6c659a8 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::removeAll+0x
>6
>8 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#4  0xd6c654f4 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::cleanup+0x14
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#5  0xd6c651f8 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::~RefHashTabl
>e
>Of<xercesc_2_7:: ComplexTypeInfo>
>    +0x20 () from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#6  0xd6c650ac in xercesc_2_7::SchemaGrammar::cleanUp+0x8c () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#7  0xd6c64a74 in xercesc_2_7::SchemaGrammar::~SchemaGrammar+0x34 () 
>from  /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#8  0xd6bec070 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::Grammar>::removeAll+0x68 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#9  0xd6bed8e0 in xercesc_2_7::GrammarResolver::reset+0x18 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#10 0xd6bee368 in
>xercesc_2_7::GrammarResolver::cacheGrammarFromParse+0x18 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#11 0xd6c02a28 in xercesc_2_7::IGXMLScanner::scanReset+0x40 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#12 0xd6bf5508 in xercesc_2_7::IGXMLScanner::scanDocument+0x80 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#13 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#14 0x5bdda0 in XMResponseParser::validateMsgBuffer (this=0x7788b07d, 
>schemaLoc=0x7788af2c "") at XMResponseParser.cc:119
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: sasikumar.kandhasamy@wipro.com
>[mailto:sasikumar.kandhasamy@wipro.com]
>Sent: Wednesday, August 08, 2007 5:11 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>
>Hi Alberto,
>Now I moved both the objects to local declaration. And in destructor, I

>am not doing any thing. Even then I am getting crash.
>
>Below is the destructor code,
>
>XMResponseParser::~XMResponseParser()
>{
>     /*if ( theDOMSupportPtr != NULL ) {
>         delete theDOMSupportPtr;
>         theDOMSupportPtr = NULL;
>     }
>     if ( theLiaisonPtr != NULL ) {
>         delete theLiaisonPtr;
>         theLiaisonPtr = NULL;
>     }*/
>     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor ); }
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 4:09 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>At 16.06 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >They are non static variables. But I have declared both the objects 
> >globally.
>
>So they *are* static....
>
>Alberto
>
>
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 4:02 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >Hi Sasikumar,
> >I cannot speak for the Xalan part, but I find suspicious that you are

> >deleting two variables theDOMSupportPtr and theLiaisonPtr that are 
> >not part of the class definition. If they are static variables, you 
> >are destroying something that you will need later.
> >
> >Alberto
> >
> >At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> > >Hi Alberto,
> > >
> > >Below is my class declaration,
> > >
> > >class XMResponseParser
> > >{
> > >     public:
> > >        XMResponseParser();
> > >        ~XMResponseParser();
> > >
> > >        void             validateMsgBuffer(char *);
> > >        void             retrieveElementValue(const string
>&expression,
> > >string &returnVal);
> > >        bool             isElementExist(const string &xPath);
> > >        void             setResponseXML(const string &respMsg);
> > >
> > >     private:
> > >
> > >        SAXPrintHandlers         handler;
> > >        SAXParser                parser;
> > >        string                   response;
> > >};
> > >
> > >In parser application, I am using  XalanSourceTreeDOMSupport and 
> > >XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory

> > >in destructor. Below is the code,
> > >
> > >
> > >XMResponseParser::~XMResponseParser()
> > >{
> > >     if ( theDOMSupportPtr != NULL ) {
> > >         delete theDOMSupportPtr;
> > >         theDOMSupportPtr = NULL;
> > >     }
> > >     if ( theLiaisonPtr != NULL ) {
> > >         delete theLiaisonPtr;
> > >         theLiaisonPtr = NULL;
> > >     }
> > >     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor 
> > >);
>
> > >}
> > >
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > >Sent: Wednesday, August 08, 2007 3:43 PM
> > >To: c-users@xerces.apache.org
> > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > >
> > >Hi Sasikumar,
> > >you must be doing something wrong in the destructor; could you post

> > >the
> >
> > >code? Otherwise it's just a guessing game...
> > >
> > >Alberto
> > >
> > >At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > >
> > >
> > > >As per Alberto's suggestion, I moved Initialize/Terminate of both

> > > >XMLPlatformUtils and XPathEvaluator to main function. But still I

> > > >am getting crash.
> > > >
> > > >And if didn't call destructor(i.e., without using delete) of my 
> > > >class
> >
> > > >"XMResponseParser" which internally has SAXParser object, then it

> > > >is working fine. Without deleting the memory of the object, I am 
> > > >creating new object for the next request.
> > > >
> > > >But above scenario will lead to memory leak. Kindly give me the 
> > > >suggestion why it is happening as above?
> > > >
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > >Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: sasikumar.kandhasamy@wipro.com 
> > > >[mailto:sasikumar.kandhasamy@wipro.com]
> > > >Sent: Wednesday, August 08, 2007 2:02 PM
> > > >To: c-users@xerces.apache.org
> > > >Subject: RE: Getting core dump at xerces::SAXParser::parse 
> > > >function
> > > >
> > > >
> > > >Hi Alberto,
> > > >Thanks for the information. I will verify the system after moving

> > > >the
> >
> > > >Initialize/Terminate to main.
> > > >
> > > >And one more question is "I am creating SAXParse for every xml 
> > > >response
> > >
> > > >and end of validation, I am deleting the memory. Is that correct 
> > > >way of
> > >
> > > >doing it?"
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > >Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > > >Sent: Wednesday, August 08, 2007 1:56 PM
> > > >To: c-users@xerces.apache.org
> > > >Subject: Re: Getting core dump at xerces::SAXParser::parse 
> > > >function
> > > >
> > > >As the crash in inside the memory manager, it could be that you 
> > > >called Terminate and then Initialize while still keeping some 
> > > >objects
> >alive.
> > > >Please move the Initialize/Terminate calls to the "main"
> > > >function and call them just once.
> > > >
> > > >Alberto
> > > >
> > > >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > > >
> > > > >
> > > > >Hi Team,
> > > > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan 
> > > > >for Xpath Exp in our application. At runtime, our application 
> > > > >may
>
> > > > >invokes
> > >
> > > > >SAXParser more than once depending on response xml we are 
> > > > >getting
>
> > > > >into system.
> > > > >
> > > > >I am getting the core dump from my application when it reaches 
> > > > >SAXParse::parse function for the second time.
> > > > >
> > > > >I am using SAXParser as member to my class. I have used 
> > > > >Initialize and Terminate functions as advised in apache site.
> > > > >
> > > > >Below is the back trace from core dump. Kindly help me on this
> > > > >
> > > > >
> > > > >
> > > > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > > > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > > > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > > > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > > > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#5  0xd6bc6bac in
> > > > >xercesc_2_7::DatatypeValidator::setTypeName+0xe4
> > > > >()
> > >
> > > > >from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#6  0xd6bccb50 in
> > > > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+
> > > > >0x
> > > > >47
> > > > >8
> > > > >
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#7  0xd6c94478 in
> > > > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#8  0xd6c85828 in
> > > > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#9  0xd6ca16a4 in
> > > > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#10 0xd6c90444 in
> > > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#11 0xd6c848a8 in
> > > > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#12 0xd6ca519c in
> > > > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#13 0xd6c86d88 in
> > > > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#14 0xd6ca26d0 in
> > > > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#15 0xd6c90414 in
> > > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#16 0xd6c9e550 in
> > > > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
> > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#17 0xd6c7f034 in
> > > > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
> > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#18 0xd6c7ebf4 in
> > > > >xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#19 0xd6c053e8 in
> > > > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#20 0xd6c0472c in
> > > > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#21 0xd6bfc0fc in
> > > > >xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8
> > > > >()
>
> > > > >from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer
> > > > >(this=0x7788f155,
> > > > >
> > > > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > > > >
> > > > >Thanks & Regards,
> > > > >Sasikumar Kandhasamy
> > > > >
> > > > >Mobile:- +91 9986378586
> > > > >
> > > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > > >Abdul
> >
> > > > >Kalam
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> > >The information contained in this electronic message and any 
> > >attachments to this message are intended for the exclusive use of 
> > >the
> > >addressee(s) and may contain proprietary, confidential or 
> > >privileged information. If you are not the intended recipient, you 
> > >should not disseminate, distribute or copy this e-mail. Please 
> > >notify the sender
>
> > >immediately and destroy all copies of this message and any
>attachments.
> > >
> > >WARNING: Computer viruses can be transmitted via email. The 
> > >recipient
>
> > >should check this email and any attachments for the presence of 
> > >viruses. The company accepts no liability for any damage caused by 
> > >any virus transmitted by this email.
> > >
> > >www.wipro.com
> >
> >
> >
> >The information contained in this electronic message and any 
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain proprietary, confidential or privileged 
> >information. If you are not the intended recipient, you should not 
> >disseminate, distribute or copy this e-mail. Please notify the sender

> >immediately and destroy all copies of this message and any
attachments.
> >
> >WARNING: Computer viruses can be transmitted via email. The recipient

> >should check this email and any attachments for the presence of 
> >viruses. The company accepts no liability for any damage caused by 
> >any virus transmitted by this email.
> >
> >www.wipro.com
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of
viruses.
>The company accepts no liability for any damage caused by any virus 
>transmitted by this email.
>
>www.wipro.com
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of
viruses.
>The company accepts no liability for any damage caused by any virus 
>transmitted by this email.
>
>www.wipro.com
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
 
www.wipro.com


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function [RefHash2KeysTableOf::removeAll]

Posted by sa...@wipro.com.
Alberto,
It is single thread application. But We will not recreate the SAXParser
instance. Because we will check for NULL before creating the instance.
So first time it will be created and reuses the instance for the reset .

Sample code is,
XMResponseParser::XMResponseParser()
                 : response("")
{
 try
    {
        
        if (handler == NULL) {
                handler = ::new SAXPrintHandlers();
        }
        if (Parser == NULL) {
                Parser = ::new SAXParser();
        }
//  set the SAX parser to validate
        Parser->setValidationScheme(SAXParser::Val_Always);
        Parser->setDoNamespaces(true);
        Parser->setDoSchema(true);
        Parser->setValidationSchemaFullChecking(true);
    }
    catch (const XMLException& toCatch)
    {
		....
    }
}

Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Thursday, August 09, 2007 1:27 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function
[RefHash2KeysTableOf::removeAll]

By chance, are you using multiple threads and reusing the same SAXParser
instance from every thread?

Alberto

At 11.58 09/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>
>Alberto/Team,
>
>Now I created a standalone pointer to SAXParser. I am initializing the 
>pointer once in my constructor. And I was reusing the pointer for every

>xml validation request without deleting the pointer to SAXParser.
>
>But I am getting core dump at different  point, again this is happening

>at the third request or fourth request. Below is the back trace from 
>core dump.
>
>#0  0xd6b49384 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+
>0
>x5c ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>(gdb) bt
>#0  0xd6b49384 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+
>0
>x5c ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#1  0xd6b49298 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::~RefHash2K
>e ysTableOf<xerces c_2_7::SchemaAttDef>+0x20 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#2  0xd6b49148 in xercesc_2_7::ComplexTypeInfo::~ComplexTypeInfo+0xe8
()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#3  0xd6c659a8 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::removeAll+0x
>6
>8 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#4  0xd6c654f4 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::cleanup+0x14
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#5  0xd6c651f8 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::~RefHashTabl
>e
>Of<xercesc_2_7:: ComplexTypeInfo>
>    +0x20 () from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#6  0xd6c650ac in xercesc_2_7::SchemaGrammar::cleanUp+0x8c () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#7  0xd6c64a74 in xercesc_2_7::SchemaGrammar::~SchemaGrammar+0x34 () 
>from  /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#8  0xd6bec070 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::Grammar>::removeAll+0x68 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#9  0xd6bed8e0 in xercesc_2_7::GrammarResolver::reset+0x18 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#10 0xd6bee368 in
>xercesc_2_7::GrammarResolver::cacheGrammarFromParse+0x18 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#11 0xd6c02a28 in xercesc_2_7::IGXMLScanner::scanReset+0x40 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#12 0xd6bf5508 in xercesc_2_7::IGXMLScanner::scanDocument+0x80 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#13 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#14 0x5bdda0 in XMResponseParser::validateMsgBuffer (this=0x7788b07d, 
>schemaLoc=0x7788af2c "") at XMResponseParser.cc:119
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: sasikumar.kandhasamy@wipro.com
>[mailto:sasikumar.kandhasamy@wipro.com]
>Sent: Wednesday, August 08, 2007 5:11 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>
>Hi Alberto,
>Now I moved both the objects to local declaration. And in destructor, I

>am not doing any thing. Even then I am getting crash.
>
>Below is the destructor code,
>
>XMResponseParser::~XMResponseParser()
>{
>     /*if ( theDOMSupportPtr != NULL ) {
>         delete theDOMSupportPtr;
>         theDOMSupportPtr = NULL;
>     }
>     if ( theLiaisonPtr != NULL ) {
>         delete theLiaisonPtr;
>         theLiaisonPtr = NULL;
>     }*/
>     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor ); }
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 4:09 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>At 16.06 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >They are non static variables. But I have declared both the objects 
> >globally.
>
>So they *are* static....
>
>Alberto
>
>
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 4:02 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >Hi Sasikumar,
> >I cannot speak for the Xalan part, but I find suspicious that you are

> >deleting two variables theDOMSupportPtr and theLiaisonPtr that are 
> >not part of the class definition. If they are static variables, you 
> >are destroying something that you will need later.
> >
> >Alberto
> >
> >At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> > >Hi Alberto,
> > >
> > >Below is my class declaration,
> > >
> > >class XMResponseParser
> > >{
> > >     public:
> > >        XMResponseParser();
> > >        ~XMResponseParser();
> > >
> > >        void             validateMsgBuffer(char *);
> > >        void             retrieveElementValue(const string
>&expression,
> > >string &returnVal);
> > >        bool             isElementExist(const string &xPath);
> > >        void             setResponseXML(const string &respMsg);
> > >
> > >     private:
> > >
> > >        SAXPrintHandlers         handler;
> > >        SAXParser                parser;
> > >        string                   response;
> > >};
> > >
> > >In parser application, I am using  XalanSourceTreeDOMSupport and 
> > >XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory

> > >in destructor. Below is the code,
> > >
> > >
> > >XMResponseParser::~XMResponseParser()
> > >{
> > >     if ( theDOMSupportPtr != NULL ) {
> > >         delete theDOMSupportPtr;
> > >         theDOMSupportPtr = NULL;
> > >     }
> > >     if ( theLiaisonPtr != NULL ) {
> > >         delete theLiaisonPtr;
> > >         theLiaisonPtr = NULL;
> > >     }
> > >     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor 
> > >);
>
> > >}
> > >
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > >Sent: Wednesday, August 08, 2007 3:43 PM
> > >To: c-users@xerces.apache.org
> > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > >
> > >Hi Sasikumar,
> > >you must be doing something wrong in the destructor; could you post

> > >the
> >
> > >code? Otherwise it's just a guessing game...
> > >
> > >Alberto
> > >
> > >At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > >
> > >
> > > >As per Alberto's suggestion, I moved Initialize/Terminate of both

> > > >XMLPlatformUtils and XPathEvaluator to main function. But still I

> > > >am getting crash.
> > > >
> > > >And if didn't call destructor(i.e., without using delete) of my 
> > > >class
> >
> > > >"XMResponseParser" which internally has SAXParser object, then it

> > > >is working fine. Without deleting the memory of the object, I am 
> > > >creating new object for the next request.
> > > >
> > > >But above scenario will lead to memory leak. Kindly give me the 
> > > >suggestion why it is happening as above?
> > > >
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > >Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: sasikumar.kandhasamy@wipro.com 
> > > >[mailto:sasikumar.kandhasamy@wipro.com]
> > > >Sent: Wednesday, August 08, 2007 2:02 PM
> > > >To: c-users@xerces.apache.org
> > > >Subject: RE: Getting core dump at xerces::SAXParser::parse 
> > > >function
> > > >
> > > >
> > > >Hi Alberto,
> > > >Thanks for the information. I will verify the system after moving

> > > >the
> >
> > > >Initialize/Terminate to main.
> > > >
> > > >And one more question is "I am creating SAXParse for every xml 
> > > >response
> > >
> > > >and end of validation, I am deleting the memory. Is that correct 
> > > >way of
> > >
> > > >doing it?"
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > >Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > > >Sent: Wednesday, August 08, 2007 1:56 PM
> > > >To: c-users@xerces.apache.org
> > > >Subject: Re: Getting core dump at xerces::SAXParser::parse 
> > > >function
> > > >
> > > >As the crash in inside the memory manager, it could be that you 
> > > >called Terminate and then Initialize while still keeping some 
> > > >objects
> >alive.
> > > >Please move the Initialize/Terminate calls to the "main"
> > > >function and call them just once.
> > > >
> > > >Alberto
> > > >
> > > >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > > >
> > > > >
> > > > >Hi Team,
> > > > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan 
> > > > >for Xpath Exp in our application. At runtime, our application 
> > > > >may
>
> > > > >invokes
> > >
> > > > >SAXParser more than once depending on response xml we are 
> > > > >getting
>
> > > > >into system.
> > > > >
> > > > >I am getting the core dump from my application when it reaches 
> > > > >SAXParse::parse function for the second time.
> > > > >
> > > > >I am using SAXParser as member to my class. I have used 
> > > > >Initialize and Terminate functions as advised in apache site.
> > > > >
> > > > >Below is the back trace from core dump. Kindly help me on this
> > > > >
> > > > >
> > > > >
> > > > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > > > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > > > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > > > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > > > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#5  0xd6bc6bac in
> > > > >xercesc_2_7::DatatypeValidator::setTypeName+0xe4
> > > > >()
> > >
> > > > >from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#6  0xd6bccb50 in
> > > > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+
> > > > >0x
> > > > >47
> > > > >8
> > > > >
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#7  0xd6c94478 in
> > > > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#8  0xd6c85828 in
> > > > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#9  0xd6ca16a4 in
> > > > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#10 0xd6c90444 in
> > > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#11 0xd6c848a8 in
> > > > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#12 0xd6ca519c in
> > > > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#13 0xd6c86d88 in
> > > > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#14 0xd6ca26d0 in
> > > > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#15 0xd6c90414 in
> > > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#16 0xd6c9e550 in
> > > > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
> > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#17 0xd6c7f034 in
> > > > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
> > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#18 0xd6c7ebf4 in
> > > > >xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#19 0xd6c053e8 in
> > > > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#20 0xd6c0472c in
> > > > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#21 0xd6bfc0fc in 
> > > > >xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 
> > > > >()
>
> > > > >from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer
> > > > >(this=0x7788f155,
> > > > >
> > > > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > > > >
> > > > >Thanks & Regards,
> > > > >Sasikumar Kandhasamy
> > > > >
> > > > >Mobile:- +91 9986378586
> > > > >
> > > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > > >Abdul
> >
> > > > >Kalam
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> > >The information contained in this electronic message and any 
> > >attachments to this message are intended for the exclusive use of 
> > >the
> > >addressee(s) and may contain proprietary, confidential or 
> > >privileged information. If you are not the intended recipient, you 
> > >should not disseminate, distribute or copy this e-mail. Please 
> > >notify the sender
>
> > >immediately and destroy all copies of this message and any
>attachments.
> > >
> > >WARNING: Computer viruses can be transmitted via email. The 
> > >recipient
>
> > >should check this email and any attachments for the presence of 
> > >viruses. The company accepts no liability for any damage caused by 
> > >any virus transmitted by this email.
> > >
> > >www.wipro.com
> >
> >
> >
> >The information contained in this electronic message and any 
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain proprietary, confidential or privileged 
> >information. If you are not the intended recipient, you should not 
> >disseminate, distribute or copy this e-mail. Please notify the sender

> >immediately and destroy all copies of this message and any
attachments.
> >
> >WARNING: Computer viruses can be transmitted via email. The recipient

> >should check this email and any attachments for the presence of 
> >viruses. The company accepts no liability for any damage caused by 
> >any virus transmitted by this email.
> >
> >www.wipro.com
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the 
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of
viruses.
>The company accepts no liability for any damage caused by any virus 
>transmitted by this email.
>
>www.wipro.com
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the 
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of
viruses.
>The company accepts no liability for any damage caused by any virus 
>transmitted by this email.
>
>www.wipro.com
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the 
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function [RefHash2KeysTableOf::removeAll]

Posted by Alberto Massari <am...@datadirect.com>.
By chance, are you using multiple threads and reusing the same 
SAXParser instance from every thread?

Alberto

At 11.58 09/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>
>Alberto/Team,
>
>Now I created a standalone pointer to SAXParser. I am initializing the
>pointer once in my constructor. And I was reusing the pointer for every
>xml validation request without deleting the pointer to SAXParser.
>
>But I am getting core dump at different  point, again this is happening
>at the third request or fourth request. Below is the back trace from
>core dump.
>
>#0  0xd6b49384 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+0
>x5c ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>(gdb) bt
>#0  0xd6b49384 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+0
>x5c ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#1  0xd6b49298 in
>xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::~RefHash2Ke
>ysTableOf<xerces c_2_7::SchemaAttDef>+0x20 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#2  0xd6b49148 in xercesc_2_7::ComplexTypeInfo::~ComplexTypeInfo+0xe8 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#3  0xd6c659a8 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::removeAll+0x6
>8 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#4  0xd6c654f4 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::cleanup+0x14
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#5  0xd6c651f8 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::~RefHashTable
>Of<xercesc_2_7:: ComplexTypeInfo>
>    +0x20 () from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#6  0xd6c650ac in xercesc_2_7::SchemaGrammar::cleanUp+0x8c () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#7  0xd6c64a74 in xercesc_2_7::SchemaGrammar::~SchemaGrammar+0x34 ()
>from  /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#8  0xd6bec070 in
>xercesc_2_7::RefHashTableOf<xercesc_2_7::Grammar>::removeAll+0x68 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#9  0xd6bed8e0 in xercesc_2_7::GrammarResolver::reset+0x18 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#10 0xd6bee368 in
>xercesc_2_7::GrammarResolver::cacheGrammarFromParse+0x18 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#11 0xd6c02a28 in xercesc_2_7::IGXMLScanner::scanReset+0x40 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#12 0xd6bf5508 in xercesc_2_7::IGXMLScanner::scanDocument+0x80 () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#13 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#14 0x5bdda0 in XMResponseParser::validateMsgBuffer (this=0x7788b07d,
>schemaLoc=0x7788af2c "") at XMResponseParser.cc:119
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>-----Original Message-----
>From: sasikumar.kandhasamy@wipro.com
>[mailto:sasikumar.kandhasamy@wipro.com]
>Sent: Wednesday, August 08, 2007 5:11 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>
>Hi Alberto,
>Now I moved both the objects to local declaration. And in destructor, I
>am not doing any thing. Even then I am getting crash.
>
>Below is the destructor code,
>
>XMResponseParser::~XMResponseParser()
>{
>     /*if ( theDOMSupportPtr != NULL ) {
>         delete theDOMSupportPtr;
>         theDOMSupportPtr = NULL;
>     }
>     if ( theLiaisonPtr != NULL ) {
>         delete theLiaisonPtr;
>         theLiaisonPtr = NULL;
>     }*/
>     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor ); }
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 4:09 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>At 16.06 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >They are non static variables. But I have declared both the objects
> >globally.
>
>So they *are* static....
>
>Alberto
>
>
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 4:02 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >Hi Sasikumar,
> >I cannot speak for the Xalan part, but I find suspicious that you are
> >deleting two variables theDOMSupportPtr and theLiaisonPtr that are not
> >part of the class definition. If they are static variables, you are
> >destroying something that you will need later.
> >
> >Alberto
> >
> >At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> > >Hi Alberto,
> > >
> > >Below is my class declaration,
> > >
> > >class XMResponseParser
> > >{
> > >     public:
> > >        XMResponseParser();
> > >        ~XMResponseParser();
> > >
> > >        void             validateMsgBuffer(char *);
> > >        void             retrieveElementValue(const string
>&expression,
> > >string &returnVal);
> > >        bool             isElementExist(const string &xPath);
> > >        void             setResponseXML(const string &respMsg);
> > >
> > >     private:
> > >
> > >        SAXPrintHandlers         handler;
> > >        SAXParser                parser;
> > >        string                   response;
> > >};
> > >
> > >In parser application, I am using  XalanSourceTreeDOMSupport and
> > >XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory
> > >in destructor. Below is the code,
> > >
> > >
> > >XMResponseParser::~XMResponseParser()
> > >{
> > >     if ( theDOMSupportPtr != NULL ) {
> > >         delete theDOMSupportPtr;
> > >         theDOMSupportPtr = NULL;
> > >     }
> > >     if ( theLiaisonPtr != NULL ) {
> > >         delete theLiaisonPtr;
> > >         theLiaisonPtr = NULL;
> > >     }
> > >     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor );
>
> > >}
> > >
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > >Sent: Wednesday, August 08, 2007 3:43 PM
> > >To: c-users@xerces.apache.org
> > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > >
> > >Hi Sasikumar,
> > >you must be doing something wrong in the destructor; could you post
> > >the
> >
> > >code? Otherwise it's just a guessing game...
> > >
> > >Alberto
> > >
> > >At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > >
> > >
> > > >As per Alberto's suggestion, I moved Initialize/Terminate of both
> > > >XMLPlatformUtils and XPathEvaluator to main function. But still I
> > > >am getting crash.
> > > >
> > > >And if didn't call destructor(i.e., without using delete) of my
> > > >class
> >
> > > >"XMResponseParser" which internally has SAXParser object, then it
> > > >is working fine. Without deleting the memory of the object, I am
> > > >creating new object for the next request.
> > > >
> > > >But above scenario will lead to memory leak. Kindly give me the
> > > >suggestion why it is happening as above?
> > > >
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: sasikumar.kandhasamy@wipro.com
> > > >[mailto:sasikumar.kandhasamy@wipro.com]
> > > >Sent: Wednesday, August 08, 2007 2:02 PM
> > > >To: c-users@xerces.apache.org
> > > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > > >
> > > >
> > > >Hi Alberto,
> > > >Thanks for the information. I will verify the system after moving
> > > >the
> >
> > > >Initialize/Terminate to main.
> > > >
> > > >And one more question is "I am creating SAXParse for every xml
> > > >response
> > >
> > > >and end of validation, I am deleting the memory. Is that correct
> > > >way of
> > >
> > > >doing it?"
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > > >Sent: Wednesday, August 08, 2007 1:56 PM
> > > >To: c-users@xerces.apache.org
> > > >Subject: Re: Getting core dump at xerces::SAXParser::parse function
> > > >
> > > >As the crash in inside the memory manager, it could be that you
> > > >called Terminate and then Initialize while still keeping some
> > > >objects
> >alive.
> > > >Please move the Initialize/Terminate calls to the "main"
> > > >function and call them just once.
> > > >
> > > >Alberto
> > > >
> > > >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > > >
> > > > >
> > > > >Hi Team,
> > > > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan
> > > > >for Xpath Exp in our application. At runtime, our application may
>
> > > > >invokes
> > >
> > > > >SAXParser more than once depending on response xml we are getting
>
> > > > >into system.
> > > > >
> > > > >I am getting the core dump from my application when it reaches
> > > > >SAXParse::parse function for the second time.
> > > > >
> > > > >I am using SAXParser as member to my class. I have used
> > > > >Initialize and Terminate functions as advised in apache site.
> > > > >
> > > > >Below is the back trace from core dump. Kindly help me on this
> > > > >
> > > > >
> > > > >
> > > > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > > > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > > > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > > > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > > > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#5  0xd6bc6bac in
> > > > >xercesc_2_7::DatatypeValidator::setTypeName+0xe4
> > > > >()
> > >
> > > > >from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#6  0xd6bccb50 in
> > > > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x
> > > > >47
> > > > >8
> > > > >
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#7  0xd6c94478 in
> > > > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#8  0xd6c85828 in
> > > > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#9  0xd6ca16a4 in
> > > > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#10 0xd6c90444 in
> > > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#11 0xd6c848a8 in
> > > > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#12 0xd6ca519c in
> > > > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#13 0xd6c86d88 in
> > > > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#14 0xd6ca26d0 in
> > > > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#15 0xd6c90414 in
> > > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#16 0xd6c9e550 in
> > > > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
> > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#17 0xd6c7f034 in
> > > > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
> > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#18 0xd6c7ebf4 in
> > > > >xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#19 0xd6c053e8 in
> > > > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#20 0xd6c0472c in
> > > > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > > > >()
> > > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 ()
>
> > > > >from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100
> > > > >() from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > > > >
> > > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer
> > > > >(this=0x7788f155,
> > > > >
> > > > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > > > >
> > > > >Thanks & Regards,
> > > > >Sasikumar Kandhasamy
> > > > >
> > > > >Mobile:- +91 9986378586
> > > > >
> > > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J
> > > > >Abdul
> >
> > > > >Kalam
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> > >The information contained in this electronic message and any
> > >attachments to this message are intended for the exclusive use of the
> > >addressee(s) and may contain proprietary, confidential or privileged
> > >information. If you are not the intended recipient, you should not
> > >disseminate, distribute or copy this e-mail. Please notify the sender
>
> > >immediately and destroy all copies of this message and any
>attachments.
> > >
> > >WARNING: Computer viruses can be transmitted via email. The recipient
>
> > >should check this email and any attachments for the presence of
> > >viruses. The company accepts no liability for any damage caused by
> > >any virus transmitted by this email.
> > >
> > >www.wipro.com
> >
> >
> >
> >The information contained in this electronic message and any
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain proprietary, confidential or privileged
> >information. If you are not the intended recipient, you should not
> >disseminate, distribute or copy this e-mail. Please notify the sender
> >immediately and destroy all copies of this message and any attachments.
> >
> >WARNING: Computer viruses can be transmitted via email. The recipient
> >should check this email and any attachments for the presence of
> >viruses. The company accepts no liability for any damage caused by any
> >virus transmitted by this email.
> >
> >www.wipro.com
>
>
>
>The information contained in this electronic message and any attachments
>to this message are intended for the exclusive use of the addressee(s)
>and may contain proprietary, confidential or privileged information. If
>you are not the intended recipient, you should not disseminate,
>distribute or copy this e-mail. Please notify the sender immediately and
>destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient
>should check this email and any attachments for the presence of viruses.
>The company accepts no liability for any damage caused by any virus
>transmitted by this email.
>
>www.wipro.com
>
>
>The information contained in this electronic message and any attachments
>to this message are intended for the exclusive use of the addressee(s)
>and may contain proprietary, confidential or privileged information. If
>you are not the intended recipient, you should not disseminate,
>distribute or copy this e-mail. Please notify the sender immediately and
>destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient
>should check this email and any attachments for the presence of viruses.
>The company accepts no liability for any damage caused by any virus
>transmitted by this email.
>
>www.wipro.com
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of 
>the addressee(s) and may contain proprietary, confidential or 
>privileged information. If you are not the intended recipient, you 
>should not disseminate, distribute or copy this e-mail. Please 
>notify the sender immediately and destroy all copies of this message 
>and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The 
>recipient should check this email and any attachments for the 
>presence of viruses. The company accepts no liability for any damage 
>caused by any virus transmitted by this email.
>
>www.wipro.com


RE: Getting core dump at xerces::SAXParser::parse function [RefHash2KeysTableOf::removeAll]

Posted by sa...@wipro.com.
 
Alberto/Team,

Now I created a standalone pointer to SAXParser. I am initializing the
pointer once in my constructor. And I was reusing the pointer for every
xml validation request without deleting the pointer to SAXParser.

But I am getting core dump at different  point, again this is happening
at the third request or fourth request. Below is the back trace from
core dump.

#0  0xd6b49384 in
xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+0
x5c ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
(gdb) bt
#0  0xd6b49384 in
xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+0
x5c ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#1  0xd6b49298 in
xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::~RefHash2Ke
ysTableOf<xerces c_2_7::SchemaAttDef>+0x20 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#2  0xd6b49148 in xercesc_2_7::ComplexTypeInfo::~ComplexTypeInfo+0xe8 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#3  0xd6c659a8 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::removeAll+0x6
8 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#4  0xd6c654f4 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::cleanup+0x14
()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#5  0xd6c651f8 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::~RefHashTable
Of<xercesc_2_7:: ComplexTypeInfo>
   +0x20 () from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#6  0xd6c650ac in xercesc_2_7::SchemaGrammar::cleanUp+0x8c () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#7  0xd6c64a74 in xercesc_2_7::SchemaGrammar::~SchemaGrammar+0x34 ()
from  /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#8  0xd6bec070 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::Grammar>::removeAll+0x68 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#9  0xd6bed8e0 in xercesc_2_7::GrammarResolver::reset+0x18 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#10 0xd6bee368 in
xercesc_2_7::GrammarResolver::cacheGrammarFromParse+0x18 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#11 0xd6c02a28 in xercesc_2_7::IGXMLScanner::scanReset+0x40 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#12 0xd6bf5508 in xercesc_2_7::IGXMLScanner::scanDocument+0x80 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#13 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#14 0x5bdda0 in XMResponseParser::validateMsgBuffer (this=0x7788b07d,
schemaLoc=0x7788af2c "") at XMResponseParser.cc:119


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: sasikumar.kandhasamy@wipro.com
[mailto:sasikumar.kandhasamy@wipro.com]
Sent: Wednesday, August 08, 2007 5:11 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function


Hi Alberto,
Now I moved both the objects to local declaration. And in destructor, I
am not doing any thing. Even then I am getting crash.

Below is the destructor code,

XMResponseParser::~XMResponseParser()
{
    /*if ( theDOMSupportPtr != NULL ) {
        delete theDOMSupportPtr;
        theDOMSupportPtr = NULL;
    }
    if ( theLiaisonPtr != NULL ) {
        delete theLiaisonPtr;
        theLiaisonPtr = NULL;
    }*/
    ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor ); } 


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com]
Sent: Wednesday, August 08, 2007 4:09 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function

At 16.06 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>They are non static variables. But I have declared both the objects 
>globally.

So they *are* static....

Alberto


>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 4:02 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>Hi Sasikumar,
>I cannot speak for the Xalan part, but I find suspicious that you are 
>deleting two variables theDOMSupportPtr and theLiaisonPtr that are not 
>part of the class definition. If they are static variables, you are 
>destroying something that you will need later.
>
>Alberto
>
>At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >Hi Alberto,
> >
> >Below is my class declaration,
> >
> >class XMResponseParser
> >{
> >     public:
> >        XMResponseParser();
> >        ~XMResponseParser();
> >
> >        void             validateMsgBuffer(char *);
> >        void             retrieveElementValue(const string
&expression,
> >string &returnVal);
> >        bool             isElementExist(const string &xPath);
> >        void             setResponseXML(const string &respMsg);
> >
> >     private:
> >
> >        SAXPrintHandlers         handler;
> >        SAXParser                parser;
> >        string                   response;
> >};
> >
> >In parser application, I am using  XalanSourceTreeDOMSupport and 
> >XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory 
> >in destructor. Below is the code,
> >
> >
> >XMResponseParser::~XMResponseParser()
> >{
> >     if ( theDOMSupportPtr != NULL ) {
> >         delete theDOMSupportPtr;
> >         theDOMSupportPtr = NULL;
> >     }
> >     if ( theLiaisonPtr != NULL ) {
> >         delete theLiaisonPtr;
> >         theLiaisonPtr = NULL;
> >     }
> >     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor );

> >}
> >
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 3:43 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >Hi Sasikumar,
> >you must be doing something wrong in the destructor; could you post 
> >the
>
> >code? Otherwise it's just a guessing game...
> >
> >Alberto
> >
> >At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> >
> > >As per Alberto's suggestion, I moved Initialize/Terminate of both 
> > >XMLPlatformUtils and XPathEvaluator to main function. But still I 
> > >am getting crash.
> > >
> > >And if didn't call destructor(i.e., without using delete) of my 
> > >class
>
> > >"XMResponseParser" which internally has SAXParser object, then it 
> > >is working fine. Without deleting the memory of the object, I am 
> > >creating new object for the next request.
> > >
> > >But above scenario will lead to memory leak. Kindly give me the 
> > >suggestion why it is happening as above?
> > >
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: sasikumar.kandhasamy@wipro.com 
> > >[mailto:sasikumar.kandhasamy@wipro.com]
> > >Sent: Wednesday, August 08, 2007 2:02 PM
> > >To: c-users@xerces.apache.org
> > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > >
> > >
> > >Hi Alberto,
> > >Thanks for the information. I will verify the system after moving 
> > >the
>
> > >Initialize/Terminate to main.
> > >
> > >And one more question is "I am creating SAXParse for every xml 
> > >response
> >
> > >and end of validation, I am deleting the memory. Is that correct 
> > >way of
> >
> > >doing it?"
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > >Sent: Wednesday, August 08, 2007 1:56 PM
> > >To: c-users@xerces.apache.org
> > >Subject: Re: Getting core dump at xerces::SAXParser::parse function
> > >
> > >As the crash in inside the memory manager, it could be that you 
> > >called Terminate and then Initialize while still keeping some 
> > >objects
>alive.
> > >Please move the Initialize/Terminate calls to the "main"
> > >function and call them just once.
> > >
> > >Alberto
> > >
> > >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > >
> > > >
> > > >Hi Team,
> > > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan 
> > > >for Xpath Exp in our application. At runtime, our application may

> > > >invokes
> >
> > > >SAXParser more than once depending on response xml we are getting

> > > >into system.
> > > >
> > > >I am getting the core dump from my application when it reaches 
> > > >SAXParse::parse function for the second time.
> > > >
> > > >I am using SAXParser as member to my class. I have used 
> > > >Initialize and Terminate functions as advised in apache site.
> > > >
> > > >Below is the back trace from core dump. Kindly help me on this
> > > >
> > > >
> > > >
> > > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#5  0xd6bc6bac in
> > > >xercesc_2_7::DatatypeValidator::setTypeName+0xe4
> > > >()
> >
> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#6  0xd6bccb50 in
> > > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x
> > > >47
> > > >8
> > > >
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#7  0xd6c94478 in
> > > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#8  0xd6c85828 in
> > > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#9  0xd6ca16a4 in
> > > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#10 0xd6c90444 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#11 0xd6c848a8 in
> > > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#12 0xd6ca519c in
> > > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#13 0xd6c86d88 in
> > > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#14 0xd6ca26d0 in
> > > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#15 0xd6c90414 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#16 0xd6c9e550 in
> > > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#17 0xd6c7f034 in
> > > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#18 0xd6c7ebf4 in
> > > >xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#19 0xd6c053e8 in
> > > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#20 0xd6c0472c in
> > > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 ()

> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer
> > > >(this=0x7788f155,
> > > >
> > > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > >Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >
> >
> >
> >
> >The information contained in this electronic message and any 
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain proprietary, confidential or privileged 
> >information. If you are not the intended recipient, you should not 
> >disseminate, distribute or copy this e-mail. Please notify the sender

> >immediately and destroy all copies of this message and any
attachments.
> >
> >WARNING: Computer viruses can be transmitted via email. The recipient

> >should check this email and any attachments for the presence of 
> >viruses. The company accepts no liability for any damage caused by 
> >any virus transmitted by this email.
> >
> >www.wipro.com
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
 
www.wipro.com


The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
 
www.wipro.com


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function

Posted by sa...@wipro.com.
Alberto/Team,

Now I created a standalone pointer to SAXParser. I am initializing the
pointer once in my constructor. And I was reusing the pointer for every
xml validation request without deleting the pointer to SAXParser.

But I am getting core dump at different  point, again this is happening
at the third request or fourth request. Below is the back trace from
core dump.

#0  0xd6b49384 in
xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+0
x5c ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
(gdb) bt
#0  0xd6b49384 in
xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::removeAll+0
x5c ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#1  0xd6b49298 in
xercesc_2_7::RefHash2KeysTableOf<xercesc_2_7::SchemaAttDef>::~RefHash2Ke
ysTableOf<xerces c_2_7::SchemaAttDef>+0x20 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#2  0xd6b49148 in xercesc_2_7::ComplexTypeInfo::~ComplexTypeInfo+0xe8 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#3  0xd6c659a8 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::removeAll+0x6
8 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#4  0xd6c654f4 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::cleanup+0x14
()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#5  0xd6c651f8 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::ComplexTypeInfo>::~RefHashTable
Of<xercesc_2_7:: ComplexTypeInfo>
   +0x20 () from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#6  0xd6c650ac in xercesc_2_7::SchemaGrammar::cleanUp+0x8c () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#7  0xd6c64a74 in xercesc_2_7::SchemaGrammar::~SchemaGrammar+0x34 ()
from  /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#8  0xd6bec070 in
xercesc_2_7::RefHashTableOf<xercesc_2_7::Grammar>::removeAll+0x68 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#9  0xd6bed8e0 in xercesc_2_7::GrammarResolver::reset+0x18 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#10 0xd6bee368 in
xercesc_2_7::GrammarResolver::cacheGrammarFromParse+0x18 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#11 0xd6c02a28 in xercesc_2_7::IGXMLScanner::scanReset+0x40 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#12 0xd6bf5508 in xercesc_2_7::IGXMLScanner::scanDocument+0x80 () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#13 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#14 0x5bdda0 in XMResponseParser::validateMsgBuffer (this=0x7788b07d,
schemaLoc=0x7788af2c "") at XMResponseParser.cc:119


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: sasikumar.kandhasamy@wipro.com
[mailto:sasikumar.kandhasamy@wipro.com] 
Sent: Wednesday, August 08, 2007 5:11 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function


Hi Alberto,
Now I moved both the objects to local declaration. And in destructor, I
am not doing any thing. Even then I am getting crash.

Below is the destructor code,

XMResponseParser::~XMResponseParser()
{
    /*if ( theDOMSupportPtr != NULL ) {
        delete theDOMSupportPtr;
        theDOMSupportPtr = NULL;
    }
    if ( theLiaisonPtr != NULL ) {
        delete theLiaisonPtr;
        theLiaisonPtr = NULL;
    }*/
    ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor ); } 


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com]
Sent: Wednesday, August 08, 2007 4:09 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function

At 16.06 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>They are non static variables. But I have declared both the objects 
>globally.

So they *are* static....

Alberto


>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 4:02 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>Hi Sasikumar,
>I cannot speak for the Xalan part, but I find suspicious that you are 
>deleting two variables theDOMSupportPtr and theLiaisonPtr that are not 
>part of the class definition. If they are static variables, you are 
>destroying something that you will need later.
>
>Alberto
>
>At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >Hi Alberto,
> >
> >Below is my class declaration,
> >
> >class XMResponseParser
> >{
> >     public:
> >        XMResponseParser();
> >        ~XMResponseParser();
> >
> >        void             validateMsgBuffer(char *);
> >        void             retrieveElementValue(const string
&expression,
> >string &returnVal);
> >        bool             isElementExist(const string &xPath);
> >        void             setResponseXML(const string &respMsg);
> >
> >     private:
> >
> >        SAXPrintHandlers         handler;
> >        SAXParser                parser;
> >        string                   response;
> >};
> >
> >In parser application, I am using  XalanSourceTreeDOMSupport and 
> >XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory 
> >in destructor. Below is the code,
> >
> >
> >XMResponseParser::~XMResponseParser()
> >{
> >     if ( theDOMSupportPtr != NULL ) {
> >         delete theDOMSupportPtr;
> >         theDOMSupportPtr = NULL;
> >     }
> >     if ( theLiaisonPtr != NULL ) {
> >         delete theLiaisonPtr;
> >         theLiaisonPtr = NULL;
> >     }
> >     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor );

> >}
> >
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 3:43 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >Hi Sasikumar,
> >you must be doing something wrong in the destructor; could you post 
> >the
>
> >code? Otherwise it's just a guessing game...
> >
> >Alberto
> >
> >At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> >
> > >As per Alberto's suggestion, I moved Initialize/Terminate of both 
> > >XMLPlatformUtils and XPathEvaluator to main function. But still I 
> > >am getting crash.
> > >
> > >And if didn't call destructor(i.e., without using delete) of my 
> > >class
>
> > >"XMResponseParser" which internally has SAXParser object, then it 
> > >is working fine. Without deleting the memory of the object, I am 
> > >creating new object for the next request.
> > >
> > >But above scenario will lead to memory leak. Kindly give me the 
> > >suggestion why it is happening as above?
> > >
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: sasikumar.kandhasamy@wipro.com 
> > >[mailto:sasikumar.kandhasamy@wipro.com]
> > >Sent: Wednesday, August 08, 2007 2:02 PM
> > >To: c-users@xerces.apache.org
> > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > >
> > >
> > >Hi Alberto,
> > >Thanks for the information. I will verify the system after moving 
> > >the
>
> > >Initialize/Terminate to main.
> > >
> > >And one more question is "I am creating SAXParse for every xml 
> > >response
> >
> > >and end of validation, I am deleting the memory. Is that correct 
> > >way of
> >
> > >doing it?"
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > >Sent: Wednesday, August 08, 2007 1:56 PM
> > >To: c-users@xerces.apache.org
> > >Subject: Re: Getting core dump at xerces::SAXParser::parse function
> > >
> > >As the crash in inside the memory manager, it could be that you 
> > >called Terminate and then Initialize while still keeping some 
> > >objects
>alive.
> > >Please move the Initialize/Terminate calls to the "main"
> > >function and call them just once.
> > >
> > >Alberto
> > >
> > >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > >
> > > >
> > > >Hi Team,
> > > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan 
> > > >for Xpath Exp in our application. At runtime, our application may

> > > >invokes
> >
> > > >SAXParser more than once depending on response xml we are getting

> > > >into system.
> > > >
> > > >I am getting the core dump from my application when it reaches 
> > > >SAXParse::parse function for the second time.
> > > >
> > > >I am using SAXParser as member to my class. I have used 
> > > >Initialize and Terminate functions as advised in apache site.
> > > >
> > > >Below is the back trace from core dump. Kindly help me on this
> > > >
> > > >
> > > >
> > > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#5  0xd6bc6bac in
> > > >xercesc_2_7::DatatypeValidator::setTypeName+0xe4
> > > >()
> >
> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#6  0xd6bccb50 in
> > > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x
> > > >47
> > > >8
> > > >
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#7  0xd6c94478 in
> > > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#8  0xd6c85828 in
> > > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#9  0xd6ca16a4 in
> > > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#10 0xd6c90444 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#11 0xd6c848a8 in
> > > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#12 0xd6ca519c in
> > > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#13 0xd6c86d88 in
> > > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#14 0xd6ca26d0 in
> > > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#15 0xd6c90414 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#16 0xd6c9e550 in
> > > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#17 0xd6c7f034 in
> > > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#18 0xd6c7ebf4 in
> > > >xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#19 0xd6c053e8 in
> > > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#20 0xd6c0472c in
> > > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 ()

> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer
> > > >(this=0x7788f155,
> > > >
> > > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > >Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >
> >
> >
> >
> >The information contained in this electronic message and any 
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain proprietary, confidential or privileged 
> >information. If you are not the intended recipient, you should not 
> >disseminate, distribute or copy this e-mail. Please notify the sender

> >immediately and destroy all copies of this message and any
attachments.
> >
> >WARNING: Computer viruses can be transmitted via email. The recipient

> >should check this email and any attachments for the presence of 
> >viruses. The company accepts no liability for any damage caused by 
> >any virus transmitted by this email.
> >
> >www.wipro.com
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
 
www.wipro.com


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function

Posted by sa...@wipro.com.
Hi Alberto,
Now I moved both the objects to local declaration. And in destructor, I
am not doing any thing. Even then I am getting crash.

Below is the destructor code,

XMResponseParser::~XMResponseParser()
{
    /*if ( theDOMSupportPtr != NULL ) {
        delete theDOMSupportPtr;
        theDOMSupportPtr = NULL;
    }
    if ( theLiaisonPtr != NULL ) {
        delete theLiaisonPtr;
        theLiaisonPtr = NULL;
    }*/
    ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor );
} 


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Wednesday, August 08, 2007 4:09 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function

At 16.06 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>They are non static variables. But I have declared both the objects 
>globally.

So they *are* static....

Alberto


>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 4:02 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>Hi Sasikumar,
>I cannot speak for the Xalan part, but I find suspicious that you are 
>deleting two variables theDOMSupportPtr and theLiaisonPtr that are not 
>part of the class definition. If they are static variables, you are 
>destroying something that you will need later.
>
>Alberto
>
>At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >Hi Alberto,
> >
> >Below is my class declaration,
> >
> >class XMResponseParser
> >{
> >     public:
> >        XMResponseParser();
> >        ~XMResponseParser();
> >
> >        void             validateMsgBuffer(char *);
> >        void             retrieveElementValue(const string
&expression,
> >string &returnVal);
> >        bool             isElementExist(const string &xPath);
> >        void             setResponseXML(const string &respMsg);
> >
> >     private:
> >
> >        SAXPrintHandlers         handler;
> >        SAXParser                parser;
> >        string                   response;
> >};
> >
> >In parser application, I am using  XalanSourceTreeDOMSupport and 
> >XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory 
> >in destructor. Below is the code,
> >
> >
> >XMResponseParser::~XMResponseParser()
> >{
> >     if ( theDOMSupportPtr != NULL ) {
> >         delete theDOMSupportPtr;
> >         theDOMSupportPtr = NULL;
> >     }
> >     if ( theLiaisonPtr != NULL ) {
> >         delete theLiaisonPtr;
> >         theLiaisonPtr = NULL;
> >     }
> >     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor );

> >}
> >
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 3:43 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >Hi Sasikumar,
> >you must be doing something wrong in the destructor; could you post 
> >the
>
> >code? Otherwise it's just a guessing game...
> >
> >Alberto
> >
> >At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> >
> > >As per Alberto's suggestion, I moved Initialize/Terminate of both 
> > >XMLPlatformUtils and XPathEvaluator to main function. But still I 
> > >am getting crash.
> > >
> > >And if didn't call destructor(i.e., without using delete) of my 
> > >class
>
> > >"XMResponseParser" which internally has SAXParser object, then it 
> > >is working fine. Without deleting the memory of the object, I am 
> > >creating new object for the next request.
> > >
> > >But above scenario will lead to memory leak. Kindly give me the 
> > >suggestion why it is happening as above?
> > >
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: sasikumar.kandhasamy@wipro.com 
> > >[mailto:sasikumar.kandhasamy@wipro.com]
> > >Sent: Wednesday, August 08, 2007 2:02 PM
> > >To: c-users@xerces.apache.org
> > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > >
> > >
> > >Hi Alberto,
> > >Thanks for the information. I will verify the system after moving 
> > >the
>
> > >Initialize/Terminate to main.
> > >
> > >And one more question is "I am creating SAXParse for every xml 
> > >response
> >
> > >and end of validation, I am deleting the memory. Is that correct 
> > >way of
> >
> > >doing it?"
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > >Sent: Wednesday, August 08, 2007 1:56 PM
> > >To: c-users@xerces.apache.org
> > >Subject: Re: Getting core dump at xerces::SAXParser::parse function
> > >
> > >As the crash in inside the memory manager, it could be that you 
> > >called Terminate and then Initialize while still keeping some 
> > >objects
>alive.
> > >Please move the Initialize/Terminate calls to the "main"
> > >function and call them just once.
> > >
> > >Alberto
> > >
> > >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > >
> > > >
> > > >Hi Team,
> > > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan 
> > > >for Xpath Exp in our application. At runtime, our application may

> > > >invokes
> >
> > > >SAXParser more than once depending on response xml we are getting

> > > >into system.
> > > >
> > > >I am getting the core dump from my application when it reaches 
> > > >SAXParse::parse function for the second time.
> > > >
> > > >I am using SAXParser as member to my class. I have used 
> > > >Initialize and Terminate functions as advised in apache site.
> > > >
> > > >Below is the back trace from core dump. Kindly help me on this
> > > >
> > > >
> > > >
> > > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#5  0xd6bc6bac in 
> > > >xercesc_2_7::DatatypeValidator::setTypeName+0xe4
> > > >()
> >
> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#6  0xd6bccb50 in
> > > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x
> > > >47
> > > >8
> > > >
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#7  0xd6c94478 in
> > > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#8  0xd6c85828 in
> > > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#9  0xd6ca16a4 in
> > > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#10 0xd6c90444 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#11 0xd6c848a8 in
> > > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#12 0xd6ca519c in
> > > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#13 0xd6c86d88 in
> > > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#14 0xd6ca26d0 in
> > > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#15 0xd6c90414 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#16 0xd6c9e550 in
> > > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#17 0xd6c7f034 in
> > > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#18 0xd6c7ebf4 in 
> > > >xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#19 0xd6c053e8 in
> > > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#20 0xd6c0472c in
> > > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 ()

> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer
> > > >(this=0x7788f155,
> > > >
> > > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J 
> > > >Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >
> >
> >
> >
> >The information contained in this electronic message and any 
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain proprietary, confidential or privileged 
> >information. If you are not the intended recipient, you should not 
> >disseminate, distribute or copy this e-mail. Please notify the sender

> >immediately and destroy all copies of this message and any
attachments.
> >
> >WARNING: Computer viruses can be transmitted via email. The recipient

> >should check this email and any attachments for the presence of 
> >viruses. The company accepts no liability for any damage caused by 
> >any virus transmitted by this email.
> >
> >www.wipro.com
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the 
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function

Posted by Alberto Massari <am...@datadirect.com>.
At 16.06 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>They are non static variables. But I have declared both the objects
>globally.

So they *are* static....

Alberto


>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 4:02 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>Hi Sasikumar,
>I cannot speak for the Xalan part, but I find suspicious that you are
>deleting two variables theDOMSupportPtr and theLiaisonPtr that are not
>part of the class definition. If they are static variables, you are
>destroying something that you will need later.
>
>Alberto
>
>At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >Hi Alberto,
> >
> >Below is my class declaration,
> >
> >class XMResponseParser
> >{
> >     public:
> >        XMResponseParser();
> >        ~XMResponseParser();
> >
> >        void             validateMsgBuffer(char *);
> >        void             retrieveElementValue(const string &expression,
> >string &returnVal);
> >        bool             isElementExist(const string &xPath);
> >        void             setResponseXML(const string &respMsg);
> >
> >     private:
> >
> >        SAXPrintHandlers         handler;
> >        SAXParser                parser;
> >        string                   response;
> >};
> >
> >In parser application, I am using  XalanSourceTreeDOMSupport and
> >XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory in
> >destructor. Below is the code,
> >
> >
> >XMResponseParser::~XMResponseParser()
> >{
> >     if ( theDOMSupportPtr != NULL ) {
> >         delete theDOMSupportPtr;
> >         theDOMSupportPtr = NULL;
> >     }
> >     if ( theLiaisonPtr != NULL ) {
> >         delete theLiaisonPtr;
> >         theLiaisonPtr = NULL;
> >     }
> >     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor ); }
> >
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 3:43 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >Hi Sasikumar,
> >you must be doing something wrong in the destructor; could you post the
>
> >code? Otherwise it's just a guessing game...
> >
> >Alberto
> >
> >At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> >
> > >As per Alberto's suggestion, I moved Initialize/Terminate of both
> > >XMLPlatformUtils and XPathEvaluator to main function. But still I am
> > >getting crash.
> > >
> > >And if didn't call destructor(i.e., without using delete) of my class
>
> > >"XMResponseParser" which internally has SAXParser object, then it is
> > >working fine. Without deleting the memory of the object, I am
> > >creating new object for the next request.
> > >
> > >But above scenario will lead to memory leak. Kindly give me the
> > >suggestion why it is happening as above?
> > >
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: sasikumar.kandhasamy@wipro.com
> > >[mailto:sasikumar.kandhasamy@wipro.com]
> > >Sent: Wednesday, August 08, 2007 2:02 PM
> > >To: c-users@xerces.apache.org
> > >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> > >
> > >
> > >Hi Alberto,
> > >Thanks for the information. I will verify the system after moving the
>
> > >Initialize/Terminate to main.
> > >
> > >And one more question is "I am creating SAXParse for every xml
> > >response
> >
> > >and end of validation, I am deleting the memory. Is that correct way
> > >of
> >
> > >doing it?"
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> > >Kalam
> > >
> > >
> > >-----Original Message-----
> > >From: Alberto Massari [mailto:amassari@datadirect.com]
> > >Sent: Wednesday, August 08, 2007 1:56 PM
> > >To: c-users@xerces.apache.org
> > >Subject: Re: Getting core dump at xerces::SAXParser::parse function
> > >
> > >As the crash in inside the memory manager, it could be that you
> > >called Terminate and then Initialize while still keeping some objects
>alive.
> > >Please move the Initialize/Terminate calls to the "main"
> > >function and call them just once.
> > >
> > >Alberto
> > >
> > >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> > >
> > > >
> > > >Hi Team,
> > > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan for
> > > >Xpath Exp in our application. At runtime, our application may
> > > >invokes
> >
> > > >SAXParser more than once depending on response xml we are getting
> > > >into system.
> > > >
> > > >I am getting the core dump from my application when it reaches
> > > >SAXParse::parse function for the second time.
> > > >
> > > >I am using SAXParser as member to my class. I have used Initialize
> > > >and Terminate functions as advised in apache site.
> > > >
> > > >Below is the back trace from core dump. Kindly help me on this
> > > >
> > > >
> > > >
> > > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 ()
> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4
> > > >()
> >
> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#6  0xd6bccb50 in
> > > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x47
> > > >8
> > > >
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#7  0xd6c94478 in
> > > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#8  0xd6c85828 in
> > > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#9  0xd6ca16a4 in
> > > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#10 0xd6c90444 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#11 0xd6c848a8 in
> > > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#12 0xd6ca519c in
> > > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#13 0xd6c86d88 in
> > > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#14 0xd6ca26d0 in
> > > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#15 0xd6c90414 in
> > > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#16 0xd6c9e550 in
> > > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#17 0xd6c7f034 in
> > > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
> >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#19 0xd6c053e8 in
> > > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#20 0xd6c0472c in
> > > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > > >()
> > > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c
> > > >() from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 ()
> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 ()
> > > >from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > > >
> > > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer
> > > >(this=0x7788f155,
> > > >
> > > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > > >
> > > >Thanks & Regards,
> > > >Sasikumar Kandhasamy
> > > >
> > > >Mobile:- +91 9986378586
> > > >
> > > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>
> > > >Kalam
> > > >
> > > >
> > > >
> >
> >
> >
> >The information contained in this electronic message and any
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain proprietary, confidential or privileged
> >information. If you are not the intended recipient, you should not
> >disseminate, distribute or copy this e-mail. Please notify the sender
> >immediately and destroy all copies of this message and any attachments.
> >
> >WARNING: Computer viruses can be transmitted via email. The recipient
> >should check this email and any attachments for the presence of
> >viruses. The company accepts no liability for any damage caused by any
> >virus transmitted by this email.
> >
> >www.wipro.com
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of 
>the addressee(s) and may contain proprietary, confidential or 
>privileged information. If you are not the intended recipient, you 
>should not disseminate, distribute or copy this e-mail. Please 
>notify the sender immediately and destroy all copies of this message 
>and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The 
>recipient should check this email and any attachments for the 
>presence of viruses. The company accepts no liability for any damage 
>caused by any virus transmitted by this email.
>
>www.wipro.com


RE: Getting core dump at xerces::SAXParser::parse function

Posted by sa...@wipro.com.
They are non static variables. But I have declared both the objects
globally.  


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Wednesday, August 08, 2007 4:02 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function

Hi Sasikumar,
I cannot speak for the Xalan part, but I find suspicious that you are
deleting two variables theDOMSupportPtr and theLiaisonPtr that are not
part of the class definition. If they are static variables, you are
destroying something that you will need later.

Alberto

At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>Hi Alberto,
>
>Below is my class declaration,
>
>class XMResponseParser
>{
>     public:
>        XMResponseParser();
>        ~XMResponseParser();
>
>        void             validateMsgBuffer(char *);
>        void             retrieveElementValue(const string &expression,
>string &returnVal);
>        bool             isElementExist(const string &xPath);
>        void             setResponseXML(const string &respMsg);
>
>     private:
>
>        SAXPrintHandlers         handler;
>        SAXParser                parser;
>        string                   response;
>};
>
>In parser application, I am using  XalanSourceTreeDOMSupport and 
>XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory in 
>destructor. Below is the code,
>
>
>XMResponseParser::~XMResponseParser()
>{
>     if ( theDOMSupportPtr != NULL ) {
>         delete theDOMSupportPtr;
>         theDOMSupportPtr = NULL;
>     }
>     if ( theLiaisonPtr != NULL ) {
>         delete theLiaisonPtr;
>         theLiaisonPtr = NULL;
>     }
>     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor ); }
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 3:43 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>Hi Sasikumar,
>you must be doing something wrong in the destructor; could you post the

>code? Otherwise it's just a guessing game...
>
>Alberto
>
>At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
>
> >As per Alberto's suggestion, I moved Initialize/Terminate of both 
> >XMLPlatformUtils and XPathEvaluator to main function. But still I am 
> >getting crash.
> >
> >And if didn't call destructor(i.e., without using delete) of my class

> >"XMResponseParser" which internally has SAXParser object, then it is 
> >working fine. Without deleting the memory of the object, I am 
> >creating new object for the next request.
> >
> >But above scenario will lead to memory leak. Kindly give me the 
> >suggestion why it is happening as above?
> >
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >-----Original Message-----
> >From: sasikumar.kandhasamy@wipro.com
> >[mailto:sasikumar.kandhasamy@wipro.com]
> >Sent: Wednesday, August 08, 2007 2:02 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >
> >Hi Alberto,
> >Thanks for the information. I will verify the system after moving the

> >Initialize/Terminate to main.
> >
> >And one more question is "I am creating SAXParse for every xml 
> >response
>
> >and end of validation, I am deleting the memory. Is that correct way 
> >of
>
> >doing it?"
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 1:56 PM
> >To: c-users@xerces.apache.org
> >Subject: Re: Getting core dump at xerces::SAXParser::parse function
> >
> >As the crash in inside the memory manager, it could be that you 
> >called Terminate and then Initialize while still keeping some objects
alive.
> >Please move the Initialize/Terminate calls to the "main"
> >function and call them just once.
> >
> >Alberto
> >
> >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> > >
> > >Hi Team,
> > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan for 
> > >Xpath Exp in our application. At runtime, our application may 
> > >invokes
>
> > >SAXParser more than once depending on response xml we are getting 
> > >into system.
> > >
> > >I am getting the core dump from my application when it reaches 
> > >SAXParse::parse function for the second time.
> > >
> > >I am using SAXParser as member to my class. I have used Initialize 
> > >and Terminate functions as advised in apache site.
> > >
> > >Below is the back trace from core dump. Kindly help me on this
> > >
> > >
> > >
> > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 () 
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 
> > >()
>
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#6  0xd6bccb50 in
> > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x47
> > >8
> > >
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#7  0xd6c94478 in
> > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#8  0xd6c85828 in
> > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#9  0xd6ca16a4 in
> > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#10 0xd6c90444 in
> > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#11 0xd6c848a8 in
> > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#12 0xd6ca519c in
> > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#13 0xd6c86d88 in
> > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#14 0xd6ca26d0 in
> > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#15 0xd6c90414 in
> > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#16 0xd6c9e550 in 
> > >xercesc_2_7::TraverseSchema::processChildren+0xcd8
>()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#17 0xd6c7f034 in 
> > >xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
>()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > >() from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#19 0xd6c053e8 in
> > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#20 0xd6c0472c in
> > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c 
> > >() from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 () 
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 () 
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer 
> > >(this=0x7788f155,
> > >
> > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul

> > >Kalam
> > >
> > >
> > >
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the 
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function

Posted by Alberto Massari <am...@datadirect.com>.
Hi Sasikumar,
I cannot speak for the Xalan part, but I find suspicious that you are 
deleting two variables theDOMSupportPtr and theLiaisonPtr that are 
not part of the class definition. If they are static variables, you 
are destroying something that you will need later.

Alberto

At 15.51 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>Hi Alberto,
>
>Below is my class declaration,
>
>class XMResponseParser
>{
>     public:
>        XMResponseParser();
>        ~XMResponseParser();
>
>        void             validateMsgBuffer(char *);
>        void             retrieveElementValue(const string &expression,
>string &returnVal);
>        bool             isElementExist(const string &xPath);
>        void             setResponseXML(const string &respMsg);
>
>     private:
>
>        SAXPrintHandlers         handler;
>        SAXParser                parser;
>        string                   response;
>};
>
>In parser application, I am using  XalanSourceTreeDOMSupport and
>XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory in
>destructor. Below is the code,
>
>
>XMResponseParser::~XMResponseParser()
>{
>     if ( theDOMSupportPtr != NULL ) {
>         delete theDOMSupportPtr;
>         theDOMSupportPtr = NULL;
>     }
>     if ( theLiaisonPtr != NULL ) {
>         delete theLiaisonPtr;
>         theLiaisonPtr = NULL;
>     }
>     ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor );
>}
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 3:43 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>Hi Sasikumar,
>you must be doing something wrong in the destructor; could you post the
>code? Otherwise it's just a guessing game...
>
>Alberto
>
>At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
>
> >As per Alberto's suggestion, I moved Initialize/Terminate of both
> >XMLPlatformUtils and XPathEvaluator to main function. But still I am
> >getting crash.
> >
> >And if didn't call destructor(i.e., without using delete) of my class
> >"XMResponseParser" which internally has SAXParser object, then it is
> >working fine. Without deleting the memory of the object, I am creating
> >new object for the next request.
> >
> >But above scenario will lead to memory leak. Kindly give me the
> >suggestion why it is happening as above?
> >
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> >Kalam
> >
> >
> >-----Original Message-----
> >From: sasikumar.kandhasamy@wipro.com
> >[mailto:sasikumar.kandhasamy@wipro.com]
> >Sent: Wednesday, August 08, 2007 2:02 PM
> >To: c-users@xerces.apache.org
> >Subject: RE: Getting core dump at xerces::SAXParser::parse function
> >
> >
> >Hi Alberto,
> >Thanks for the information. I will verify the system after moving the
> >Initialize/Terminate to main.
> >
> >And one more question is "I am creating SAXParse for every xml response
>
> >and end of validation, I am deleting the memory. Is that correct way of
>
> >doing it?"
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> >Kalam
> >
> >
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@datadirect.com]
> >Sent: Wednesday, August 08, 2007 1:56 PM
> >To: c-users@xerces.apache.org
> >Subject: Re: Getting core dump at xerces::SAXParser::parse function
> >
> >As the crash in inside the memory manager, it could be that you called
> >Terminate and then Initialize while still keeping some objects alive.
> >Please move the Initialize/Terminate calls to the "main"
> >function and call them just once.
> >
> >Alberto
> >
> >At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
> >
> > >
> > >Hi Team,
> > >I am using xerces-c_2_7 SAXParser for validating XML and Xalan for
> > >Xpath Exp in our application. At runtime, our application may invokes
>
> > >SAXParser more than once depending on response xml we are getting
> > >into system.
> > >
> > >I am getting the core dump from my application when it reaches
> > >SAXParse::parse function for the second time.
> > >
> > >I am using SAXParser as member to my class. I have used Initialize
> > >and Terminate functions as advised in apache site.
> > >
> > >Below is the back trace from core dump. Kindly help me on this
> > >
> > >
> > >
> > >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> > >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> > >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> > >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> > >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 ()
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 ()
>
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#6  0xd6bccb50 in
> > >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x478
> > >
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#7  0xd6c94478 in
> > >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#8  0xd6c85828 in
> > >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#9  0xd6ca16a4 in
> > >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#10 0xd6c90444 in
> > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#11 0xd6c848a8 in
> > >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#12 0xd6ca519c in
> > >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#13 0xd6c86d88 in
> > >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#14 0xd6ca26d0 in
> > >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#15 0xd6c90414 in
> > >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#16 0xd6c9e550 in xercesc_2_7::TraverseSchema::processChildren+0xcd8
>()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#17 0xd6c7f034 in xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
>()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390
> > >() from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#19 0xd6c053e8 in
> > >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#20 0xd6c0472c in
> > >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> > >()
> > >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c ()
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 ()
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 ()
> > >from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> > >
> > >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> > >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer (this=0x7788f155,
> > >
> > >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> > >
> > >Thanks & Regards,
> > >Sasikumar Kandhasamy
> > >
> > >Mobile:- +91 9986378586
> > >
> > >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> > >Kalam
> > >
> > >
> > >
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of 
>the addressee(s) and may contain proprietary, confidential or 
>privileged information. If you are not the intended recipient, you 
>should not disseminate, distribute or copy this e-mail. Please 
>notify the sender immediately and destroy all copies of this message 
>and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The 
>recipient should check this email and any attachments for the 
>presence of viruses. The company accepts no liability for any damage 
>caused by any virus transmitted by this email.
>
>www.wipro.com


RE: Getting core dump at xerces::SAXParser::parse function

Posted by sa...@wipro.com.
Hi Alberto,

Below is my class declaration,

class XMResponseParser
{
    public:
       XMResponseParser();
       ~XMResponseParser();

       void             validateMsgBuffer(char *);
       void             retrieveElementValue(const string &expression,
string &returnVal);
       bool             isElementExist(const string &xPath);
       void             setResponseXML(const string &respMsg);

    private:

       SAXPrintHandlers         handler;
       SAXParser                parser;
       string                   response;
};

In parser application, I am using  XalanSourceTreeDOMSupport and
XalanSourceTreeParserLiaison for Xpath. So I am deleting the memory in
destructor. Below is the code,


XMResponseParser::~XMResponseParser()
{
    if ( theDOMSupportPtr != NULL ) {
        delete theDOMSupportPtr;
        theDOMSupportPtr = NULL;
    }
    if ( theLiaisonPtr != NULL ) {
        delete theLiaisonPtr;
        theLiaisonPtr = NULL;
    }
    ItsuDebugEnter( XMResponseParser, XMResponseParser-Destructor );
} 


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Wednesday, August 08, 2007 3:43 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function

Hi Sasikumar,
you must be doing something wrong in the destructor; could you post the
code? Otherwise it's just a guessing game...

Alberto

At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:


>As per Alberto's suggestion, I moved Initialize/Terminate of both 
>XMLPlatformUtils and XPathEvaluator to main function. But still I am 
>getting crash.
>
>And if didn't call destructor(i.e., without using delete) of my class 
>"XMResponseParser" which internally has SAXParser object, then it is 
>working fine. Without deleting the memory of the object, I am creating 
>new object for the next request.
>
>But above scenario will lead to memory leak. Kindly give me the 
>suggestion why it is happening as above?
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: sasikumar.kandhasamy@wipro.com
>[mailto:sasikumar.kandhasamy@wipro.com]
>Sent: Wednesday, August 08, 2007 2:02 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>
>Hi Alberto,
>Thanks for the information. I will verify the system after moving the 
>Initialize/Terminate to main.
>
>And one more question is "I am creating SAXParse for every xml response

>and end of validation, I am deleting the memory. Is that correct way of

>doing it?"
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 1:56 PM
>To: c-users@xerces.apache.org
>Subject: Re: Getting core dump at xerces::SAXParser::parse function
>
>As the crash in inside the memory manager, it could be that you called 
>Terminate and then Initialize while still keeping some objects alive.
>Please move the Initialize/Terminate calls to the "main"
>function and call them just once.
>
>Alberto
>
>At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >
> >Hi Team,
> >I am using xerces-c_2_7 SAXParser for validating XML and Xalan for 
> >Xpath Exp in our application. At runtime, our application may invokes

> >SAXParser more than once depending on response xml we are getting 
> >into system.
> >
> >I am getting the core dump from my application when it reaches 
> >SAXParse::parse function for the second time.
> >
> >I am using SAXParser as member to my class. I have used Initialize 
> >and Terminate functions as advised in apache site.
> >
> >Below is the back trace from core dump. Kindly help me on this
> >
> >
> >
> >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 () 
> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 ()

> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#6  0xd6bccb50 in
> >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x478
> >
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#7  0xd6c94478 in
> >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#8  0xd6c85828 in
> >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#9  0xd6ca16a4 in
> >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#10 0xd6c90444 in
> >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#11 0xd6c848a8 in
> >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#12 0xd6ca519c in
> >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#13 0xd6c86d88 in
> >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#14 0xd6ca26d0 in
> >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#15 0xd6c90414 in
> >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#16 0xd6c9e550 in xercesc_2_7::TraverseSchema::processChildren+0xcd8
()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#17 0xd6c7f034 in xercesc_2_7::TraverseSchema::doTraverseSchema+0x24
()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390 
> >() from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#19 0xd6c053e8 in 
> >xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#20 0xd6c0472c in 
> >xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c () 
> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 () 
> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 () 
> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer (this=0x7788f155,
> >
> >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
> >Kalam
> >
> >
> >



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function

Posted by Alberto Massari <am...@datadirect.com>.
Hi Sasikumar,
you must be doing something wrong in the destructor; could you post 
the code? Otherwise it's just a guessing game...

Alberto

At 15.07 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:


>As per Alberto's suggestion, I moved Initialize/Terminate of both
>XMLPlatformUtils and XPathEvaluator to main function. But still I am
>getting crash.
>
>And if didn't call destructor(i.e., without using delete) of my class
>"XMResponseParser" which internally has SAXParser object, then it is
>working fine. Without deleting the memory of the object, I am creating
>new object for the next request.
>
>But above scenario will lead to memory leak. Kindly give me the
>suggestion why it is happening as above?
>
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>-----Original Message-----
>From: sasikumar.kandhasamy@wipro.com
>[mailto:sasikumar.kandhasamy@wipro.com]
>Sent: Wednesday, August 08, 2007 2:02 PM
>To: c-users@xerces.apache.org
>Subject: RE: Getting core dump at xerces::SAXParser::parse function
>
>
>Hi Alberto,
>Thanks for the information. I will verify the system after moving the
>Initialize/Terminate to main.
>
>And one more question is "I am creating SAXParse for every xml response
>and end of validation, I am deleting the memory. Is that correct way of
>doing it?"
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>-----Original Message-----
>From: Alberto Massari [mailto:amassari@datadirect.com]
>Sent: Wednesday, August 08, 2007 1:56 PM
>To: c-users@xerces.apache.org
>Subject: Re: Getting core dump at xerces::SAXParser::parse function
>
>As the crash in inside the memory manager, it could be that you called
>Terminate and then Initialize while still keeping some objects alive.
>Please move the Initialize/Terminate calls to the "main"
>function and call them just once.
>
>Alberto
>
>At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:
>
> >
> >Hi Team,
> >I am using xerces-c_2_7 SAXParser for validating XML and Xalan for
> >Xpath Exp in our application. At runtime, our application may invokes
> >SAXParser more than once depending on response xml we are getting into
> >system.
> >
> >I am getting the core dump from my application when it reaches
> >SAXParse::parse function for the second time.
> >
> >I am using SAXParser as member to my class. I have used Initialize and
> >Terminate functions as advised in apache site.
> >
> >Below is the back trace from core dump. Kindly help me on this
> >
> >
> >
> >0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
> >#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
> >#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
> >#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
> >#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 () from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 ()
> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#6  0xd6bccb50 in
> >xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x478
> >
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#7  0xd6c94478 in
> >xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#8  0xd6c85828 in
> >xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#9  0xd6ca16a4 in
> >xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#10 0xd6c90444 in
> >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#11 0xd6c848a8 in
> >xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#12 0xd6ca519c in
> >xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#13 0xd6c86d88 in
> >xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#14 0xd6ca26d0 in
> >xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#15 0xd6c90414 in
> >xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#16 0xd6c9e550 in xercesc_2_7::TraverseSchema::processChildren+0xcd8 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#17 0xd6c7f034 in xercesc_2_7::TraverseSchema::doTraverseSchema+0x24 ()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390 ()
> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#19 0xd6c053e8 in xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#20 0xd6c0472c in xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
> >()
> >    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c ()
> >from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 () from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 () from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
> >
> >/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
> >#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer (this=0x7788f155,
> >
> >schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
> >
> >Thanks & Regards,
> >Sasikumar Kandhasamy
> >
> >Mobile:- +91 9986378586
> >
> >"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
> >Kalam
> >
> >
> >


RE: Getting core dump at xerces::SAXParser::parse function

Posted by sa...@wipro.com.

As per Alberto's suggestion, I moved Initialize/Terminate of both
XMLPlatformUtils and XPathEvaluator to main function. But still I am
getting crash.

And if didn't call destructor(i.e., without using delete) of my class
"XMResponseParser" which internally has SAXParser object, then it is
working fine. Without deleting the memory of the object, I am creating
new object for the next request.

But above scenario will lead to memory leak. Kindly give me the
suggestion why it is happening as above? 


Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: sasikumar.kandhasamy@wipro.com
[mailto:sasikumar.kandhasamy@wipro.com] 
Sent: Wednesday, August 08, 2007 2:02 PM
To: c-users@xerces.apache.org
Subject: RE: Getting core dump at xerces::SAXParser::parse function


Hi Alberto,
Thanks for the information. I will verify the system after moving the
Initialize/Terminate to main. 

And one more question is "I am creating SAXParse for every xml response
and end of validation, I am deleting the memory. Is that correct way of
doing it?"

Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com]
Sent: Wednesday, August 08, 2007 1:56 PM
To: c-users@xerces.apache.org
Subject: Re: Getting core dump at xerces::SAXParser::parse function

As the crash in inside the memory manager, it could be that you called
Terminate and then Initialize while still keeping some objects alive.
Please move the Initialize/Terminate calls to the "main" 
function and call them just once.

Alberto

At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>
>Hi Team,
>I am using xerces-c_2_7 SAXParser for validating XML and Xalan for 
>Xpath Exp in our application. At runtime, our application may invokes 
>SAXParser more than once depending on response xml we are getting into 
>system.
>
>I am getting the core dump from my application when it reaches 
>SAXParse::parse function for the second time.
>
>I am using SAXParser as member to my class. I have used Initialize and 
>Terminate functions as advised in apache site.
>
>Below is the back trace from core dump. Kindly help me on this
>
>
>
>0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
>#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
>#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
>#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
>#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 () 
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#6  0xd6bccb50 in
>xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x478
>
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#7  0xd6c94478 in
>xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#8  0xd6c85828 in
>xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#9  0xd6ca16a4 in
>xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#10 0xd6c90444 in
>xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#11 0xd6c848a8 in
>xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#12 0xd6ca519c in
>xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#13 0xd6c86d88 in
>xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#14 0xd6ca26d0 in
>xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#15 0xd6c90414 in
>xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#16 0xd6c9e550 in xercesc_2_7::TraverseSchema::processChildren+0xcd8 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#17 0xd6c7f034 in xercesc_2_7::TraverseSchema::doTraverseSchema+0x24 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390 () 
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#19 0xd6c053e8 in xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#20 0xd6c0472c in xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c () 
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer (this=0x7788f155,
>
>schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
 
www.wipro.com


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Getting core dump at xerces::SAXParser::parse function

Posted by sa...@wipro.com.
Hi Alberto,
Thanks for the information. I will verify the system after moving the
Initialize/Terminate to main. 

And one more question is "I am creating SAXParse for every xml response
and end of validation, I am deleting the memory. Is that correct way of
doing it?"

Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer | Wipro Technologies | Madivala-4 | Bangalore.
Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Wednesday, August 08, 2007 1:56 PM
To: c-users@xerces.apache.org
Subject: Re: Getting core dump at xerces::SAXParser::parse function

As the crash in inside the memory manager, it could be that you called
Terminate and then Initialize while still keeping some objects alive.
Please move the Initialize/Terminate calls to the "main" 
function and call them just once.

Alberto

At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>
>Hi Team,
>I am using xerces-c_2_7 SAXParser for validating XML and Xalan for 
>Xpath Exp in our application. At runtime, our application may invokes 
>SAXParser more than once depending on response xml we are getting into 
>system.
>
>I am getting the core dump from my application when it reaches 
>SAXParse::parse function for the second time.
>
>I am using SAXParser as member to my class. I have used Initialize and 
>Terminate functions as advised in apache site.
>
>Below is the back trace from core dump. Kindly help me on this
>
>
>
>0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
>#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
>#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
>#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
>#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 () 
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#6  0xd6bccb50 in
>xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x478
>
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#7  0xd6c94478 in
>xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#8  0xd6c85828 in
>xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#9  0xd6ca16a4 in
>xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#10 0xd6c90444 in 
>xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#11 0xd6c848a8 in
>xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#12 0xd6ca519c in
>xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#13 0xd6c86d88 in
>xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#14 0xd6ca26d0 in
>xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#15 0xd6c90414 in 
>xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#16 0xd6c9e550 in xercesc_2_7::TraverseSchema::processChildren+0xcd8 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#17 0xd6c7f034 in xercesc_2_7::TraverseSchema::doTraverseSchema+0x24 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390 () 
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#19 0xd6c053e8 in xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#20 0xd6c0472c in xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c () 
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer (this=0x7788f155,
>
>schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul 
>Kalam
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of the 
>addressee(s) and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, you should not 
>disseminate, distribute or copy this e-mail. Please notify the sender 
>immediately and destroy all copies of this message and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The recipient 
>should check this email and any attachments for the presence of 
>viruses. The company accepts no liability for any damage caused by any 
>virus transmitted by this email.
>
>www.wipro.com



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

Re: Getting core dump at xerces::SAXParser::parse function

Posted by Alberto Massari <am...@datadirect.com>.
As the crash in inside the memory manager, it could be that you 
called Terminate and then Initialize while still keeping some objects 
alive. Please move the Initialize/Terminate calls to the "main" 
function and call them just once.

Alberto

At 13.46 08/08/2007 +0530, sasikumar.kandhasamy@wipro.com wrote:

>
>Hi Team,
>I am using xerces-c_2_7 SAXParser for validating XML and Xalan for Xpath
>Exp in our application. At runtime, our application may invokes
>SAXParser more than once depending on response xml we are getting into
>system.
>
>I am getting the core dump from my application when it reaches
>SAXParse::parse function for the second time.
>
>I am using SAXParser as member to my class. I have used Initialize and
>Terminate functions as advised in apache site.
>
>Below is the back trace from core dump. Kindly help me on this
>
>
>
>0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
>#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
>#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
>#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
>#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 ()
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#6  0xd6bccb50 in
>xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x478
>
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#7  0xd6c94478 in
>xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#8  0xd6c85828 in
>xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#9  0xd6ca16a4 in
>xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#10 0xd6c90444 in xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#11 0xd6c848a8 in
>xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#12 0xd6ca519c in
>xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#13 0xd6c86d88 in
>xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#14 0xd6ca26d0 in
>xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#15 0xd6c90414 in xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#16 0xd6c9e550 in xercesc_2_7::TraverseSchema::processChildren+0xcd8 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#17 0xd6c7f034 in xercesc_2_7::TraverseSchema::doTraverseSchema+0x24 ()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390 ()
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#19 0xd6c053e8 in xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#20 0xd6c0472c in xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
>()
>    from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c ()
>from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from
>
>/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
>#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer (this=0x7788f155,
>
>schemaLoc=0x7788af14 "") at XMResponseParser.cc:119
>
>Thanks & Regards,
>Sasikumar Kandhasamy
>
>Mobile:- +91 9986378586
>
>"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
>Kalam
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use of 
>the addressee(s) and may contain proprietary, confidential or 
>privileged information. If you are not the intended recipient, you 
>should not disseminate, distribute or copy this e-mail. Please 
>notify the sender immediately and destroy all copies of this message 
>and any attachments.
>
>WARNING: Computer viruses can be transmitted via email. The 
>recipient should check this email and any attachments for the 
>presence of viruses. The company accepts no liability for any damage 
>caused by any virus transmitted by this email.
>
>www.wipro.com


Getting core dump at xerces::SAXParser::parse function

Posted by sa...@wipro.com.
 
Hi Team,
I am using xerces-c_2_7 SAXParser for validating XML and Xalan for Xpath
Exp in our application. At runtime, our application may invokes
SAXParser more than once depending on response xml we are getting into
system.
 
I am getting the core dump from my application when it reaches
SAXParse::parse function for the second time. 
 
I am using SAXParser as member to my class. I have used Initialize and
Terminate functions as advised in apache site.
 
Below is the back trace from core dump. Kindly help me on this
 
 

0xc0198170 in _sigfillset+0x5c0 () from /usr/lib/libc.2
#1  0xc0195c9c in _sscanf+0x68c () from /usr/lib/libc.2
#2  0xc019b374 in malloc+0x18c () from /usr/lib/libc.2
#3  0xc0ca5fdc in operator new+0x40 () from /usr/lib/libCsup.2
#4  0xd6c12214 in xercesc_2_7::MemoryManagerImpl::allocate+0x34 () from 
 
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#5  0xd6bc6bac in xercesc_2_7::DatatypeValidator::setTypeName+0xe4 ()
from 
 
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#6  0xd6bccb50 in
xercesc_2_7::DatatypeValidatorFactory::createDatatypeValidator+0x478 
 
()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#7  0xd6c94478 in
xercesc_2_7::TraverseSchema::traverseByRestriction+0x1c60 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#8  0xd6c85828 in
xercesc_2_7::TraverseSchema::traverseSimpleTypeDecl+0x888 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#9  0xd6ca16a4 in
xercesc_2_7::TraverseSchema::getElementTypeValidator+0x164 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#10 0xd6c90444 in xercesc_2_7::TraverseSchema::traverseElementDecl+0xf34
()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#11 0xd6c848a8 in
xercesc_2_7::TraverseSchema::traverseChoiceSequence+0x208 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#12 0xd6ca519c in
xercesc_2_7::TraverseSchema::processComplexContent+0x2ec ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#13 0xd6c86d88 in
xercesc_2_7::TraverseSchema::traverseComplexTypeDecl+0x1250 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#14 0xd6ca26d0 in
xercesc_2_7::TraverseSchema::getElementComplexTypeInfo+0x810 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#15 0xd6c90414 in xercesc_2_7::TraverseSchema::traverseElementDecl+0xf04
()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#16 0xd6c9e550 in xercesc_2_7::TraverseSchema::processChildren+0xcd8 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#17 0xd6c7f034 in xercesc_2_7::TraverseSchema::doTraverseSchema+0x24 ()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#18 0xd6c7ebf4 in xercesc_2_7::TraverseSchema::TraverseSchema+0x390 ()
from 
 
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#19 0xd6c053e8 in xercesc_2_7::IGXMLScanner::resolveSchemaGrammar+0x988
()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#20 0xd6c0472c in xercesc_2_7::IGXMLScanner::parseSchemaLocation+0x12c
()
   from /intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#21 0xd6bfc0fc in xercesc_2_7::IGXMLScanner::scanStartTagNS+0x35c ()
from 
 
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#22 0xd6bf8248 in xercesc_2_7::IGXMLScanner::scanContent+0x1b8 () from 
 
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#23 0xd6bf5588 in xercesc_2_7::IGXMLScanner::scanDocument+0x100 () from 
 
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#24 0xd6c52454 in xercesc_2_7::SAXParser::parse+0x17c () from 
 
/intasDEV/intas/Xerces/2.7/lib/libxerces-c.sl.27
#25 0x5bd7a0 in XMResponseParser::validateMsgBuffer (this=0x7788f155, 
 
schemaLoc=0x7788af14 "") at XMResponseParser.cc:119

Thanks & Regards,
Sasikumar Kandhasamy

Mobile:- +91 9986378586 

"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com