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 Amit Makhija <am...@cybage.com> on 2004/07/14 13:54:22 UTC

Segmentation fault xerces-c 2.4.0

Hi,

I am confronting a problem with  xerces-c 2.4.0. Code below runs properly on Linux/Windows but on freebsd box it throws a segmentation fault. I have gcc version (3.2.3) 

#include <stdio.h>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/parsers/AbstractDOMParser.hpp>
#include <xercesc/dom/DOMImplementationRegistry.hpp>
#include <xercesc/dom/DOMBuilder.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationLS.hpp>
#include <xercesc/dom/DOMError.hpp>
#include <xercesc/dom/DOMException.hpp>
#include <xercesc/dom/DOMNamedNodeMap.hpp>
#include <xercesc/dom/DOMAttr.hpp>


using namespace XERCES_CPP_NAMESPACE;
main()
{
 XMLPlatformUtils::Initialize();
 static const XMLCh gLS[] = { chLatin_L, chLatin_S,chNull}; 
 DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(gLS);
 DOMBuilder *parser;
 parser = ((DOMImplementationLS*)impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS,0);

 DOMDocument *doc;
 const char *xmlFile = "1.xml";
 parser->resetDocumentPool();
 doc = parser->parseURI(xmlFile);
 parser->release();
 //delete parser;
 
 
 printf("Test Program\n");
 XMLPlatformUtils::Terminate();
}

 

Thanking you in advance.
-Amit Makhija