Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bytecheck: Test failed on s390x arch #13

Closed
ghost opened this issue Aug 5, 2021 · 6 comments
Closed

bytecheck: Test failed on s390x arch #13

ghost opened this issue Aug 5, 2021 · 6 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@ghost
Copy link

ghost commented Aug 5, 2021

Hi. Test doesn't pass on fedora koji. https://kojipkgs.fedoraproject.org//work/tasks/8977/73358977/build.log

Doc-tests bytecheck
Running /usr/bin/rustdoc --edition=2018 --crate-type lib --crate-name bytecheck --test /builddir/build/BUILD/bytecheck-0.6.4/src/lib.rs -L dependency=/builddir/build/BUILD/bytecheck-0.6.4/target/release/deps -L dependency=/builddir/build/BUILD/bytecheck-0.6.4/target/release/deps --extern bytecheck=/builddir/build/BUILD/bytecheck-0.6.4/target/release/deps/libbytecheck-6182913b9b122bd5.rlib --extern bytecheck_derive=/builddir/build/BUILD/bytecheck-0.6.4/target/release/deps/libbytecheck_derive-ae0ba2c0d5d67af6.so --extern ptr_meta=/builddir/build/BUILD/bytecheck-0.6.4/target/release/deps/libptr_meta-10321bd094699b9d.rlib -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' --error-format human
running 1 test
test src/lib.rs - (line 23) ... FAILED
failures:
---- src/lib.rs - (line 23) stdout ----
Test executable failed (exit code 101).
stderr:
thread 'main' panicked at 'called Result::unwrap() on an Err value: StructCheckError { field_name: "c", inner: CharCheckError { invalid_value: 2013265920 } }', src/lib.rs:33:7
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@djkoloski djkoloski self-assigned this Aug 5, 2021
@djkoloski djkoloski added the bug Something isn't working label Aug 5, 2021
@djkoloski
Copy link
Collaborator

Taking a look at this. Out of curiosity, do you know if the tests passed for the last published version? I believe you were involved in packaging before the latest release. I did have some minor code changes, but made larger changes to the tests to eliminate some bad behavior under miri. This might just be me goofing up the code for some tests.

@ghost
Copy link
Author

ghost commented Aug 5, 2021

I use the version 0.6.4 in fedora for the first repo import. That should be the latest, but I don't know if it changes the test result, since fedora Corp s390x support is unreliable.

@djkoloski
Copy link
Collaborator

Okay, thanks for the help. I'll see if I can pick this one apart a little better and update when I know more.

@djkoloski
Copy link
Collaborator

Alright, I think this is a pretty simple endianness issue. In order to validate that bytecheck can accept/reject byte buffers properly, the tests validate byte arrays. A while ago, the tests in the tests crate were updated to use different byte arrays for little- and big-endian architectures. The doctests were never updated to have the same.

The fix for this should just be providing two byte arrays to validate for each test in that doctest, one for little-endian machines and one for big-endian machines. I will verify that the error is reproduced on a big-endian architecture then proceed to make the doctest fix and publish a new version.

Thanks for the report and sorry for the inconvenience!

@djkoloski djkoloski added the documentation Improvements or additions to documentation label Aug 5, 2021
@djkoloski
Copy link
Collaborator

I am having a lot of trouble testing this one. The error in question is specific to big-endian machines and while I can easily ensure that the code compiles on big-endian architectures, it is difficult for me to test. I'll be looking into more ways to test this. In the meantime, I have pushed a tentative fix in df6420a and published version 0.6.5 with the change. Please reopen this issue or file a new one if that fix does not work, I would really like to get everything working for you.

@ghost
Copy link
Author

ghost commented Aug 15, 2021

Test work now! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant