Description
Is there an existing issue for this?
- I have searched the existing issues
Code of Conduct
- I agree to follow this project's Code of Conduct
Current Behaviour
Running Cryptle on Enarx on recent macOS crashes:
cryptle on main (dfc6c9) is 📦 v0.2.0 via 🦀 v1.75.0-beta.1 took 4s
❯ enarx run --wasmcfgfile Enarx.toml target/wasm32-wasi/release/cryptle.wasm
Error: failed to execute default function
Caused by:
0: error while executing at wasm backtrace:
0: 0x43775 - <unknown>!wasi::lib_generated::fd_read::h5fd7a313be5fb89f
1: 0x41343 - <unknown>!<&std::net::tcp::TcpStream as std::io::Read>::read::h00af9de941b8432d
2: 0x26c5a - <unknown>!<mio::net::tcp::stream::TcpStream as std::io::Read>::read::hd219e1e0e9060a20
3: 0x1530 - <unknown>!mini_http::Server::start::hc710df37d4842fac
4: 0x5f21 - <unknown>!cryptle::main::hea7128aeec1ca321
5: 0xbcf8 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h5ca8022303025d61
6: 0xa9e0 - <unknown>!std::rt::lang_start::{{closure}}::h981c07976ef4e8e8
7: 0x3f38b - <unknown>!std::rt::lang_start_internal::h92f85408d3688c9b
8: 0xa9c3 - <unknown>!std::rt::lang_start::h63eba1c273f57656
9: 0x6174 - <unknown>!__main_void
10: 0x92a - <unknown>!_start
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information
1: Unknown OS error
2: operation would block
(base)
cryptle on main (dfc6c9) is 📦 v0.2.0 via 🦀 v1.75.0-beta.1 took 51s
❯ WASMTIME_BACKTRACE_DETAILS=1 enarx run --wasmcfgfile Enarx.toml target/wasm32-wasi/release/cryptle.wasm
Error: failed to execute default function
Caused by:
0: error while executing at wasm backtrace:
0: 0x43775 - wasi::lib_generated::fd_read::h5fd7a313be5fb89f
at /rust/deps/wasi-0.11.0+wasi-snapshot-preview1/src/lib_generated.rs:1568:15
1: 0x41343 - std::sys::wasi::fd::WasiFd::read::h33f555eba0ff2940
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/sys/wasi/fd.rs:52:18 - std::sys::wasi::net::TcpStream::read_vectored::h2b96bd3914a76775
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/sys/wasi/net.rs:101:9 - std::sys::wasi::net::TcpStream::read::h27d9e4718c96470e
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/sys/wasi/net.rs:93:9 - <&std::net::tcp::TcpStream as std::io::Read>::read::h00af9de941b8432d
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/net/tcp.rs:658:9
2: 0x26c5a - <unknown>!<mio::net::tcp::stream::TcpStream as std::io::Read>::read::hd219e1e0e9060a20
3: 0x1530 - <unknown>!mini_http::Server::start::hc710df37d4842fac
4: 0x5f21 - <unknown>!cryptle::main::hea7128aeec1ca321
5: 0xbcf8 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h5ca8022303025d61
6: 0xa9e0 - <unknown>!std::rt::lang_start::{{closure}}::h981c07976ef4e8e8
7: 0x3f38b - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hc0c8a7eff862c811
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/core/src/ops/function.rs:284:13 - std::panicking::try::do_call::hee157fb4a8a90efb
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/panicking.rs:552:40 - std::panicking::try::h202d2225273ceb79
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/panicking.rs:516:19 - std::panic::catch_unwind::h45d2e918eb31f137
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/panic.rs:142:14 - std::rt::lang_start_internal::{{closure}}::h4f4f75c47234b152
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/rt.rs:148:48 - std::panicking::try::do_call::h480fb9dbfea1e29a
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/panicking.rs:552:40 - std::panicking::try::h58ed8e12a767e5dd
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/panicking.rs:516:19 - std::panic::catch_unwind::he76e19c22ed15186
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/panic.rs:142:14 - std::rt::lang_start_internal::h92f85408d3688c9b
at /rustc/782883f609713fe9617ba64d90086742ec62d374/library/std/src/rt.rs:148:20
8: 0xa9c3 - <unknown>!std::rt::lang_start::h63eba1c273f57656
9: 0x6174 - <unknown>!__main_void
10: 0x92a - <unknown>!_start
1: Unknown OS error
2: operation would block
cryptle on main (dfc6c9) is 📦 v0.2.0 via 🦀 v1.75.0-beta.1 took 15s
I suspect this is Wasmtime related since the first crash mentions using the WASMTIME_BACKTRACE_DETAILS
environment variable for more details.
cargo test
on macOS has a similar issue with the Unknown OS error
, and operation would block
, and both crashes are related to listening for incoming TLS connections:
❯ cargo test
Finished test [unoptimized + debuginfo] target(s) in 0.74s
Running unittests src/main.rs (target/debug/deps/enarx-0334163cb85e7e1f)
running 4 tests
test exec::test::coverage ... ok
test backend::nil::test::coverage ... ok
test cli::platform::info::test::test_info_json ... ok
test cli::platform::info::test::test_info ... ok
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/integration.rs (target/debug/deps/integration-3a86040b20481c38)
running 14 tests
test client::test_config_init ... ok
test wasm::hello_wasi_snapshot1 ... ok
Error: failed to get default function
Caused by:
default export in '' is not a function
test wasm::no_export ... ok
test wasm::return_1 ... ok
test wasm::wasi_snapshot1 ... ok
test client::full ... ok
test wasm::memory_stress_test ... ok
test wasm::memspike ... ok
test wasm::echo ... ok
test wasm::zerooneone ... ok
test wasm::zerooneone_pkg ... ok
test wasm::connect_tcp ... ok
test wasm::listen_tcp ... ok
Error: failed to execute default function
Caused by:
0: error while executing at wasm backtrace:
0: 0x3167a - <unknown>!wasi::lib_generated::fd_read::h1fcd502250db20a8
1: 0x2cebf - <unknown>!<std::fs::File as std::io::Read>::read_buf::h8adf939d301eeec5
2: 0x9623 - <unknown>!std::io::impls::<impl std::io::Read for &mut R>::read_buf::h2960f371557d6083
3: 0x9681 - <unknown>!std::io::impls::<impl std::io::Read for &mut R>::read_buf::ha58c529cc6139808
4: 0xebd5 - <unknown>!std::io::buffered::bufreader::buffer::Buffer::fill_buf::h2ff88d7a5255fd34
5: 0xea59 - <unknown>!<std::io::buffered::bufreader::BufReader<R> as std::io::BufRead>::fill_buf::hdf848271e2cba022
6: 0xd826 - <unknown>!std::io::read_until::h83b2c674b8c59535
7: 0xde76 - <unknown>!std::io::BufRead::read_line::{{closure}}::h76d3cad979656f13
8: 0xdc59 - <unknown>!std::io::append_to_string::had700a6b2086f8da
9: 0xe769 - <unknown>!std::io::BufRead::read_line::h40020b0fa45d4c65
10: 0x7686 - <unknown>!enarx_wasm_tests::assert_copy_line::h02f62084035aeddc
11: 0x73ee - <unknown>!enarx_wasm_tests::assert_stream::h9f3be7a54c96bc06
12: 0x2d5c - <unknown>!listen::main::h21bc6ef786c10cf4
13: 0x1195a - <unknown>!core::ops::function::FnOnce::call_once::h5a80192c89053fb7
14: 0x129d - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h6b94ab2e96aadf3e
15: 0x834f - <unknown>!std::rt::lang_start::{{closure}}::h22cd5b65b6559693
16: 0x2aefb - <unknown>!std::rt::lang_start_internal::h6c23e823dc99289d
17: 0x82eb - <unknown>!std::rt::lang_start::hf2f9d375331a8299
18: 0x371e - <unknown>!__main_void
19: 0x9e1 - <unknown>!_start
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information
1: Unknown OS error
2: operation would block
test wasm::listen_tls ... FAILED
failures:
---- wasm::listen_tls stdout ----
waiting for workload to start...
thread '<unnamed>' panicked at 'failed to assert TLS connection: failed to assert first stream
Caused by:
0: failed to copy third line
1: failed to read line
2: Connection reset by peer (os error 54)', tests/wasm/mod.rs:565:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'wasm::listen_tls' panicked at 'assertion failed: `(left == right)`
left: `1`,
right: `0`: Expected exit status differs.', tests/integration.rs:398:5
failures:
wasm::listen_tls
test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 10.79s
error: test failed, to rerun pass `--test integration`
enarx on main (3325d71) [?] is 📦 v0.7.1 via 🦀 v1.70.0-nightly took 11s
What's interesting about Cryptle is that running Enarx & Cryptle without Enarx.toml has an error about bad file descriptor. Running Enarx & Cryptle with the Enarx.toml works initially:
- Open browser, go to
localhost:10030
- Browser complains about connection dropping early.
- Change URL to
https://localhost:10030
- Browser complains the SSL cert isn't known.
- Make the browser connect anyway.
- Then the crash happens.
So the crash happens I think when data is going to be transferred, not at Wasm load time, and not at Enarx conf from Enarx.toml
. And as mentioned above, the unit test for listen_tls
is what fails, so a TLS error it seems. Either related to TLS itself, or maybe use of the host's SSL certs? Are Wasmtime and Enarx competing for who gets to do TLS stuff?
Expected Behaviour
Enarx should be able to run Cryptle, and unit tests should pass.
Environment Information
• Enarx 0.7.1 with Wasmtime 5.0.1, git hash 3325d71
• macOS Sonoma 14.1.1, Ventura 13.6.2
❯ enarx --version
enarx 0.7.1
enarx on main (3325d71) [?] is 📦 v0.7.1 via 🦀 v1.70.0-nightly
❯ enarx platform info
Enarx version 0.7.1
System Info: Darwin 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103 arm64
✗ Backend: sgx
✗ Backend: sev
✗ Backend: kvm
✔ Backend: nil
enarx on main (3325d71) [?] is 📦 v0.7.1 via 🦀 v1.70.0-nightly
❯ uname -a
Darwin Tycho.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103 arm64
enarx on main (3325d71) [?] is 📦 v0.7.1 via 🦀 v1.70.0-nightly
Steps To Reproduce
- Checkout Enarx on macOS
cargo test
Metadata
Metadata
Assignees
Type
Projects
Status