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

cram/container/block: Decode fails when the block is empty #131

Closed
zaeleus opened this issue Nov 4, 2022 · 1 comment
Closed

cram/container/block: Decode fails when the block is empty #131

zaeleus opened this issue Nov 4, 2022 · 1 comment
Assignees
Labels

Comments

@zaeleus
Copy link
Owner

zaeleus commented Nov 4, 2022

Some encoders like CRAMtools write empty blocks, i.e., a block with an uncompressed size of 0. This is rather unconventional, but the CRAM spec does not define whether this is legal or not. The question is posed in samtools/hts-specs#680.

An example of data like this can be seen with SAMEA3302751.alt_bwamem_GRCh38DH.20200922.Finnish.simons.cram.

(lldb) p *self
(noodles_cram::container::block::Block) $0 = {
  compression_method = Rans4x8
  content_type = ExternalData
  content_id = {
    0 = 5
  }
  uncompressed_len = 0
  data = {
    ptr = 0x00005555557a6b38
    len = 0
    data = {
      p = {
        value = 0x0000000000000000
      }
    }
    vtable = 0x0000555555821df0
  }
}
(lldb) c
Process 494871 resuming
Error: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }
Process 494871 exited with status = 1 (0x00000001)

This was originally reported by @claymcleod.

@zaeleus
Copy link
Owner Author

zaeleus commented Nov 17, 2022

Closed by 65dafbb.

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

No branches or pull requests

1 participant