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

AVX512 Serpent amalgamation tests fail with GCC #4454

Open
arckoor opened this issue Dec 2, 2024 · 3 comments
Open

AVX512 Serpent amalgamation tests fail with GCC #4454

arckoor opened this issue Dec 2, 2024 · 3 comments

Comments

@arckoor
Copy link

arckoor commented Dec 2, 2024

When running ci_build.py --cc='gcc' amalgamation on a machine that supports the avx512 instruction set, various tests fail: 659 tests failed (in block_ciphers cipher_modes cryptobox stream_ciphers).
Tested on the master branch with commit 823bcb4. I used act to emulate the Github runners like so: act -P ubuntu-22.04=catthehacker/ubuntu:full-22.04 -j linux &> act-log.txt, and commented out everything but the gcc/amalgamation job in ci.yml.
I tested on different machines with different underlying cpu models, and all failed in the same way.
act-log-08-linux.txt
act-log-12-linux.txt

@randombit
Copy link
Owner

This is almost certainly a miscompilation. There was a similar one affecting Serpent AVX2 with GCC in amalgamation build, for which a workaround was found. Unfortunately reducing the amalgamation to a test case that GCC devs will accept is non trivial.

I would suggest any of

  • Use Clang instead
  • Disable serpent_avx512 module
  • Consider using --minimized-build and then explicitly enabling the features you need/use (eg --enable-modules=ecdsa,sha2_32,aes,gcm,x509,...)

@arckoor
Copy link
Author

arckoor commented Dec 3, 2024

Yea, with clang it does work without issue. As far as I know we currently do not need the feature at all, I just happened to notice while testing for #4443. Feel free to close / ping me again to test should any potential fixes arise.

@randombit randombit changed the title AVX512 amalgamation tests fail AVX512 amalgamation tests fail with GCC Dec 19, 2024
@randombit randombit changed the title AVX512 amalgamation tests fail with GCC AVX512 Serpent amalgamation tests fail with GCC Dec 19, 2024
@thesamesam
Copy link

thesamesam commented Dec 22, 2024

Unfortunately reducing the amalgamation to a test case that GCC devs will accept is non trivial.

If you can turn it into a standalone file, even if huge, that has some main() which aborts on a bad condition, I can try reduce it. (That would include taking the amalgamation and just adding a main which calls the right test function, if that works.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants