[
https://issues.apache.org/jira/browse/DAFFODIL-2645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486144#comment-17486144
]
Mike Beckerle commented on DAFFODIL-2645:
-----------------------------------------
Appears to be because the bitLimit can be 1920, based on a specified length,
but that's beyond what the I/O layer is actually able to produce.
So for example, a header says the length is 240 bytes (1920 bits) by a
dfdl:length expression.
But the actual data is only 103 bytes long.
At bytePos0b 91, if you ask for 160 bits (20 bytes), that requires byte
position 111, which is past what the I/O layer can produce, but not due to the
dfdl:length computed limit, due to the actual data size.
The error message doesn't take into consideration that the limit isn't
necessarily responsible for the failure, and constructs a message based on
dis.remaining, which is computed based not on the actual data size, but the
difference between current position and the limit.
dis.remaining needs to take the lesser of the physical end of data length, and
the limit.
> Parse Error: Insufficient bits. Needed 160 but found only 1192
> ---------------------------------------------------------------
>
> Key: DAFFODIL-2645
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2645
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Affects Versions: 3.2.1
> Reporter: Mike Beckerle
> Priority: Critical
>
> I got this diagnostic message today, which makes no sense:
> {code:java}
> Parse Error: Insufficient bits in data. Needed 160 bit(s) but found only 1192
> available. {code}
> There's some situation where it is miscalculating, or maybe just has the args
> backwards.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)