rust-fuzz / arbitrary

Generating structured data from arbitrary, unstructured input.

Home Page:https://docs.rs/arbitrary/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

one_lifetime and two_lifetimes tests fail on 32 bit.

plugwash opened this issue · comments

Hi

rust-arbitrary's tests are failing on Debian's QA infrastruture when built with the "derive" feature, specifically.

---- one_lifetime stdout ----
thread 'one_lifetime' panicked at 'assertion failed: (left == right)
left: 4,
right: 8', tests/derive.rs:167:5
stack backtrace:
0: rust_begin_unwind
at /usr/src/rustc-1.56.0/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /usr/src/rustc-1.56.0/library/core/src/panicking.rs:101:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /usr/src/rustc-1.56.0/library/core/src/panicking.rs:140:5
4: derive::one_lifetime
at ./tests/derive.rs:167:5
5: derive::one_lifetime::{{closure}}
at ./tests/derive.rs:160:1
6: core::ops::function::FnOnce::call_once
at /usr/src/rustc-1.56.0/library/core/src/ops/function.rs:227:5
7: core::ops::function::FnOnce::call_once
at /usr/src/rustc-1.56.0/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

---- two_lifetimes stdout ----
thread 'two_lifetimes' panicked at 'assertion failed: (left == right)
left: 8,
right: 16', tests/derive.rs:186:5
stack backtrace:
0: rust_begin_unwind
at /usr/src/rustc-1.56.0/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /usr/src/rustc-1.56.0/library/core/src/panicking.rs:101:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /usr/src/rustc-1.56.0/library/core/src/panicking.rs:140:5
4: derive::two_lifetimes
at ./tests/derive.rs:186:5
5: derive::two_lifetimes::{{closure}}
at ./tests/derive.rs:178:1
6: core::ops::function::FnOnce::call_once
at /usr/src/rustc-1.56.0/library/core/src/ops/function.rs:227:5
7: core::ops::function::FnOnce::call_once
at /usr/src/rustc-1.56.0/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

I'm guessing this is a testsuite issue and that the values should be changed to be the size of a pointer and twice the size of a pointer respectively rather than hardcoded values of 8 and 16 but I'd like confirmation from someone who actually understands the code.

Yeah these tests should be using std::mem::size_of::<usize>()