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

Abort: Invariant Broken when XPath expression moves past root

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 2.3.0
    • General
    • None

    Description

      If the XPath expression extends beyond the root of the tree, you get the following error:

      [error] Test edu.illinois.ncsa.daffodil.section23.dfdl_expressions.TestDFDLExpressions.test_beyondRoot_01 failed: edu.illinois.ncsa.daffodil.exceptions.Abort: Invariant broken. UpMove past root. Should never happen since an expression like that won't typecheck statically.
      [error] edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:95)
      [error] edu.illinois.ncsa.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:136)
      [error] edu.illinois.ncsa.daffodil.dpath.UpMove$$anonfun$1.apply(UpDownMoves.scala:32)
      [error] edu.illinois.ncsa.daffodil.dpath.UpMove$$anonfun$1.apply(UpDownMoves.scala:32)
      [error]     at edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:95)
      [error]     at edu.illinois.ncsa.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:136)
      [error]     at edu.illinois.ncsa.daffodil.dpath.UpMove$$anonfun$1.apply(UpDownMoves.scala:32)
      [error]     at edu.illinois.ncsa.daffodil.dpath.UpMove$$anonfun$1.apply(UpDownMoves.scala:32)
      [error]     at edu.illinois.ncsa.daffodil.util.Maybe$.getOrElse$extension(Maybe.scala:30)
      [error]     at edu.illinois.ncsa.daffodil.dpath.UpMove$.run(UpDownMoves.scala:32)
      [error]     at edu.illinois.ncsa.daffodil.dpath.CompiledDPath.run(DPathRuntime.scala:85)
      [error]     at edu.illinois.ncsa.daffodil.dpath.CompiledDPath.runExpression(DPathRuntime.scala:31)
      [error]     at edu.illinois.ncsa.daffodil.dpath.RuntimeExpressionDPath.liftedTree1$1(DPath.scala:92)
      [error]     at edu.illinois.ncsa.daffodil.dpath.RuntimeExpressionDPath.evaluate(DPath.scala:91)
      [error]     at edu.illinois.ncsa.daffodil.processors.parsers.ExpressionEvaluationParser.eval(ExpressionEvaluatingParsers.scala:30)
      [error]     at edu.illinois.ncsa.daffodil.processors.parsers.IVCParser$$anonfun$parse$1.apply(ExpressionEvaluatingParsers.scala:44)
      [error]     at edu.illinois.ncsa.daffodil.processors.parsers.IVCParser$$anonfun$parse$1.apply(ExpressionEvaluatingParsers.scala:41)
      [error]     at edu.illinois.ncsa.daffodil.processors.WithParseErrorThrowing$class.withParseErrorThrowing(ParseErrors.scala:205)
      [error]     at edu.illinois.ncsa.daffodil.processors.parsers.ExpressionEvaluationParser.withParseErrorThrowing(ExpressionEvaluatingParsers.scala:19)
      [error]     at edu.illinois.ncsa.daffodil.processors.parsers.IVCParser.parse(ExpressionEvaluatingParsers.scala:41)
      ....
      

      I first noticed this with the interactive debugger, but have written a TDML test to demonstrate the issue:

      test_beyondRoot_01

      daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/expressions.tdml
      daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala
      daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressions.scala

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            daffodil-jchab Jessie Chab
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: