Description
The following backtrace occurs during parse of a NITF 2.1 file. Schema to reproduce is attached. The file to reproduce is too large to attach, but may be downloaded:
https://six-library.s3.amazonaws.com/sicd_example_RMA_RGZERO_RE16I_IM16I.nitf
Exception in thread "main" org.apache.daffodil.exceptions.Abort: Invariant broken. Runtime.scala - Leaked exception: java.lang.NegativeArraySizeExceptionjava.lang.NegativeArraySizeException at org.apache.daffodil.io.InputSourceDataInputStream.getByteArray(InputSourceDataInputStream.scala:149) at org.apache.daffodil.processors.parsers.HexBinaryLengthParser.parse(HexBinaryLengthParsers.scala:42) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.HexBinaryLengthParser.parse1(HexBinaryLengthParsers.scala:26) at org.apache.daffodil.processors.parsers.ElementParserBase.parse(ElementCombinator1.scala:148) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.ChoiceDispatchCombinatorParserBase.parse(ElementKindParsers.scala:233) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.Unseparated.parseOne(UnseparatedSequenceParsers.scala:29) at org.apache.daffodil.processors.parsers.Unseparated.parseOne$(UnseparatedSequenceParsers.scala:27) at org.apache.daffodil.processors.parsers.ScalarOrderedUnseparatedSequenceChildParser.parseOne(UnseparatedSequenceParsers.scala:36) at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstance(SequenceParserBases.scala:279) at org.apache.daffodil.processors.parsers.SequenceParserBase.parse(SequenceParserBases.scala:206) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.SpecifiedLengthParserBase.parse(SpecifiedLengthParsers.scala:69) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.ElementParserBase.parse(ElementCombinator1.scala:148) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.Unseparated.parseOne(UnseparatedSequenceParsers.scala:29) at org.apache.daffodil.processors.parsers.Unseparated.parseOne$(UnseparatedSequenceParsers.scala:27) at org.apache.daffodil.processors.parsers.ScalarOrderedUnseparatedSequenceChildParser.parseOne(UnseparatedSequenceParsers.scala:36) at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstance(SequenceParserBases.scala:279) at org.apache.daffodil.processors.parsers.SequenceParserBase.parse(SequenceParserBases.scala:206) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.ElementParserBase.parse(ElementCombinator1.scala:148) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.Unseparated.parseOne(UnseparatedSequenceParsers.scala:29) at org.apache.daffodil.processors.parsers.Unseparated.parseOne$(UnseparatedSequenceParsers.scala:27) at org.apache.daffodil.processors.parsers.RepOrderedExpressionOccursCountUnseparatedSequenceChildParser.parseOne(UnseparatedSequenceParsers.scala:63) at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstance(SequenceParserBases.scala:279) at org.apache.daffodil.processors.parsers.SequenceParserBase.parse(SequenceParserBases.scala:139) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.parsers.ElementParserBase.parse(ElementCombinator1.scala:148) at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:78) at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:72) at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:157) at org.apache.daffodil.processors.DataProcessor.doParse(DataProcessor.scala:443) at org.apache.daffodil.processors.DataProcessor.$anonfun$parse$1(DataProcessor.scala:406) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62) at org.apache.daffodil.ExecutionMode$.$anonfun$usingRuntimeMode$1(ExecutionMode.scala:65) at org.apache.daffodil.processors.DataProcessor.parse(DataProcessor.scala:398) at org.apache.daffodil.processors.DataProcessor.parse(DataProcessor.scala:394) at org.apache.daffodil.japi.DataProcessor.parse(Daffodil.scala:718) org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:120)org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:166)org.apache.daffodil.processors.DataProcessor.doParse(DataProcessor.scala:502)org.apache.daffodil.processors.DataProcessor.$anonfun$parse$1(DataProcessor.scala:406) at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:120) at org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:166) at org.apache.daffodil.processors.DataProcessor.doParse(DataProcessor.scala:502) at org.apache.daffodil.processors.DataProcessor.$anonfun$parse$1(DataProcessor.scala:406) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62) at org.apache.daffodil.ExecutionMode$.$anonfun$usingRuntimeMode$1(ExecutionMode.scala:65) at org.apache.daffodil.processors.DataProcessor.parse(DataProcessor.scala:398) at org.apache.daffodil.processors.DataProcessor.parse(DataProcessor.scala:394) at org.apache.daffodil.japi.DataProcessor.parse(Daffodil.scala:718)