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

SCMPrint segfault

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.0
    • None
    • Samples/Tests
    • None

    Description

      I tried to run SCMPrint with the first schema included in the XBRL (http://www.xbrl.org/) conformance suite, and it started processing it apparently correctly until it got to the last element, and failed here:

      --------------------------------------------
      Name: http://www.xbrl.org/2003/XLink, resourceType
      Component Type: Type Definition
      Category: Complex
      Base: anyType
      Segmentation fault

      Debugging revealed processParticle was getting passed a null XSParticle from xsComplexTypeDef->getParticle(). By removing the line:

      processParticle(xsComplexTypeDef->getParticle());

      and replacing it with:

      XSParticle *xsParticle = xsComplexTypeDef->getParticle();
      if (xsParticle) {
      processParticle(xsParticle);
      } else {
      XERCES_STD_QUALIFIER cout << "xsParticle is NULL";
      }

      The program worked, and ran through all the other namespaces without problems as well. It only printed the "xsParticle is NULL" for the resourceType, nowhere else. Matching up the output of the software with the schema file xlink-2003-12-31.xsd it seems all the content models are mismatched, and the schema file says everything is a simpleType but the parser says everything is Complex. I'm not sure which files from the conformance suite need to be included to reproduce this, but please e-mail me if you need any of the xml files.

      101-01-ImportExample.xsd
      ------------------------

      <!-- XBRL 2.1 Tests -->
      <!-- Copyright 2003 XBRL International. See www.xbrl.org/legal. All Rights Reserved. -->
      <xsd:schema targetNamespace="http://mycompany.com/xbrl/taxonomy/ext"
      xmlns:xbrli="http://www.xbrl.org/2003/instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <xsd:import namespace="http://www.xbrl.org/2003/instance"
      schemaLocation="../lib/xbrl-instance-2003-12-31.xsd"/>

      <xsd:element name="retainedEarnings"
      type="xbrli:monetaryItemType" substitutionGroup="xbrli:item"
      id="a3" xbrli:periodType="duration"/>

      </xsd:schema>

      Attachments

        Activity

          People

            Unassigned Unassigned
            jhurliman John Hurliman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: