userfaultfd-rs icon indicating copy to clipboard operation
userfaultfd-rs copied to clipboard

test suite failures on powerpc64le (64K page-size related?)

Open decathorpe opened this issue 2 years ago • 0 comments

I'm working on packaging the userfaultfd crate for Fedora Linux, as a dependency of wasmtime. As part of our build process for Rust crates, we attempt to run the test suite on all our architectures, to try to ensure any crates we package and provide support for actually works on the architectures we claim to support.

The userfaultfd crate's test suite completes successfully on all architectures we support (x86_64, i686, armhfp, aarch64, s390x; so 64-bit, 32-bit, little- and big-endian, x86 and non-x86), except powerpc64le. There, it looks like some of the unit tests are failing:

     Running `/builddir/build/BUILD/userfaultfd-0.4.2/target/release/deps/userfaultfd-b77bafb189fea694`
running 3 tests
test test::test_read_event ... FAILED
test test::test_nonblocking_read_event ... FAILED
test test::test_read_events ... FAILED
failures:
---- test::test_read_event stdout ----
Error: SystemError(EINVAL)
thread 'test::test_read_event' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /builddir/build/BUILD/rustc-1.60.0-src/library/test/src/lib.rs:187:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- test::test_nonblocking_read_event stdout ----
Error: SystemError(EINVAL)
thread 'test::test_nonblocking_read_event' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /builddir/build/BUILD/rustc-1.60.0-src/library/test/src/lib.rs:187:5
---- test::test_read_events stdout ----
Error: SystemError(EINVAL)
thread 'test::test_read_events' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /builddir/build/BUILD/rustc-1.60.0-src/library/test/src/lib.rs:187:5
failures:
    test::test_nonblocking_read_event
    test::test_read_event
    test::test_read_events
test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Looking at the code, the failing tests expect page size to be 4KiB. However, depending on the kernel configuration, page size on powerpc64le systems is often 64KiB instead (which is the case in Fedora Linux). Could this be the source of the problem for the failing tests?

If that is indeed the source of the problem, can I safely ignore these test failures? It looks like PAGE_SIZE is only ever used in these unit tests, and not in the actual library code of this crate.

decathorpe avatar Apr 15 '22 11:04 decathorpe