Frommi / miniz_oxide

Rust replacement for miniz
MIT License
168 stars 48 forks source link

roundtrip tests fail in published 0.3.5 crate #64

Closed kentfredric closed 4 years ago

kentfredric commented 4 years ago
 Running `/var/tmp/portage/dev-rust/miniz_oxide-0.3.5/work/debug/deps/test-d07cae2084eaa2a5`

running 7 tests
test decompress_zero_code_len_2 ... ok
test decompress_zero_code_len_oom ... ok
test inf_issue_14 ... ok
test inf_issue_19 ... ok
test roundtrip_lvl_0 ... FAILED
test roundtrip_lvl_9 ... FAILED
test roundtrip_lvl_1 ... FAILED

failures:

---- roundtrip_lvl_0 stdout ----
thread 'roundtrip_lvl_0' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

---- roundtrip_lvl_9 stdout ----
thread 'roundtrip_lvl_9' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1084:5

---- roundtrip_lvl_1 stdout ----
thread 'roundtrip_lvl_1' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1084:5

failures:
    roundtrip_lvl_0
    roundtrip_lvl_1
    roundtrip_lvl_9

test result: FAILED. 4 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out
Full output with RUST_BACKTRACE=full ``` --- roundtrip_lvl_0 stdout ---- thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5 stack backtrace: 0: 0x55c5d8263be4 - backtrace::backtrace::libunwind::trace::h93069dd45e563114 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88 1: 0x55c5d8263be4 - backtrace::backtrace::trace_unsynchronized::ha81d63fb01c61f43 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66 2: 0x55c5d8263be4 - std::sys_common::backtrace::_print_fmt::h5800670bd4856d97 at src/libstd/sys_common/backtrace.rs:77 3: 0x55c5d8263be4 - ::fmt::h8e952e7a864dce8d at src/libstd/sys_common/backtrace.rs:61 4: 0x55c5d8286c5c - core::fmt::write::ha6cd837d898e4a61 at src/libcore/fmt/mod.rs:1030 5: 0x55c5d81e06d5 - std::io::Write::write_fmt::haa9265683e464bfb at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/io/mod.rs:1412 6: 0x55c5d825ea91 - std::io::impls::>::write_fmt::he7c7a5301251df0f at src/libstd/io/impls.rs:141 7: 0x55c5d8265e9e - std::sys_common::backtrace::_print::he810963362c39756 at src/libstd/sys_common/backtrace.rs:65 8: 0x55c5d8265e9e - std::sys_common::backtrace::print::hde04e6d280846a89 at src/libstd/sys_common/backtrace.rs:50 9: 0x55c5d8265e9e - std::panicking::default_hook::{{closure}}::h9d7792d5f2173a87 at src/libstd/panicking.rs:188 10: 0x55c5d8265b38 - std::panicking::default_hook::h9970cb21e5e5b2d4 at src/libstd/panicking.rs:202 11: 0x55c5d826659b - std::panicking::rust_panic_with_hook::hcbf43bd831dd8ef3 at src/libstd/panicking.rs:464 12: 0x55c5d826613e - std::panicking::continue_panic_fmt::h47b6e25372f76c95 at src/libstd/panicking.rs:373 13: 0x55c5d8266026 - rust_begin_unwind at src/libstd/panicking.rs:302 14: 0x55c5d8283a7e - core::panicking::panic_fmt::h24ff570098569537 at src/libcore/panicking.rs:141 15: 0x55c5d8283b77 - core::result::unwrap_failed::hf7d72924a9a2d22c at src/libcore/result.rs:1165 16: 0x55c5d81dd300 - core::result::Result::unwrap::h0830fd1b36ee5052 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libcore/result.rs:933 17: 0x55c5d81ddcbc - test::get_test_file_data::h65896587825f1fc9 at tests/test.rs:11 18: 0x55c5d81dde04 - test::get_test_data::h65a752d85858b18c at tests/test.rs:53 19: 0x55c5d81dde5c - test::roundtrip::h91d60028ff561479 at tests/test.rs:57 20: 0x55c5d81de698 - test::roundtrip_lvl_0::h2a97638a87236059 at tests/test.rs:81 21: 0x55c5d81df0da - test::roundtrip_lvl_0::{{closure}}::he8364aa236ed0c19 at tests/test.rs:80 22: 0x55c5d81deade - core::ops::function::FnOnce::call_once::h731f141a0b0e1982 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libcore/ops/function.rs:227 23: 0x55c5d81eb32f - as core::ops::function::FnOnce>::call_once::h19a09fd199a0ff21 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/liballoc/boxed.rs:942 24: 0x55c5d826d1aa - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:79 25: 0x55c5d820690a - std::panicking::try::h1d1a1c5142fbfdd7 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/panicking.rs:265 26: 0x55c5d820690a - std::panic::catch_unwind::h200ca6210a82d128 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/panic.rs:396 27: 0x55c5d820690a - test::run_test_in_process::h766e5938de77f4da at src/libtest/lib.rs:570 28: 0x55c5d820690a - test::run_test::run_test_inner::{{closure}}::h3d3ac74133b541d4 at src/libtest/lib.rs:473 29: 0x55c5d8205fe8 - test::run_test::run_test_inner::he77bc794d3ace3bd at src/libtest/lib.rs:494 30: 0x55c5d8204569 - test::run_test::hba77973327a2fc7f at src/libtest/lib.rs:530 31: 0x55c5d81fa954 - test::run_tests::h5a1270ddd5e0a473 at src/libtest/lib.rs:299 32: 0x55c5d81fa954 - test::console::run_tests_console::h29d755f301130a08 at src/libtest/console.rs:295 33: 0x55c5d82009e4 - test::test_main::hf2bc958b6a636d99 at src/libtest/lib.rs:120 34: 0x55c5d8201961 - test::test_main_static::h90326c29e77e672b at src/libtest/lib.rs:139 35: 0x55c5d81de6b6 - test::main::h314b86d7399b1960 36: 0x55c5d81ddc00 - std::rt::lang_start::{{closure}}::hbaebdb534a364c8b at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/rt.rs:61 37: 0x55c5d8265fc3 - std::rt::lang_start_internal::{{closure}}::h040fbb64fb819fe8 at src/libstd/rt.rs:48 38: 0x55c5d8265fc3 - std::panicking::try::do_call::hfb8f62e9781fa17e at src/libstd/panicking.rs:287 39: 0x55c5d826d1aa - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:79 40: 0x55c5d8266a7d - std::panicking::try::h2aa48346968c7185 at src/libstd/panicking.rs:265 41: 0x55c5d8266a7d - std::panic::catch_unwind::h8da95d989d5c8997 at src/libstd/panic.rs:396 42: 0x55c5d8266a7d - std::rt::lang_start_internal::h298ac725745c4eb6 at src/libstd/rt.rs:47 43: 0x55c5d81ddbd9 - std::rt::lang_start::hce40aa1f7d621390 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/rt.rs:61 44: 0x55c5d81de6ea - main 45: 0x7f5e423d1f2b - __libc_start_main at ../csu/libc-start.c:308 46: 0x55c5d81dc18a - _start 47: 0x0 - ---- roundtrip_lvl_1 stdout ---- thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5 stack backtrace: 0: 0x55c5d8263be4 - backtrace::backtrace::libunwind::trace::h93069dd45e563114 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88 1: 0x55c5d8263be4 - backtrace::backtrace::trace_unsynchronized::ha81d63fb01c61f43 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66 2: 0x55c5d8263be4 - std::sys_common::backtrace::_print_fmt::h5800670bd4856d97 at src/libstd/sys_common/backtrace.rs:77 3: 0x55c5d8263be4 - ::fmt::h8e952e7a864dce8d at src/libstd/sys_common/backtrace.rs:61 4: 0x55c5d8286c5c - core::fmt::write::ha6cd837d898e4a61 at src/libcore/fmt/mod.rs:1030 5: 0x55c5d81e06d5 - std::io::Write::write_fmt::haa9265683e464bfb at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/io/mod.rs:1412 6: 0x55c5d825ea91 - std::io::impls::>::write_fmt::he7c7a5301251df0f at src/libstd/io/impls.rs:141 7: 0x55c5d8265e9e - std::sys_common::backtrace::_print::he810963362c39756 at src/libstd/sys_common/backtrace.rs:65 8: 0x55c5d8265e9e - std::sys_common::backtrace::print::hde04e6d280846a89 at src/libstd/sys_common/backtrace.rs:50 9: 0x55c5d8265e9e - std::panicking::default_hook::{{closure}}::h9d7792d5f2173a87 at src/libstd/panicking.rs:188 10: 0x55c5d8265b38 - std::panicking::default_hook::h9970cb21e5e5b2d4 at src/libstd/panicking.rs:202 11: 0x55c5d826659b - std::panicking::rust_panic_with_hook::hcbf43bd831dd8ef3 at src/libstd/panicking.rs:464 12: 0x55c5d826613e - std::panicking::continue_panic_fmt::h47b6e25372f76c95 at src/libstd/panicking.rs:373 13: 0x55c5d8266026 - rust_begin_unwind at src/libstd/panicking.rs:302 14: 0x55c5d8283a7e - core::panicking::panic_fmt::h24ff570098569537 at src/libcore/panicking.rs:141 15: 0x55c5d8283b77 - core::result::unwrap_failed::hf7d72924a9a2d22c at src/libcore/result.rs:1165 16: 0x55c5d81dd300 - core::result::Result::unwrap::h0830fd1b36ee5052 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libcore/result.rs:933 17: 0x55c5d81ddcbc - test::get_test_file_data::h65896587825f1fc9 at tests/test.rs:11 18: 0x55c5d81dde04 - test::get_test_data::h65a752d85858b18c at tests/test.rs:53 19: 0x55c5d81dde5c - test::roundtrip::h91d60028ff561479 at tests/test.rs:57 20: 0x55c5d81de68b - test::roundtrip_lvl_1::h7254383e6a5eedb4 at tests/test.rs:76 21: 0x55c5d81df0ba - test::roundtrip_lvl_1::{{closure}}::h1ea577cb5ee3e6cd at tests/test.rs:75 22: 0x55c5d81dec0e - core::ops::function::FnOnce::call_once::hc9e28689b5a1b24f at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libcore/ops/function.rs:227 23: 0x55c5d81eb32f - as core::ops::function::FnOnce>::call_once::h19a09fd199a0ff21 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/liballoc/boxed.rs:942 24: 0x55c5d826d1aa - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:79 25: 0x55c5d820690a - std::panicking::try::h1d1a1c5142fbfdd7 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/panicking.rs:265 26: 0x55c5d820690a - std::panic::catch_unwind::h200ca6210a82d128 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/panic.rs:396 27: 0x55c5d820690a - test::run_test_in_process::h766e5938de77f4da at src/libtest/lib.rs:570 28: 0x55c5d820690a - test::run_test::run_test_inner::{{closure}}::h3d3ac74133b541d4 at src/libtest/lib.rs:473 29: 0x55c5d8205fe8 - test::run_test::run_test_inner::he77bc794d3ace3bd at src/libtest/lib.rs:494 30: 0x55c5d8204569 - test::run_test::hba77973327a2fc7f at src/libtest/lib.rs:530 31: 0x55c5d81fa954 - test::run_tests::h5a1270ddd5e0a473 at src/libtest/lib.rs:299 32: 0x55c5d81fa954 - test::console::run_tests_console::h29d755f301130a08 at src/libtest/console.rs:295 33: 0x55c5d82009e4 - test::test_main::hf2bc958b6a636d99 at src/libtest/lib.rs:120 34: 0x55c5d8201961 - test::test_main_static::h90326c29e77e672b at src/libtest/lib.rs:139 35: 0x55c5d81de6b6 - test::main::h314b86d7399b1960 36: 0x55c5d81ddc00 - std::rt::lang_start::{{closure}}::hbaebdb534a364c8b at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/rt.rs:61 37: 0x55c5d8265fc3 - std::rt::lang_start_internal::{{closure}}::h040fbb64fb819fe8 at src/libstd/rt.rs:48 38: 0x55c5d8265fc3 - std::panicking::try::do_call::hfb8f62e9781fa17e at src/libstd/panicking.rs:287 39: 0x55c5d826d1aa - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:79 40: 0x55c5d8266a7d - std::panicking::try::h2aa48346968c7185 at src/libstd/panicking.rs:265 41: 0x55c5d8266a7d - std::panic::catch_unwind::h8da95d989d5c8997 at src/libstd/panic.rs:396 42: 0x55c5d8266a7d - std::rt::lang_start_internal::h298ac725745c4eb6 at src/libstd/rt.rs:47 43: 0x55c5d81ddbd9 - std::rt::lang_start::hce40aa1f7d621390 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/rt.rs:61 44: 0x55c5d81de6ea - main 45: 0x7f5e423d1f2b - __libc_start_main at ../csu/libc-start.c:308 46: 0x55c5d81dc18a - _start 47: 0x0 - ---- roundtrip_lvl_9 stdout ---- thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5 stack backtrace: 0: 0x55c5d8263be4 - backtrace::backtrace::libunwind::trace::h93069dd45e563114 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88 1: 0x55c5d8263be4 - backtrace::backtrace::trace_unsynchronized::ha81d63fb01c61f43 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66 2: 0x55c5d8263be4 - std::sys_common::backtrace::_print_fmt::h5800670bd4856d97 at src/libstd/sys_common/backtrace.rs:77 3: 0x55c5d8263be4 - ::fmt::h8e952e7a864dce8d at src/libstd/sys_common/backtrace.rs:61 4: 0x55c5d8286c5c - core::fmt::write::ha6cd837d898e4a61 at src/libcore/fmt/mod.rs:1030 5: 0x55c5d81e06d5 - std::io::Write::write_fmt::haa9265683e464bfb at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/io/mod.rs:1412 6: 0x55c5d825ea91 - std::io::impls::>::write_fmt::he7c7a5301251df0f at src/libstd/io/impls.rs:141 7: 0x55c5d8265e9e - std::sys_common::backtrace::_print::he810963362c39756 at src/libstd/sys_common/backtrace.rs:65 8: 0x55c5d8265e9e - std::sys_common::backtrace::print::hde04e6d280846a89 at src/libstd/sys_common/backtrace.rs:50 9: 0x55c5d8265e9e - std::panicking::default_hook::{{closure}}::h9d7792d5f2173a87 at src/libstd/panicking.rs:188 10: 0x55c5d8265b38 - std::panicking::default_hook::h9970cb21e5e5b2d4 at src/libstd/panicking.rs:202 11: 0x55c5d826659b - std::panicking::rust_panic_with_hook::hcbf43bd831dd8ef3 at src/libstd/panicking.rs:464 12: 0x55c5d826613e - std::panicking::continue_panic_fmt::h47b6e25372f76c95 at src/libstd/panicking.rs:373 13: 0x55c5d8266026 - rust_begin_unwind at src/libstd/panicking.rs:302 14: 0x55c5d8283a7e - core::panicking::panic_fmt::h24ff570098569537 at src/libcore/panicking.rs:141 15: 0x55c5d8283b77 - core::result::unwrap_failed::hf7d72924a9a2d22c at src/libcore/result.rs:1165 16: 0x55c5d81dd300 - core::result::Result::unwrap::h0830fd1b36ee5052 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libcore/result.rs:933 17: 0x55c5d81ddcbc - test::get_test_file_data::h65896587825f1fc9 at tests/test.rs:11 18: 0x55c5d81dde04 - test::get_test_data::h65a752d85858b18c at tests/test.rs:53 19: 0x55c5d81dde5c - test::roundtrip::h91d60028ff561479 at tests/test.rs:57 20: 0x55c5d81de67b - test::roundtrip_lvl_9::hbbb589037d403d50 at tests/test.rs:71 21: 0x55c5d81df09a - test::roundtrip_lvl_9::{{closure}}::hee71adf26a769dd9 at tests/test.rs:70 22: 0x55c5d81debde - core::ops::function::FnOnce::call_once::had14d0d8939888d8 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libcore/ops/function.rs:227 23: 0x55c5d81eb32f - as core::ops::function::FnOnce>::call_once::h19a09fd199a0ff21 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/liballoc/boxed.rs:942 24: 0x55c5d826d1aa - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:79 25: 0x55c5d820690a - std::panicking::try::h1d1a1c5142fbfdd7 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/panicking.rs:265 26: 0x55c5d820690a - std::panic::catch_unwind::h200ca6210a82d128 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/panic.rs:396 27: 0x55c5d820690a - test::run_test_in_process::h766e5938de77f4da at src/libtest/lib.rs:570 28: 0x55c5d820690a - test::run_test::run_test_inner::{{closure}}::h3d3ac74133b541d4 at src/libtest/lib.rs:473 29: 0x55c5d8205fe8 - test::run_test::run_test_inner::he77bc794d3ace3bd at src/libtest/lib.rs:494 30: 0x55c5d8204569 - test::run_test::hba77973327a2fc7f at src/libtest/lib.rs:530 31: 0x55c5d81fa954 - test::run_tests::h5a1270ddd5e0a473 at src/libtest/lib.rs:299 32: 0x55c5d81fa954 - test::console::run_tests_console::h29d755f301130a08 at src/libtest/console.rs:295 33: 0x55c5d82009e4 - test::test_main::hf2bc958b6a636d99 at src/libtest/lib.rs:120 34: 0x55c5d8201961 - test::test_main_static::h90326c29e77e672b at src/libtest/lib.rs:139 35: 0x55c5d81de6b6 - test::main::h314b86d7399b1960 36: 0x55c5d81ddc00 - std::rt::lang_start::{{closure}}::hbaebdb534a364c8b at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/rt.rs:61 37: 0x55c5d8265fc3 - std::rt::lang_start_internal::{{closure}}::h040fbb64fb819fe8 at src/libstd/rt.rs:48 38: 0x55c5d8265fc3 - std::panicking::try::do_call::hfb8f62e9781fa17e at src/libstd/panicking.rs:287 39: 0x55c5d826d1aa - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:79 40: 0x55c5d8266a7d - std::panicking::try::h2aa48346968c7185 at src/libstd/panicking.rs:265 41: 0x55c5d8266a7d - std::panic::catch_unwind::h8da95d989d5c8997 at src/libstd/panic.rs:396 42: 0x55c5d8266a7d - std::rt::lang_start_internal::h298ac725745c4eb6 at src/libstd/rt.rs:47 43: 0x55c5d81ddbd9 - std::rt::lang_start::hce40aa1f7d621390 at /rustc/4f03f4a989d1c8346c19dfb417a77c09b34408b8/src/libstd/rt.rs:61 44: 0x55c5d81de6ea - main 45: 0x7f5e423d1f2b - __libc_start_main at ../csu/libc-start.c:308 46: 0x55c5d81dc18a - _start 47: 0x0 - failures: roundtrip_lvl_0 roundtrip_lvl_1 roundtrip_lvl_9 test result: FAILED. 4 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out ```
oyvindln commented 4 years ago

Humm, that's odd, the test runs fine on the CI on the latest commits .

oyvindln commented 4 years ago

Ah wait, it probably fails because the test data is excluded from the release package to reduce the package size. Is there a need to have that working on the packaged library?

kentfredric commented 4 years ago

Ideally, if a given test can't be imagined to work on the published crate, that test should be excluded from the published crate.

This could be achieved by moving the handful of tests that require the test data to their own test, then you can exclude both those tests and the test data.

oyvindln commented 4 years ago

I've excluded the tests directory from the published crate. Does that fix it?

kentfredric commented 4 years ago

That should fix it. Ideally, you should split the tests into ones that can be expected to work when published, and ones that aren't, and then exclude only the ones that aren't.

That way you have at least some tests.

oyvindln commented 4 years ago

There are still some tests, it's just the ones in test.rs that are excluded.