You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Alberto Massari <am...@datadirect.com> on 2005/03/06 18:50:01 UTC

Re: [jira] Resolved: (XERCESC-1362) memory leak in reading XMLURL

Hi Jesse,
to get the fix you need to download version 1.19 of 
util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp 
(http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-xerces/c/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp?rev=1.19). 
The fix is only in the current HEAD tag of CVS, and Xerces 2.6 has the same 
problem.
If you need to apply the patch to your copy of Xerces 2.5 you will have to 
manually extract the 4-5 lines I added and place them in the corresponding 
place of version 1.16 of the same file.

Alberto


At 12.35 04/03/2005 -0800, jesse wrote:
>Alberto:
>
>    sorry to bother you. you said it was fixed in CVS.
>could you please let me know which file was updated?
>so i don't need to pull the whole CVS to rebuild the
>library.
>
>   BTW, i just want to confim the fix is not in 2.6
>release yet. correct?
>
>  thanks in advance! have a nice day.
>
>jesse
>
>
>--- "Alberto Massari (JIRA)"
><xe...@xml.apache.org> wrote:
> >      [
> >
>http://issues.apache.org/jira/browse/XERCESC-1362?page=history
> > ]
> >
> > Alberto Massari resolved XERCESC-1362:
> > --------------------------------------
> >
> >     Resolution: Fixed
> >
> > Fix is in CVS. Please verify.
> >
> > Alberto
> >
> > > memory leak in reading XMLURL
> > > -----------------------------
> > >
> > >          Key: XERCESC-1362
> > >          URL:
> > http://issues.apache.org/jira/browse/XERCESC-1362
> > >      Project: Xerces-C++
> > >         Type: Bug
> > >   Components: Utilities
> > >     Versions: 2.5.0, 2.6.0
> > >  Environment: redhat linux AS3.0,
> > > bash-2.05b$ uname -a
> > > Linux 2.4.21-15 #1 Wed May 12 13:47:22 EDT 2004
> > i686 i686 i386 GNU/Linux
> > >     Reporter: jesse
> > >     Assignee: Alberto Massari
> >
> > >
> > > #include <stdio.h>
> > > #include <string>
> > > #include <iostream>
> > > #include <xercesc/util/PlatformUtils.hpp>
> > > #include <xercesc/parsers/AbstractDOMParser.hpp>
> > > #include <xercesc/dom/DOMImplementation.hpp>
> > > #include <xercesc/dom/DOMImplementationLS.hpp>
> > > #include
> > <xercesc/dom/DOMImplementationRegistry.hpp>
> > > #include <xercesc/dom/DOMBuilder.hpp>
> > > #include <xercesc/dom/DOMException.hpp>
> > > #include <xercesc/dom/DOMDocument.hpp>
> > > #include <xercesc/dom/DOMNodeList.hpp>
> > > #include <xercesc/dom/DOMError.hpp>
> > > #include <xercesc/dom/DOMLocator.hpp>
> > > #include <xercesc/dom/DOMNamedNodeMap.hpp>
> > > #include <xercesc/dom/DOMAttr.hpp>
> > > #include <xercesc/framework/MemBufInputSource.hpp>
> > > #ifdef XERCES_CPP_NAMESPACE_USE
> > > XERCES_CPP_NAMESPACE_USE
> > > #endif
> > > int read_url(std::string const & url_str){
> > >     int rc = 0;
> > >     xercesc::XercesDOMParser * parser;
> > >     xercesc::DOMDocument *m_pDoc;
> > >     bool   bRecognizeNEL;
> > >     xercesc::AbstractDOMParser::ValSchemes
> > valScheme;
> > >     bool   bDoNamespaces;
> > >     bool   bDoSchema;
> > >     bool   bSchemaFullChecking;
> > >     bool   bDatatypeNormalization;
> > >     bool   bCreateEntityReferenceNodes;
> > >     bRecognizeNEL = false;
> > >         valScheme = AbstractDOMParser::Val_Auto;
> > >         bDoNamespaces = false;
> > >         bDoSchema = false;
> > >         bSchemaFullChecking = false;
> > >         bCreateEntityReferenceNodes    = false;
> > >         bDatatypeNormalization = true;
> > >     // Initialize the XML4C system
> > >     try{
> > >           XMLPlatformUtils::Initialize();
> > >         if (bRecognizeNEL)
> > >
> > XMLPlatformUtils::recognizeNEL(bRecognizeNEL);
> >
> > >     }
> > >     catch (const XMLException& toCatch){}
> > >     parser = new XercesDOMParser();
> > >     parser->setValidationScheme(valScheme);
> > >     parser->setDoNamespaces(bDoNamespaces);
> > >     parser->setDoSchema(bDoSchema);
> > >
> >
>parser->setValidationSchemaFullChecking(bSchemaFullChecking);
> > >
> >
>parser->setCreateEntityReferenceNodes(bCreateEntityReferenceNodes);
> > >
> > >     try{
> > >         XMLURL url(url_str.c_str());
> > >         URLInputSource src(url);
> > >         // reset document pool
> > >         parser->resetDocumentPool();
> > >         parser->parse(src);
> > >         m_pDoc = parser->getDocument();
> > >
> > >     }catch(...){
> > >         rc =   -1;
> > >     }
> > >
> > >     if(parser)delete parser;
> > >     // And call the termination method
> > >     XMLPlatformUtils::Terminate();
> > >     return rc;
> > > }
> > > int main(){
> > >    while(1){
> > >       read_url("http://127.0.0.1/abcd/op1.xml");
> > >       sleep(2);
> > >    }
> > >    return 0;
> > > }
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of
> > the administrators:
> >
> >
>http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > If you want more information on JIRA, or have a bug
> > to report see:
> >    http://www.atlassian.com/software/jira
> >
> >
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org