Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-553

Cryptic Error with Mismatched Encodings

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: s10
    • Component/s: None
    • Labels:
      None

      Description

      I defined a comma separated sequence, and the global encoding in that schema
      is "US-ASCII". This sequence consists of two elements, the first being a
      binary string in utf-8, and the second being a binary string in utf-16be.
      My test defines a document with the documentPart type set to "byte". I
      specify the first element in utf-8, the delimiter in us-ascii, and the
      second element in utf-16be. Currently I get this error:

      [info] - test_multi_encoding_02 *** FAILED ***
      [info] edu.illinois.ncsa.daffodil.exceptions.Abort: Invariant broken. Runtime parsers should not throw exceptions: scala.MatchError: Some(DFDLCharReader at bitPos 0) (of class scala.Some)
      [info] edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:85)
      [info] edu.illinois.ncsa.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:122)
      [info] edu.illinois.ncsa.daffodil.processors.AltCompParser$$anonfun$parse$4.apply(Parser.scala:353)
      [info] edu.illinois.ncsa.daffodil.processors.AltCompParser$$anonfun$parse$4.apply(Parser.scala:346)
      [info] at edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:85)
      [info] at edu.illinois.ncsa.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:122)
      [info] at edu.illinois.ncsa.daffodil.processors.AltCompParser$$anonfun$parse$4.apply(Parser.scala:353)
      [info] at edu.illinois.ncsa.daffodil.processors.AltCompParser$$anonfun$parse$4.apply(Parser.scala:346)
      [info] at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      [info] at scala.collection.immutable.List.foreach(List.scala:76)
      [info] at edu.illinois.ncsa.daffodil.processors.AltCompParser.parse(Parser.scala:346)
      [info] at edu.illinois.ncsa.daffodil.processors.Parser.parse1(Parser.scala:132)
      [info] at edu.illinois.ncsa.daffodil.processors.SeqCompParser$$anonfun$parse$3.apply(Parser.scala:319)
      [info] at edu.illinois.ncsa.daffodil.processors.SeqCompParser$$anonfun$parse$3.apply(Parser.scala:317)

      I created another test
      (multi_encoding_4) that uses a sequence with lengthKind="delimited" and no
      delimiters, with each element using a different encoding, as you mentioned
      previously. This is the error I receive

      [info] - test_multi_encoding_04 *** FAILED ***
      [info] scala.MatchError: Some(DFDLCharReader at bitPos 0) (of class scala.Some)
      [info] at edu.illinois.ncsa.daffodil.processors.TextReader$class.getReader(Primitives.scala:2933)
      [info] at edu.illinois.ncsa.daffodil.processors.StringDelimitedEndOfData.getReader(Primitives.scala:576)
      [info] at edu.illinois.ncsa.daffodil.processors.StringDelimitedEndOfData$$anon$7$$anonfun$parse$8.apply(Primitives.scala:624)
      [info] at edu.illinois.ncsa.daffodil.processors.StringDelimitedEndOfData$$anon$7$$anonfun$parse$8.apply(Primitives.scala:591)
      [info] at edu.illinois.ncsa.daffodil.processors.WithParseErrorThrowing$class.withParseErrorThrowing(Parser.scala:220)
      [info] at edu.illinois.ncsa.daffodil.processors.StringDelimitedEndOfData.withParseErrorThrowing(Primitives.scala:576)
      [info] at edu.illinois.ncsa.daffodil.processors.StringDelimitedEndOfData$$anon$7.parse(Primitives.scala:589)
      [info] at edu.illinois.ncsa.daffodil.processors.Parser.parse1(Parser.scala:132)
      [info] at edu.illinois.ncsa.daffodil.processors.SeqCompParser$$anonfun$parse$3.apply(Parser.scala:319)
      [info] at edu.illinois.ncsa.daffodil.processors.SeqCompParser$$anonfun$parse$3.apply(Parser.scala:317)

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              jchab Jessie Chab
              Reporter:
              jchab Jessie Chab
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Tasks