[ 
https://issues.apache.org/jira/browse/DAFFODIL-2010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16642415#comment-16642415
 ] 

Steve Lawrence commented on DAFFODIL-2010:
------------------------------------------

There are two issues I see related to this problem:
 # The ConvertBinaryCalendarSecMillliParser attempts to get 4 bytes to parse 
the DateTime element, but there is not enough data at the end of the file. The 
parser does this without checking if enough data actually exists, and so a 
NotEnoughDataException is thrown. This parser should instead check that the 
needed number of bits exists before trying to get any data, and it should 
create a ParseError enough data does not exist.
 # The SequenceParser should catch this unexpected exception and throw an new 
exception stating that an unexpected exception was thrown, as well as discard 
the mark so there is no mark pool leak. It does do this, however, it throws an 
invariant failed *and then* discards the mark. But because the invariant throws 
before the discard, the mark is never actually discarded. This leads to a 
markpool leak and hides the helpful message. We need to move the mark discard 
to before throwing the exception.

 

Unfortunately, there isn't really a workaround for this. The data appears to be 
short a couple of bytes, so you could add extra data to fill it out so that 
there is not a partial DateTime's at the end of the file.

> Exception instead of error message - unknown user error
> -------------------------------------------------------
>
>                 Key: DAFFODIL-2010
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2010
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 2.2.0
>         Environment: Windows 7
>            Reporter: James L Welch
>            Priority: Major
>             Fix For: 2.3.0
>
>         Attachments: Errors.txt, PUMPLOG1.CFG, Project_DataTypes.dfdl.xsd, 
> Project_Defaults.dfdl.xsd, TFpumpLog.dfdl.xsd, x.bat
>
>
> FYI: I have about 60 other "elements" that work OK for 60 different files 
> (.cfg). I have not figured out what the cause is yet. TFpumpLog.dfdl.xsd is 
> the new file that crashes.
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>  !! 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.
> org.apache.daffodil.exceptions.Abort: Invariant broken. Pool MarkPool leaked 
> 1 instance(s).
>  poolDebugLabel = before occurrence
>  org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
>  org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:175)
>  org.apache.daffodil.util.Pool.finalCheck(Pool.scala:103)
>  org.apache.daffodil.util.Pool.finalCheck$(Pool.scala:99)
>  at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
>  at org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:175)
>  at org.apache.daffodil.util.Pool.finalCheck(Pool.scala:103)
>  at org.apache.daffodil.util.Pool.finalCheck$(Pool.scala:99)
>  at 
> org.apache.daffodil.processors.parsers.PState$MarkPool.finalCheck(PState.scala:431)
>  at 
> org.apache.daffodil.processors.parsers.PState.verifyFinalState(PState.scala:348)
>  at org.apache.daffodil.processors.DataProcessor.doParse(Runtime.scala:242)
>  at 
> org.apache.daffodil.processors.DataProcessor.$anonfun$parse$1(Runtime.scala:200)
>  at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
>  at 
> org.apache.daffodil.ExecutionMode$.$anonfun$usingRuntimeMode$1(ExecutionMode.scala:65)
>  at org.apache.daffodil.processors.DataProcessor.parse(Runtime.scala:192)
>  at org.apache.daffodil.processors.DataProcessor.parse(Runtime.scala:188)
>  at org.apache.daffodil.Main$.$anonfun$run$1(Main.scala:860)
>  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:860)
>  at org.apache.daffodil.Main$.main(Main.scala:1341)
>  at org.apache.daffodil.Main.main(Main.scala)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to