image-rs/deflate-rs

Panic on mips64 / mips64el

CryZe opened this issue · 4 comments

CryZe commented

When using deflate on a mips64 / mips64el target, the deflate crate panics with the following assertion:

---- parse::llanfair stdout ----
	thread 'parse::llanfair' panicked at 'The generated length codes were not valid!', /cargo/registry/src/github.com-1ecc6299db9ec823/deflate-0.7.16/src/length_encode.rs:393:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Travis CI Job

Hm, I suspect there is some difference with float handling on mips causing the validate function to accumulate to something larger than 1.0 on mips64. Are you able to test if things work fine with debug assertions disabled?

Maybe I could change the condition to be a bit more lenient, this is just a debug check to make sure the function works correctly anyhow, since it works fine everywhere else (including on big-endian targets) I presume the length values are correct and it's just the validate functions that is a bit bugged on mips64 for whatever reason.

Looks like there are some float issues with rust on mips:
rust-lang/rust#37805

I'll just disable this check on mips systems to avoid this.

I published a new version which disabled the check on mips platforms. Let me know if this solves the issue!

Compiles fine with cross, and I've disabled the check, so closing this.