Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when using Bit-sized integers and eof flag. #548

Closed
Meigyoku-Thmn opened this issue Jul 3, 2018 · 3 comments
Closed

Bug when using Bit-sized integers and eof flag. #548

Meigyoku-Thmn opened this issue Jul 3, 2018 · 3 comments
Milestone

Comments

@Meigyoku-Thmn
Copy link

Meigyoku-Thmn commented Jul 3, 2018

Suppose I have this file schema:

meta:
  id: my_data
  endian: le
seq:
  - id: pixels
    type: b4
    repeat: eos

And a 32 bytes binary file.
My expectation is the pixels property would have 64 elements (each byte has two "4 bits" group).
But when I tried, Kaitai only produced a 63 elements pixels array, it missed the last "4 bits" element.
So there is some kind of bug in the parsing process.

@GreyCat
Copy link
Member

GreyCat commented Jul 3, 2018

Good catch, thanks! That's actually something that I would expect to be plaguing many runtimes, which only analyze eof of current stream, not taking leftover bits buffer into account.

@GreyCat GreyCat transferred this issue from kaitai-io/kaitai_struct_javascript_runtime Mar 28, 2019
@GreyCat GreyCat added this to the v0.9 milestone Mar 29, 2019
@GreyCat
Copy link
Member

GreyCat commented Mar 29, 2019

Finally started some work on this one, RepeatEosBit is a new test name: https://ci.kaitai.io/
JS, Java, Python and Ruby runtimes fixed, rest of targets to follow.

@GreyCat
Copy link
Member

GreyCat commented Apr 17, 2019

All KST-backed targets now pass the test. Lua and Perl is kind of left behind, but it will require to do KST implementation for them first.

@GreyCat GreyCat closed this as completed Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants