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

abort if arg expression used with dfdl:checkConstraints

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.4.0
    • None
    • Front End
    • None

    Description

       
       
      Put fn:true() inside dfdl:checkConstraints:  

       <xs:simpleType name="validString">
              <xs:annotation>
                  <xs:appinfo source="http://www.ogf.org/dfdl/">
                      <dfdl:assert>{ dfdl:checkConstraints(fn:true()) }</dfdl:assert>
                  </xs:appinfo>
              </xs:annotation>
              <xs:restriction base="xs:string"/>
          </xs:simpleType>

      This is a mistake, since it should be 

      dfdl:checkConstraints(.)

      but regardless of that Daffodil bombed instead of providing a diagnostic message. 
      This should not have gotten past the front end, but it did and the error occurred in the runtime. 

      org.apache.daffodil.exceptions.Abort: Invariant broken. Runtime.scala - Leaked exception: java.lang.NullPointerException
      : Cannot invoke "org.apache.daffodil.infoset.DIElement.valid()" because the return value of "org.apache.daffodil.dpath.D
      State.currentElement()" is null
      java.lang.NullPointerException: Cannot invoke "org.apache.daffodil.infoset.DIElement.valid()" because the return value o
      f "org.apache.daffodil.dpath.DState.currentElement()" is null
              at org.apache.daffodil.dpath.DFDLCheckConstraints.run(DFDLFunctions.scala:32)
              at org.apache.daffodil.dpath.CompiledDPath.run(DPathRuntime.scala:141)
              at org.apache.daffodil.dpath.CompiledDPath.runExpression(DPathRuntime.scala:72)
              at org.apache.daffodil.dpath.RuntimeExpressionDPath.evaluateExpression(DPath.scala:251)
              at org.apache.daffodil.dpath.RuntimeExpressionDPath.evaluateMaybe(DPath.scala:262)
              at org.apache.daffodil.dpath.RuntimeExpressionDPath.evaluate(DPath.scala:275)
              at org.apache.daffodil.processors.parsers.ExpressionEvaluationParser.eval(ExpressionEvaluatingParsers.scala:55)
              at org.apache.daffodil.processors.parsers.AssertExpressionEvaluationParser.parse(ExpressionEvaluatingParsers.sca
      la:220)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.ExpressionEvaluationParser.parse1(ExpressionEvaluatingParsers.scala:42
      )
              at org.apache.daffodil.processors.parsers.ElementParserBase.parse(ElementCombinator1.scala:185)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              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(UnseparatedSequen
      ceParsers.scala:37)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstanceWithMaybePoU(SequenceParserBases.sc
      ala:437)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstance(SequenceParserBases.scala:422)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parse(SequenceParserBases.scala:265)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              at org.apache.daffodil.processors.parsers.ElementParserBase.parse(ElementCombinator1.scala:135)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              at org.apache.daffodil.processors.parsers.InfixPrefixSeparatorHelperMixin.parseOneWithInfixOrPrefixSeparator(Sep
      aratedParseHelper.scala:134)
              at org.apache.daffodil.processors.parsers.InfixPrefixSeparatorHelperMixin.parseOneWithInfixOrPrefixSeparator$(Se
      paratedParseHelper.scala:92)
              at org.apache.daffodil.processors.parsers.InfixSeparatorHelper.parseOneWithInfixOrPrefixSeparator(SeparatedParse
      Helper.scala:73)
              at org.apache.daffodil.processors.parsers.InfixSeparatorHelper.parseOneWithSeparator(SeparatedParseHelper.scala:
      84)
              at org.apache.daffodil.processors.parsers.Separated.parseOne(SeparatedSequenceParsers.scala:44)
              at org.apache.daffodil.processors.parsers.Separated.parseOne$(SeparatedSequenceParsers.scala:43)
              at org.apache.daffodil.processors.parsers.RepOrderedWithMinMaxSeparatedSequenceChildParser.parseOne(SeparatedSeq
      uenceParsers.scala:102)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstanceWithMaybePoU(SequenceParserBases.sc
      ala:437)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstance(SequenceParserBases.scala:417)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parse(SequenceParserBases.scala:157)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              at org.apache.daffodil.processors.parsers.DelimiterStackParser.parse(ElementKindParsers.scala:77)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              at org.apache.daffodil.processors.parsers.HiddenGroupCombinatorParser.parse(HiddenGroupCombinatorParser.scala:40
      )
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              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(UnseparatedSequen
      ceParsers.scala:37)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstanceWithMaybePoU(SequenceParserBases.sc
      ala:437)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parseOneInstance(SequenceParserBases.scala:422)
              at org.apache.daffodil.processors.parsers.SequenceParserBase.parse(SequenceParserBases.scala:265)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              at org.apache.daffodil.processors.parsers.ElementParserBase.parse(ElementCombinator1.scala:135)
              at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:82)
              at org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:76)
              at org.apache.daffodil.processors.parsers.CombinatorParser.parse1(Parser.scala:161)
              at org.apache.daffodil.processors.DataProcessor.doParse(DataProcessor.scala:503)
              at org.apache.daffodil.processors.DataProcessor.parse(DataProcessor.scala:447)
              at org.apache.daffodil.Main$.$anonfun$run$3(Main.scala:933)
              at org.apache.daffodil.util.Timer$.getTimeResult(Timer.scala:78)
              at org.apache.daffodil.util.Timer$.getResult(Timer.scala:37)
              at org.apache.daffodil.Main$.run(Main.scala:933)
              at org.apache.daffodil.Main$.main(Main.scala:1577)
              at org.apache.daffodil.Main.main(Main.scala)
      
      org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:137)
      org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:183)
      org.apache.daffodil.processors.DataProcessor.doParse(DataProcessor.scala:562)
      org.apache.daffodil.processors.DataProcessor.parse(DataProcessor.scala:447)
              at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:137)
              at org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:183)
              at org.apache.daffodil.processors.DataProcessor.doParse(DataProcessor.scala:562)
              at org.apache.daffodil.processors.DataProcessor.parse(DataProcessor.scala:447)
              at org.apache.daffodil.Main$.$anonfun$run$3(Main.scala:933)
              at org.apache.daffodil.util.Timer$.getTimeResult(Timer.scala:78)
              at org.apache.daffodil.util.Timer$.getResult(Timer.scala:37)
              at org.apache.daffodil.Main$.run(Main.scala:933)
              at org.apache.daffodil.Main$.main(Main.scala:1577)
              at org.apache.daffodil.Main.main(Main.scala)

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: