Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2361

valueLength not working as expected with complex elements, causing circular deadlocks during unparse

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.6.0
    • None
    • Diagnostics, Unparsing
    • None

    Description

      Ran into this issue while making changes to a production schema.

      Consider the following schema;

      <xs:element name="len" type="xs:unsignedInt" dfdl:outputValueCalc="{ dfdl:valueLength(../implicitLenComplex, 'bytes') }" />
      <xs:element name="implicitLenComplex">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="item1" type="xs:hexBinary" dfdl:length="{ ../../len }" dfdl:lengthUnits="bytes" dfdl:lengthKind="explicit" />
      </xs:sequence>
      </xs:complexType>
      </xs:element>

       

      I would reasonably expect that the outputValueCalc would work as expected and get the valueLength of the entire implicitLenComplex sequence, however this results in a circular deadlock.

       

      NOTE: if you change the outputValueCalc to dfdl:valueLength(../implicitLenComplex/item1, 'bytes') everything works as expected.

       

      I've attached a sample schema file and test data that demonstrates this issue.

       

      EDIT: I've added an additional schema that demonstrates that if the hexBinary element is wrapped inside an additional sequence and valueLength is called on the inner sequence it still results in the circular deadlock.

      Attachments

        1. test.xsd
          3 kB
          Josh Adams
        2. test.dat
          0.0 kB
          Josh Adams
        3. test.info
          0.1 kB
          Josh Adams
        4. innerSeq.xsd
          3 kB
          Josh Adams

        Activity

          People

            Unassigned Unassigned
            jadams_tresys Josh Adams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: