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

bcrypt 4.0.0 test failure on 32bit arch #407

Open
wally-mageia opened this issue Sep 6, 2022 · 4 comments
Open

bcrypt 4.0.0 test failure on 32bit arch #407

wally-mageia opened this issue Sep 6, 2022 · 4 comments

Comments

@wally-mageia
Copy link

wally-mageia commented Sep 6, 2022

Tests fails due to a segfault on 32bit Mageia Cauldron, the development version of the distro. I can reproduce the issue also with Fedora 36 bcrypt mock build. Mock is a tool for a reproducible build of RPM packages.

+ /usr/bin/python3 -m tox --current-env -q --recreate -e py310
============================= test session starts ==============================
platform linux -- Python 3.10.6, pytest-7.1.3, pluggy-1.0.0
cachedir: .tox/py310/.pytest_cache
rootdir: /builddir/build/BUILD/bcrypt-4.0.0
collected 150 items

tests/test_bcrypt.py ................................................... [ 34%]
........................................................................ [ 82%]
..Fatal Python error: Segmentation fault

Current thread 0xf7938700 (most recent call first):
  File "/builddir/build/BUILDROOT/python-bcrypt-4.0.0-1.mga9.i386/usr/lib/python3.10/site-packages/bcrypt/__init__.py", line 127 in kdf
  File "/builddir/build/BUILD/bcrypt-4.0.0/tests/test_bcrypt.py", line 443 in test_kdf
  File "/usr/lib/python3.10/site-packages/_pytest/python.py", line 192 in pytest_pyfunc_call
  File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.10/site-packages/_pytest/python.py", line 1761 in runtest
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 166 in pytest_runtest_call
  File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 259 in <lambda>
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 338 in from_call
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 258 in call_runtest_hook
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 219 in call_and_report
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 130 in runtestprotocol
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 111 in pytest_runtest_protocol
  File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 347 in pytest_runtestloop
  File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 322 in _main
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 268 in wrap_session
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 315 in pytest_cmdline_main
  File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 164 in main
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 187 in console_main
  File "/usr/lib/python3.10/site-packages/pytest/__main__.py", line 5 in <module>
  File "/usr/lib/python3.10/site-packages/coverage/execfile.py", line 199 in run
  File "/usr/lib/python3.10/site-packages/coverage/cmdline.py", line 830 in do_run
  File "/usr/lib/python3.10/site-packages/coverage/cmdline.py", line 659 in command_line
  File "/usr/lib/python3.10/site-packages/coverage/cmdline.py", line 943 in main
  File "/usr/bin/coverage", line 8 in <module>
ERROR: InvocationError for command /usr/bin/coverage run -m pytest --strict-markers (exited with code -11 (SIGSEGV)) (exited with code -11)
___________________________________ summary ____________________________________
ERROR:   py310: commands failed

Full build logs available in Fedora COPR, mageia-cauldron-i586 builder-live.log.gz.

@alex
Copy link
Member

alex commented Sep 6, 2022

Interesting. We don't test on 32-bit x86 on Linux, but we do on Windows.

Is it possible to get a C backtrace for the segfault?

@wally-mageia
Copy link
Author

I was not able to produce any reasonable C backtrace, but all tests succeeds if bcrypt is built and Rust crates are created with RUSTFLAGS='-Ccodegen-units=1'.

Build log for successful build is in Fedora COPR, mageia-cauldron-i586 builder-live.log.gz. Other flags are also used in RUSTFLAGS, but -Ccodegen-units=1 is the one fixing the tests.

@alex
Copy link
Member

alex commented Sep 7, 2022

That's perplexing, and suggests an LLVM or rustc bug. Or maybe a bcrypt bug that just happens to get triggered by this.

@mweinelt
Copy link

mweinelt commented Oct 1, 2022

Also happens on NixOS i686-linux with Rust 1.63.0, python 3.10.7. I can narrow it down to this test:

tests/test_bcrypt.py::test_kdf[4-password-salt-[\xbf\x0c\xc2\x93X\x7f\x1c65U'ye\x98\xd4W\x90q\xbfB\x9d\x8f\xbe\x84*\xba4\xd9] Fatal Python error: Segmentation fault

Disabling test_kdf makes the remaining tests succeed.

mweinelt added a commit to mweinelt/nixpkgs that referenced this issue Oct 12, 2022
The latest bcrypt version segfaults during test_kdf, which prevents the
package from building. The package is in the critical chain for many
NixOS tests, which currently won't complete on i686-linux.

Upstream-Issue: pyca/bcrypt#407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants