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

'export_key_pair_test' panicked at 'called Result::unwrap() on an Err value: StorageFailure' #46

Closed
eclipseo opened this issue Jul 21, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@eclipseo
Copy link

I've got this test failure for rust-1.45.0 on Fedora Rawhide:

---- export_key_pair_test stdout ----
thread 'export_key_pair_test' panicked at 'called `Result::unwrap()` on an `Err` value: StorageFailure', tests/mod.rs:155:22
stack backtrace:
   0:     0x559ebc0118a5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h83fd459720a1b780
   1:     0x559ebc0358dc - core::fmt::write::h0fb2c8a7c74dc706
   2:     0x559ebbf8c0a5 - std::io::Write::write_fmt::hb203e303045fd2e8
   3:     0x559ebc00bcb1 - std::io::impls::<impl std::io::Write for alloc::boxed::Box<W>>::write_fmt::hbcb41256641e1664
   4:     0x559ebc0140d0 - std::panicking::default_hook::{{closure}}::hbb12a969b90f30ab
   5:     0x559ebc013dca - std::panicking::default_hook::hd46a6f05cd95ae1c
   6:     0x559ebc014707 - std::panicking::rust_panic_with_hook::hfaf36f07e96e1a70
   7:     0x559ebc01430b - rust_begin_unwind
   8:     0x559ebc034281 - core::panicking::panic_fmt::ha79c22c8889dbf6b
   9:     0x559ebc0340a3 - core::option::expect_none_failed::he9f78d166510670b
  10:     0x559ebbf8a659 - core::result::Result<T,E>::unwrap::h3e1a442c611a1234
                               at /builddir/build/BUILD/rustc-1.45.0-src/src/libcore/result.rs:1005
  11:     0x559ebbf8a659 - mod::test_tools::TestClient::import::h2b975496b53e491a
                               at tests/mod.rs:155
  12:     0x559ebbf8a659 - mod::export_key_pair_test::hc1fe2c966e9ab52a
                               at tests/mod.rs:124
  13:     0x559ebbf8a659 - mod::export_key_pair_test::{{closure}}::hfebe911071c9ccf8
                               at tests/mod.rs:82
  14:     0x559ebbf8a659 - core::ops::function::FnOnce::call_once::hb7c8e6f4e27a34b4
                               at /builddir/build/BUILD/rustc-1.45.0-src/src/libcore/ops/function.rs:232
  15:     0x559ebbfb33b2 - test::run_test::run_test_inner::{{closure}}::h8ead2fffa18ec440
  16:     0x559ebbf8b566 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0514d4ec185c1c32
  17:     0x559ebbf906e5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h6d24acaff99ea573
  18:     0x559ebc01a9da - std::sys::unix::thread::Thread::new::thread_start::h4354789cb8f1f413
  19:     0x7f601626d53a - start_thread
  20:     0x7f601617e283 - __GI___clone
  21:                0x0 - <unknown>
@hug-dev
Copy link
Member

hug-dev commented Jul 21, 2020

Hi @eclipseo ,

Thanks for the bug report!
The Mbed Crypto implementation is not thread safe so running the test with the default command is likely to trigger errors. In the CI, we run the tests with:

cargo test -- --test-threads=1

We use Mbed Crypto as our default implementation of PSA Crypto but our code should be agnostic to which implementation is used. We decided not to include in our code a Mbed Crypto specific fix.

Hopefully Mbed Crypto is going to fix this soon, but if you think this is critical, we can see of ways to fix this only for when Mbed Crypto is used, by default.

@hug-dev hug-dev added the bug Something isn't working label Jul 21, 2020
@eclipseo
Copy link
Author

Thanks! I will try your CI solution!

edit: Success! Thanks!

@hug-dev hug-dev closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants