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 bu...@apache.org on 2002/05/28 18:19:06 UTC

DO NOT REPLY [Bug 9460] New: - DOMParser segmentation fault when reading from MemBufInputSource

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9460>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9460

DOMParser segmentation fault when reading from MemBufInputSource

           Summary: DOMParser segmentation fault when reading from
                    MemBufInputSource
           Product: Xerces-C++
           Version: 1.7.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: DOM
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: gutw@knapp.co.at


Because of the memory leaks I got each time when I made a validating parse with
the DOMParser I made a lib update from 1.5 to 1.7. Now everything seems alright,
when I'm parsing files. But parsing from a MemBufInputSource (I use a similar
code as in the MemParse sample for the SAXParser) has worked before and now
results in a segmentation fault in ReaderMgr::createReader() called by
XMLScanner::scanReset().

Any help or ideas?

Snips from my code (not exact, just to show what I'm doing):

static DOMParser * gm_parser;
MemBufInputSource* m_pInpSrc;
gm_parser = new DOMParser();
gm_errReporter = new DOMTreeErrorReporter();
gm_parser->setErrorHandler(gm_errReporter);
gm_parser->setToCreateXMLDeclTypeNode(true);

char buf[256];
strcpy(buf, "...<some xml stuff>...");  
m_pInpSrc = new MemBufInputSource( (const XMLByte*)buf, strlen(buf), "NewDoc",
false );
gm_parser->setValidationScheme(DOMParser::Val_Always);

try
  {
    gm_parser->parse(*m_pInpSrc); // seg fault here
  }
catch ..... (XMLException, DOM_DOMException, SAXParseException, ...)

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