alexcrichton / xz2-rs

Bindings to liblzma in Rust (xz streams in Rust)
Apache License 2.0
81 stars 52 forks source link

`InvalidInput` on extracting a xz file #112

Open crazystylus opened 1 year ago

crazystylus commented 1 year ago

Test code

fn main() {
    let test_xz = File::open("dump.xz").unwrap();
    let mut output = Vec::new();
    xz2::read::XzDecoder::new(&test_xz).read_to_end(&mut output).unwrap();
}

Output of above program

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: Options }'

Output of xz -l dump.xz

Strms  Blocks   Compressed Uncompressed  Ratio  Check   Filename
    1       1    683.7 KiB  2,048.0 KiB  0.334  None    dump.xz

I am able to extract the xz file using unxz in linux but not with XzDecoder

Link to file (please extract the dump.zip to get xz file) dump.zip

crazystylus commented 1 year ago

Adding to this, I tried to extract the same archive using rust-lzma and received no such error or issue. This might be helpful with diagnosing the issue.