Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-933

XercesDOMParser::loadGrammar cause seg fault

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • DOM
    • None
    • Operating System: Windows XP
      Platform: PC
    • 21001

    Description

      The program below crashes on the parser3->loadGrammar call, while it works
      properly for parser1 and parser2. I've tested this both on cygwin (gcc 3.2) and
      SunOS 5.9 (gcc 2.95.3).

      George

      ========================================================================

      #include <xercesc/parsers/SAXParser.hpp>
      #include <xercesc/parsers/XercesDOMParser.hpp>
      #include <xercesc/validators/DTD/DTDGrammar.hpp>
      #include <xercesc/sax2/XMLReaderFactory.hpp>
      #include <iostream>

      XERCES_CPP_NAMESPACE_USE

      int main(int argc, char* argv[]) {
      XMLPlatformUtils::Initialize();

      SAXParser* parser1 = new SAXParser();
      parser1->loadGrammar(argv[1], Grammar::DTDGrammarType, true);
      std::cerr << "SAXParser.loadGrammar ok" << std::endl;

      SAX2XMLReader* parser2 = XMLReaderFactory::createXMLReader();
      parser2->loadGrammar(argv[1], Grammar::DTDGrammarType, true);
      std::cerr << "SAX2XMLReader.loadGrammar ok" << std::endl;

      /* XercesDOMParser crashes */
      XercesDOMParser* parser3 = new XercesDOMParser();
      parser3->loadGrammar(argv[1], Grammar::DTDGrammarType, true);
      std::cerr << "XercesDOMParser.loadGrammar ok" << std::endl;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            el_tavlador1979@yahoo.com George Sakkis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: