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

Error unparsing bigInts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.7.0
    • Back End, Unparsing
    • None

    Description

      On unparse, daffodil appears to try parsing numeric strings as a long regardless of the bit length, potentiall causing issues when length>64. Example attached.

       

      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      !! An unexpected exception occurred. This is a bug! !!
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      Please report this bug and help us fix it:

      https://daffodil.apache.org/community/#issue-tracker

      Please include the following exception, the command you
      ran, and any input, schema, or tdml files used that led
      to this bug.

      java.lang.NumberFormatException: For input string: "7089904312036126320"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.lang.Integer.parseInt(Integer.java:583)
      at java.lang.Integer.parseInt(Integer.java:615)
      at scala.collection.immutable.StringLike.toInt(StringLike.scala:301)
      at scala.collection.immutable.StringLike.toInt$(StringLike.scala:301)
      at scala.collection.immutable.StringOps.toInt(StringOps.scala:29)
      at org.apache.daffodil.dpath.NodeInfo$PrimType$Int$.fromXMLString(NodeInfo.scala:459)
      at org.apache.daffodil.dpath.NodeInfo$PrimType$Int$.fromXMLString(NodeInfo.scala:457)
      at org.apache.daffodil.infoset.InfosetInputter.createElement(InfosetInputter.scala:347)
      at org.apache.daffodil.infoset.InfosetInputter.handleStartElement(InfosetInputter.scala:242)
      at org.apache.daffodil.infoset.InfosetInputter.reallyFill(InfosetInputter.scala:226)
      at org.apache.daffodil.infoset.InfosetInputter.fill(InfosetInputter.scala:213)
      at org.apache.daffodil.util.CursorImplMixin.doAdvance(Cursor.scala:174)
      at org.apache.daffodil.util.CursorImplMixin.advance(Cursor.scala:144)
      at org.apache.daffodil.util.CursorImplMixin.advance$(Cursor.scala:141)
      at org.apache.daffodil.infoset.InfosetInputter.advance(InfosetInputter.scala:53)
      at org.apache.daffodil.processors.unparsers.UStateMain.advance(UState.scala:482)
      at org.apache.daffodil.util.Cursor.advanceMaybe(Cursor.scala:104)
      at org.apache.daffodil.util.Cursor.advanceMaybe$(Cursor.scala:103)
      at org.apache.daffodil.processors.unparsers.UState.advanceMaybe(UState.scala:72)
      at org.apache.daffodil.processors.unparsers.UStateMain.advanceOrError(UState.scala:499)
      at org.apache.daffodil.processors.unparsers.RegularElementUnparserStartEndStrategy.unparseBegin(ElementUnparser.scala:382)
      at org.apache.daffodil.processors.unparsers.RegularElementUnparserStartEndStrategy.unparseBegin$(ElementUnparser.scala:377)
      at org.apache.daffodil.processors.unparsers.ElementSpecifiedLengthUnparser.unparseBegin(ElementUnparser.scala:264)
      at org.apache.daffodil.processors.unparsers.ElementUnparserBase.unparse(ElementUnparser.scala:178)
      at org.apache.daffodil.processors.unparsers.Unparser.unparse1(Unparser.scala:72)
      at org.apache.daffodil.processors.unparsers.Unparser.unparse1$(Unparser.scala:39)
      at org.apache.daffodil.processors.unparsers.CombinatorUnparser.unparse1(Unparser.scala:128)
      at org.apache.daffodil.processors.DataProcessor.doUnparse(Runtime.scala:356)
      at org.apache.daffodil.processors.DataProcessor.unparse(Runtime.scala:304)
      at org.apache.daffodil.Main$.$anonfun$run$14(Main.scala:1133)
      at org.apache.daffodil.util.Timer$.getTimeResult(Timer.scala:76)
      at org.apache.daffodil.util.Timer$.getResult(Timer.scala:35)
      at org.apache.daffodil.Main$.run(Main.scala:1133)
      at org.apache.daffodil.Main$.main(Main.scala:1361)
      at org.apache.daffodil.Main.main(Main.scala)

       

       

      Attachments

        1. a.dfdl.xsd
          0.6 kB
          Brandon Sloane
        2. a.bin.xml
          0.1 kB
          Brandon Sloane

        Issue Links

          Activity

            People

              Unassigned Unassigned
              brandon.sloane Brandon Sloane
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: