GithubHelp home page GithubHelp logo

facebookexperimental / hermit Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 31.0 1.9 MB

Hermit launches linux x86_64 programs in a special, hermetically isolated sandbox to control their execution. Hermit translates normal, nondeterministic behavior, into deterministic, repeatable behavior. This can be used for various applications, including replay-debugging, reproducible artifacts, chaos mode concurrency testing and bug analysis.

License: Other

Shell 2.36% Rust 92.14% Python 0.61% C 3.70% C++ 0.35% Starlark 0.82% Go 0.03%

hermit's People

Contributors

andreasbackx avatar c-ryan747 avatar cooperlees avatar danielocfb-test avatar davidbarsky avatar diliop avatar edward-shen avatar facebook-github-bot avatar ifd3f avatar jasonwhite avatar kapji avatar kotborealis avatar krallin avatar markisaa avatar mjhostet avatar rrnewton avatar sergik avatar vladimirmakaev avatar zertosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hermit's Issues

Implement key management (keyctl and friends)

This is a currently unhandled piece of Linux functionality that we just "let through". But it introduces nondeterminism in the key_serial_t identifiers that come back.

Basic plan:

  • virtualize the key serials just like with other IDs (e.g. inodes)
  • make sure that our container setup keeps the process tree's keys separate from anything else on the system

Specific steps for virtualizating IDs would include:

  • add a new global state RPC for adding/resolving key serial numbers
  • have local handlers for add_key establish the new virtual mapping, and return the virtual serial ID to the guest, which probably starts at a constant and counts up by +1
  • have request_key and keyctl calls resolve virtual serial numbers before issuing to Linux

Relevant manpages:

Panic on hello world java program

Describe the bug
A simple Java program executed under hermit causes a panic.

Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Minimal input to reproduce the behavior.

$ cat HelloWorld.java 
public class HelloWorld {
	public static void main(String[] args) throws Exception {
		System.out.println("Hello world!");
	}
}
$ javac HelloWorld.java && RUST_BACKTRACE=1 hermit/target/debug/hermit run --summary -- java HelloWorld
WARNING: --preemption-timout requires hardware perf counters which is not supported on this host, resetting preemption-timeout to 0
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/sitowert/hermit/detcore/src/lib.rs:592:36
stack backtrace:
   0: rust_begin_unwind
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/panicking.rs:65:14
   2: core::panicking::panic
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/panicking.rs:114:5
   3: core::option::Option<T>::unwrap
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/option.rs:778:21
   4: detcore::<impl reverie::tool::Tool for detcore::tool_local::Detcore<T>>::handle_cpuid_event::{{closure}}
             at ./hermit/detcore/src/lib.rs:592:13
   5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll{{reify.shim}}
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:86:9
   7: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
   8: reverie_ptrace::task::TracedTask<L>::handle_cpuid::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:802:13
   9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  10: reverie_ptrace::task::TracedTask<L>::handle_sigsegv::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:952:51
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  12: reverie_ptrace::task::TracedTask<L>::handle_signal::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:974:57
  13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  14: reverie_ptrace::task::TracedTask<L>::handle_stop_event::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:867:67
  15: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  16: <futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/fuse.rs:86:37
  17: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
  18: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
  19: futures_util::future::future::FutureExt::poll_unpin
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/mod.rs:562:9
  20: reverie_ptrace::task::TracedTask<L>::run_loop_internal::{{closure}}::{{closure}}::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  21: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/ops/function.rs:617:13
  22: reverie_ptrace::task::TracedTask<L>::run_loop_internal::{{closure}}::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  23: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/poll_fn.rs:56:9
  24: reverie_ptrace::task::TracedTask<L>::run_loop_internal::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1430:34
  25: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  26: reverie_ptrace::task::TracedTask<L>::run_loop::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1374:43
  27: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  28: <futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/fuse.rs:86:37
  29: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
  30: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
  31: futures_util::future::future::FutureExt::poll_unpin
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/mod.rs:562:9
  32: reverie_ptrace::task::TracedTask<L>::run::{{closure}}::{{closure}}::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  33: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/ops/function.rs:617:13
  34: reverie_ptrace::task::TracedTask<L>::run::{{closure}}::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  35: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/poll_fn.rs:56:9
  36: reverie_ptrace::task::TracedTask<L>::run::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1458:13
  37: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  38: reverie_ptrace::task::TracedTask<L>::handle_new_task::{{closure}}::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1162:40
  39: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  40: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/core.rs:208:17
  41: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/loom/std/unsafe_cell.rs:14:9
  42: tokio::runtime::task::core::Core<T,S>::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/core.rs:197:13
  43: tokio::runtime::task::harness::poll_future::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:483:19
  44: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/panic/unwind_safe.rs:271:9
  45: std::panicking::try::do_call
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:483:40
  46: __rust_try
  47: std::panicking::try
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panicking.rs:447:19
  48: std::panic::catch_unwind
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/panic.rs:137:14
  49: tokio::runtime::task::harness::poll_future
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:471:18
  50: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:107:27
  51: tokio::runtime::task::harness::Harness<T,S>::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:61:15
  52: tokio::runtime::task::raw::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/raw.rs:194:5
  53: tokio::runtime::task::raw::RawTask::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/raw.rs:134:18
  54: tokio::runtime::task::LocalNotified<S>::run
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/mod.rs:430:9
  55: tokio::task::local::LocalSet::tick::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:616:63
  56: tokio::runtime::coop::with_budget
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:102:5
  57: tokio::runtime::coop::budget
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:68:5
  58: tokio::task::local::LocalSet::tick
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:616:31
  59: <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:928:16
  60: tokio::task::local::LocalSet::with::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:685:13
  61: std::thread::local::LocalKey<T>::try_with
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/thread/local.rs:446:16
  62: std::thread::local::LocalKey<T>::with
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/thread/local.rs:422:9
  63: tokio::task::local::LocalSet::with
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:668:9
  64: <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:914:9
  65: tokio::task::local::LocalSet::run_until::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:574:18
  66: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  67: reverie_ptrace::tracer::Tracer<G>::wait::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/tracer.rs:136:59
  68: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  69: hermit::run::{{closure}}
             at ./hermit/hermit-cli/src/lib.rs:83:68
  70: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
  71: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
  72: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:531:57
  73: tokio::runtime::coop::with_budget
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:102:5
  74: tokio::runtime::coop::budget
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:68:5
  75: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:531:25
  76: tokio::runtime::scheduler::current_thread::Context::enter
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:340:19
  77: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:530:36
  78: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:601:57
  79: tokio::macros::scoped_tls::ScopedKey<T>::set
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/macros/scoped_tls.rs:61:9
  80: tokio::runtime::scheduler::current_thread::CoreGuard::enter
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:601:27
  81: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:520:19
  82: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:154:24
  83: tokio::runtime::runtime::Runtime::block_on
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/runtime.rs:279:47
  84: hermit::run
             at ./hermit/hermit-cli/src/lib.rs:85:5
  85: hermit::run::RunOpts::run_in_container
             at ./hermit/hermit-cli/src/bin/hermit/run.rs:933:9
  86: hermit::run::RunOpts::run::{{closure}}
             at ./hermit/hermit-cli/src/bin/hermit/run.rs:737:43
  87: hermit::container::with_container::{{closure}}
             at ./hermit/hermit-cli/src/bin/hermit/container.rs:44:17
  88: reverie_process::container::Container::run::{{closure}}::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-process/src/container.rs:794:68
  89: core::result::Result<T,E>::map
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/result.rs:775:25
  90: reverie_process::container::Container::run::{{closure}}
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-process/src/container.rs:794:29
  91: <alloc::boxed::Box<F,A> as core::ops::function::FnMut<Args>>::call_mut
             at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/alloc/src/boxed.rs:2016:9
  92: reverie_process::clone::clone_with_stack::callback
             at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-process/src/clone.rs:29:9
  93: __GI___clone
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Expected behavior
Hermit can handle the execution of Java programs on the JVM.

Environment

  • Linux kernel version (uname -a): Linux goo 5.19.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.11-1 (2022-09-24) x86_64 GNU/Linux
  • CPU version (/proce/cpuinfo): 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  • Linux distro flavor (/etc/issue, /etc/redhat-release): Debian GNU/Linux bookworm/sid

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run.

log.txt

Add any other context about the problem here.

Misaligned Pointer Dereference with every "hermit run"

Describe the bug
A clear and concise description of what the bug is.

Any hermit run <target> fails with a `misaligned pointer dereference: address must be a multiple of 0x8 but is ..."
The exact address differs slightly, but it must always be a multiple of 0x8, and is not.

Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Minimal input to reproduce the behavior.

hermit run ./rand.py

Expected behavior
A clear and concise description of what you expected to happen.
rand.py should execute with a deterministic string of numbers.

Environment

  • [X ] Linux kernel version (uname -a): Linux S1030755 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • [ X] CPU version (lscpu): Intel(R) Xeon(R) W-2125 CPU @ 4.00GHz
  • Linux distro flavor (/etc/issue, /etc/redhat-release): Ubuntu 22.04.2 LTS \n \l

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=hermit.log run ./rand.py.

hermit.log

failures to build (and needed dependencies)

Describe the bug

As of 56f1390 the repository fails to build with cargo build. I get the error:

[samth@huor:~/tmp/hermit (main) plt] cargo build
warning: skipping duplicate package `main` found at `/home/samth/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/experimental/riptrace`
   Compiling reverie-ptrace v0.1.0 (https://github.com/facebookexperimental/reverie.git?branch=main#6f036584)
   Compiling hermetic_infra_hermit_tests v0.0.0 (/home/samth/tmp/hermit/tests)
   Compiling hermit-verify v0.0.0 (/home/samth/tmp/hermit/hermit-verify)
error[E0432]: unresolved import `detcore::preemptions`
  --> tests/standalone/stacktrace_events.rs:13:14
   |
13 | use detcore::preemptions::PreemptionReader;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

error[E0432]: unresolved import `detcore::preemptions`
  --> tests/standalone/stacktrace_events.rs:14:14
   |
14 | use detcore::preemptions::PreemptionRecord;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `hermetic_infra_hermit_tests` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0433]: failed to resolve: use of undeclared crate or module `detcore`
  --> hermit-verify/src/internal/schedule_trace.rs:13:5
   |
13 | use detcore::preemptions::read_trace;
   |     ^^^^^^^ use of undeclared crate or module `detcore`

error[E0433]: failed to resolve: use of undeclared crate or module `detcore`
  --> hermit-verify/src/internal/schedule_trace.rs:14:5
   |
14 | use detcore::preemptions::PreemptionRecord;
   |     ^^^^^^^ use of undeclared crate or module `detcore`

error[E0432]: unresolved import `edit_distance`
  --> hermit-verify/src/internal/schedule_trace.rs:15:5
   |
15 | use edit_distance::iterable_bubble_sort;
   |     ^^^^^^^^^^^^^ use of undeclared crate or module `edit_distance`

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `hermit-verify` due to 3 previous errors

Additionally, I needed to install libunwind-dev in order to build, otherwise it failed (with a panic) when compiling unwind-sys.

Also, I notice that the GitHub actions CI doesn't do anything.

CockroachDB hangs under hermit

Describe the bug

Running cockroach appears to hang,

./hermit --log=trace --log-file=hermit.log run ./cockroach version
WARNING: --preemption-timout requires hardware perf counters which is not supported on this host, resetting preemption-timeout to 0
^C
thread 'main' panicked at 'Deadlock detected: thread(s) waiting on futex, but no runnable threads left.
 queue: RunQueue { queue: {}, last_back_turn: 1310, last_front_turn: -2, tentative_selection: None, sched_strategy: None, prng: Mcg128Xsl64 {}, sticky_random_param: 0.0, sticky_random_selection: None }
  next_turns: {DetPid(3): ThreadNextTurn { dettid: DetPid(3), child_tid_addr: 0, req: Ivar { inner: Mutex { data: Shared { contents: Some(Ok(Resources { tid: DetPid(3), resources: {FutexWait: R}, poll_attempt: 0, fyi: "" })), waiter: None }, poisoned: false, .. } }, resp: Ivar { inner: Mutex { data: Shared { contents: None, waiter: Some(Waker { data: 0x55df4302e2f0, vtable: 0x55df427d2900 }) }, poisoned: false, .. } } }}
  blocked: BlockedPool { futex_waiters: {(DetPid(3), 162650784): [], (DetPid(3), 163037944): [], (DetPid(3), 824638579016): [], (DetPid(3), 824634362184): [], (DetPid(3), 162655624): [(DetPid(3), Ivar { inner: Mutex { data: Shared { contents: None, waiter: Some(Waker { data: 0x55df4302e2f0, vtable: 0x55df427d2900 }) }, poisoned: false, .. } })], (DetPid(3), 163038336): []}, timed_waiters: TimedEvents { map: {}, alarm_times: {} }, external_io_blockers: {} }
', detcore/src/scheduler.rs:1498:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', detcore/src/tool_global.rs:822:14
fatal runtime error: failed to initiate panic, error 5

Indicate any of these common scenarios that apply:

  • a program hangs under hermit

To Reproduce
Minimal input to reproduce the behavior.

Install Nightly

wget -O cockroach https://storage.googleapis.com/cockroach-edge-artifacts-prod/cockroach/cockroach.linux-gnu-amd64.225c06dffe37b2db3913fd73d195cdf5c507427a && chmod u+x cockroach

Verify

./cockroach version
Build Tag:        v22.2.0-beta.2-972-g225c06dffe
Build Time:       2022/12/02 19:14:37
Distribution:     CCL
Platform:         linux amd64 (x86_64-pc-linux-gnu)
Go Version:       go1.19.1
C Compiler:       gcc 6.5.0
Build Commit ID:  225c06dffe37b2db3913fd73d195cdf5c507427a
Build Type:       development

Run Hermit

./hermit --log=trace --log-file=hermit.log run ./cockroach version

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • Linux kernel version (uname -a): Linux gceworker-srosenberg 5.13.0-1021-gcp #25~20.04.1-Ubuntu SMP Thu Mar 17 04:09:01 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • CPU version (/proce/cpuinfo): GCE's custom-24-32768
  • Linux distro flavor (/etc/issue, /etc/redhat-release): Ubuntu 20.04.3 LTS \n \l

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run.

hermit.log.gz

Adding syscall semantics fuzzing -- beyond thread interleavings

In its initial release, hermit run --chaos is focused on exploring different thread interleavings, and of course it also provides control over RNG. But thread interleavings & RNG are not the only sources of nondeterminism in Linux.

This issue: Exercising other syscall's nondeterminism

There are many places where the Linux syscall semantics expose nondeterministic outcomes. Each of these is a candidate for fuzzing user space (i.e. acting as a Fuzzy Linux by misbehaving and exercising). This is a task to add fuzzing of these system calls as well, for a more complete and aggressive --chaos mode.

Here is a check list of different syscalls we plan to make fuzzy.

  • read/write: how many bytes of IO are performed
  • futex: which threads to wake on futex_wake (--fuzz-futexes)
  • mmap: address space returned (e.g. ASLR)
  • all syscalls: returning extra EINTRs or other error conditions

N.B. All of them will be controlled by the same source of randomness (--fuzz-seed), which is separate from --sched-seed and --rng-seed, allowing these dimensions to be controlled individually. We could go further and separate seeds for each of the above if we liked.

Out of scope

Also, there are related topics --- additional dimensions worth fuzzing in their own right for correctness stress testing -- that are beyond the scope of this issue:

  • adding network delay
  • dropping network connections

Build Prerequisites

Feature Description

I'd like some instructions on what prerequisites are needed to build Hermit. The documentation only mentions running cargo build, but that does not work for me out of the box on the rust Docker image. I've also tried using the Dockerfile in the docker branch here, but that doesn't even have cargo.

Here's what the output looks like if I try building on the latest rust Docker image:

$ docker run -it rust # on host
$ rustc --version # in container
rustc 1.75.0-nightly (0f44eb32f 2023-11-09)
$ git clone https://github.com/facebookexperimental/hermit
$ apt-get update
$ apt-get install libunwind-dev # based on steps in .github/workflows
$ cargo build
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
   Compiling detcore v0.0.0 (/hermit/detcore)
   Compiling regex-automata v0.1.10
   Compiling overload v0.1.1
   Compiling unwind-sys v0.1.3
   Compiling time-core v0.1.2
   Compiling num_threads v0.1.6
   Compiling nu-ansi-term v0.46.0
   Compiling time v0.3.30
   Compiling tracing-log v0.1.4
   Compiling tracing-serde v0.1.3
   Compiling sharded-slab v0.1.7
error[E0432]: unresolved import `raw_cpuid::cpuid`
   --> detcore/src/lib.rs:50:5
    |
50  | use raw_cpuid::cpuid;
    |     ^^^^^^^^^^^-----
    |     |          |
    |     |          help: a similar name exists in the module (notice the capitalization): `CpuId`
    |     no `cpuid` in the root
    |
note: found an item that was configured out
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/raw-cpuid-10.7.0/src/lib.rs:128:14
    |
128 | macro_rules! cpuid {
    |              ^^^^^

error[E0432]: unresolved import `reverie::syscalls::Fork`
  --> detcore/src/lib.rs:58:5
   |
58 | use reverie::syscalls::Fork;
   |     ^^^^^^^^^^^^^^^^^^^^^^^ no `Fork` in the root

error[E0432]: unresolved import `reverie::Rdtsc`
  --> detcore/src/lib.rs:68:5
   |
68 | use reverie::Rdtsc;
   |     ^^^^^^^^^^^^^^ no `Rdtsc` in the root
   |
help: consider importing one of these items instead
   |
68 | use crate::Op::Rdtsc;
   |     ~~~~~~~~~~~~~~~~
68 | use detcore_model::schedule::Op::Rdtsc;
   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved import `reverie::RdtscResult`
  --> detcore/src/lib.rs:69:5
   |
69 | use reverie::RdtscResult;
   |     ^^^^^^^^^^^^^^^^^^^^ no `RdtscResult` in the root

error: cannot determine resolution for the macro `cpuid`
   --> detcore/src/lib.rs:640:13
    |
640 |             cpuid!(eax, ecx)
    |             ^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

   Compiling foreign-types-macros v0.2.3
error[E0407]: method `handle_cpuid_event` is not a member of trait `Tool`
   --> detcore/src/lib.rs:604:5
    |
604 |       async fn handle_cpuid_event<G: Guest<Self>>(
    |       ^        ------------------ help: there is an associated function with a similar name: `handle_timer_event`
    |  _____|
    | |
605 | |         &self,
606 | |         guest: &mut G,
607 | |         eax: u32,
...   |
643 | |         Ok(res)
644 | |     }
    | |_____^ not a member of trait `Tool`

error[E0407]: method `handle_rdtsc_event` is not a member of trait `Tool`
   --> detcore/src/lib.rs:646:5
    |
646 |       async fn handle_rdtsc_event<G: Guest<Self>>(
    |       ^        ------------------ help: there is an associated function with a similar name: `handle_timer_event`
    |  _____|
    | |
647 | |         &self,
648 | |         guest: &mut G,
649 | |         request: Rdtsc,
...   |
690 | |         result
691 | |     }
    | |_____^ not a member of trait `Tool`

error[E0412]: cannot find type `Dup2` in crate `syscalls`
   --> detcore/src/syscalls/files.rs:490:25
    |
490 |           call: syscalls::Dup2,
    |                           ^^^^ help: a struct with a similar name exists: `Dup`
    |
   ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:815:1
    |
815 | / typed_syscall! {
816 | |     pub struct Dup {
817 | |         oldfd: i32,
818 | |     }
819 | | }
    | |_- similarly named struct `Dup` defined here

error[E0412]: cannot find type `Utime` in crate `syscalls`
   --> detcore/src/syscalls/files.rs:539:25
    |
539 |         call: syscalls::Utime,
    |                         ^^^^^ not found in `syscalls`

error[E0412]: cannot find type `Utimes` in crate `syscalls`
    --> detcore/src/syscalls/files.rs:581:25
     |
581  |           call: syscalls::Utimes,
     |                           ^^^^^^ help: a struct with a similar name exists: `Times`
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:1406:1
     |
1406 | / typed_syscall! {
1407 | |     pub struct Times -> libc::clock_t {
1408 | |         buf: Option<AddrMut<libc::tms>>,
1409 | |     }
1410 | | }
     | |_- similarly named struct `Times` defined here

error[E0412]: cannot find type `Getdents` in crate `syscalls`
    --> detcore/src/syscalls/files.rs:956:25
     |
956  |           call: syscalls::Getdents,
     |                           ^^^^^^^^ help: a struct with a similar name exists: `Getdents64`
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2220:1
     |
2220 | / typed_syscall! {
2221 | |     pub struct Getdents64 {
2222 | |         fd: u32,
2223 | |         dirent: Option<AddrMut<libc::dirent64>>,
2224 | |         count: u32,
2225 | |     }
2226 | | }
     | |_- similarly named struct `Getdents64` defined here

error[E0412]: cannot find type `Poll` in crate `reverie::syscalls`
    --> detcore/src/syscalls/helpers.rs:333:49
     |
333  |   impl NonblockableSyscall for reverie::syscalls::Poll {
     |                                                   ^^^^
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
     |
2829 | / typed_syscall! {
2830 | |     pub struct Ppoll {
2831 | |         fds: Option<AddrMut<libc::pollfd>>,
2832 | |         nfds: libc::nfds_t,
...    |
2836 | |     }
2837 | | }
     | |_- similarly named struct `Ppoll` defined here
     |
help: a struct with a similar name exists
     |
333  | impl NonblockableSyscall for reverie::syscalls::Ppoll {
     |                                                 ~~~~~
help: consider importing one of these items
     |
9    + use core::task::Poll;
     |
9    + use futures::task::Poll;
     |
9    + use std::task::Poll;
     |
9    + use tokio::macros::support::Poll;
     |
help: if you import `Poll`, refer to it directly
     |
333  - impl NonblockableSyscall for reverie::syscalls::Poll {
333  + impl NonblockableSyscall for Poll {
     |

error[E0412]: cannot find type `Poll` in crate `reverie::syscalls`
    --> detcore/src/syscalls/helpers.rs:342:48
     |
342  |   impl TimeoutableSyscall for reverie::syscalls::Poll {
     |                                                  ^^^^
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
     |
2829 | / typed_syscall! {
2830 | |     pub struct Ppoll {
2831 | |         fds: Option<AddrMut<libc::pollfd>>,
2832 | |         nfds: libc::nfds_t,
...    |
2836 | |     }
2837 | | }
     | |_- similarly named struct `Ppoll` defined here
     |
help: a struct with a similar name exists
     |
342  | impl TimeoutableSyscall for reverie::syscalls::Ppoll {
     |                                                ~~~~~
help: consider importing one of these items
     |
9    + use core::task::Poll;
     |
9    + use futures::task::Poll;
     |
9    + use std::task::Poll;
     |
9    + use tokio::macros::support::Poll;
     |
help: if you import `Poll`, refer to it directly
     |
342  - impl TimeoutableSyscall for reverie::syscalls::Poll {
342  + impl TimeoutableSyscall for Poll {
     |

error[E0412]: cannot find type `EpollWait` in crate `reverie::syscalls`
    --> detcore/src/syscalls/helpers.rs:349:49
     |
349  |   impl NonblockableSyscall for reverie::syscalls::EpollWait {
     |                                                   ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
     |
2922 | / typed_syscall! {
2923 | |     pub struct EpollPwait {
2924 | |         epfd: i32,
2925 | |         events: Option<AddrMut<libc::epoll_event>>,
...    |
2930 | |     }
2931 | | }
     | |_- similarly named struct `EpollPwait` defined here

error[E0412]: cannot find type `EpollWait` in crate `reverie::syscalls`
    --> detcore/src/syscalls/helpers.rs:358:48
     |
358  |   impl TimeoutableSyscall for reverie::syscalls::EpollWait {
     |                                                  ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
     |
2922 | / typed_syscall! {
2923 | |     pub struct EpollPwait {
2924 | |         epfd: i32,
2925 | |         events: Option<AddrMut<libc::epoll_event>>,
...    |
2930 | |     }
2931 | | }
     | |_- similarly named struct `EpollPwait` defined here

error[E0412]: cannot find type `Poll` in crate `syscalls`
    --> detcore/src/syscalls/io.rs:37:32
     |
37   |   fn print_poll(call: &syscalls::Poll) {
     |                                  ^^^^
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
     |
2829 | / typed_syscall! {
2830 | |     pub struct Ppoll {
2831 | |         fds: Option<AddrMut<libc::pollfd>>,
2832 | |         nfds: libc::nfds_t,
...    |
2836 | |     }
2837 | | }
     | |_- similarly named struct `Ppoll` defined here
     |
help: a struct with a similar name exists
     |
37   | fn print_poll(call: &syscalls::Ppoll) {
     |                                ~~~~~
help: consider importing one of these items
     |
13   + use core::task::Poll;
     |
13   + use futures::task::Poll;
     |
13   + use std::task::Poll;
     |
13   + use tokio::macros::support::Poll;
     |
help: if you import `Poll`, refer to it directly
     |
37   - fn print_poll(call: &syscalls::Poll) {
37   + fn print_poll(call: &Poll) {
     |

error[E0412]: cannot find type `Poll` in crate `syscalls`
    --> detcore/src/syscalls/io.rs:58:25
     |
58   |           call: syscalls::Poll,
     |                           ^^^^
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
     |
2829 | / typed_syscall! {
2830 | |     pub struct Ppoll {
2831 | |         fds: Option<AddrMut<libc::pollfd>>,
2832 | |         nfds: libc::nfds_t,
...    |
2836 | |     }
2837 | | }
     | |_- similarly named struct `Ppoll` defined here
     |
help: a struct with a similar name exists
     |
58   |         call: syscalls::Ppoll,
     |                         ~~~~~
help: consider importing one of these items
     |
13   + use core::task::Poll;
     |
13   + use futures::task::Poll;
     |
13   + use std::task::Poll;
     |
13   + use tokio::macros::support::Poll;
     |
help: if you import `Poll`, refer to it directly
     |
58   -         call: syscalls::Poll,
58   +         call: Poll,
     |

error[E0412]: cannot find type `Poll` in crate `syscalls`
    --> detcore/src/syscalls/io.rs:75:25
     |
75   |           call: syscalls::Poll,
     |                           ^^^^
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
     |
2829 | / typed_syscall! {
2830 | |     pub struct Ppoll {
2831 | |         fds: Option<AddrMut<libc::pollfd>>,
2832 | |         nfds: libc::nfds_t,
...    |
2836 | |     }
2837 | | }
     | |_- similarly named struct `Ppoll` defined here
     |
help: a struct with a similar name exists
     |
75   |         call: syscalls::Ppoll,
     |                         ~~~~~
help: consider importing one of these items
     |
13   + use core::task::Poll;
     |
13   + use futures::task::Poll;
     |
13   + use std::task::Poll;
     |
13   + use tokio::macros::support::Poll;
     |
help: if you import `Poll`, refer to it directly
     |
75   -         call: syscalls::Poll,
75   +         call: Poll,
     |

error[E0412]: cannot find type `Poll` in crate `syscalls`
    --> detcore/src/syscalls/io.rs:93:25
     |
93   |           call: syscalls::Poll,
     |                           ^^^^
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2829:1
     |
2829 | / typed_syscall! {
2830 | |     pub struct Ppoll {
2831 | |         fds: Option<AddrMut<libc::pollfd>>,
2832 | |         nfds: libc::nfds_t,
...    |
2836 | |     }
2837 | | }
     | |_- similarly named struct `Ppoll` defined here
     |
help: a struct with a similar name exists
     |
93   |         call: syscalls::Ppoll,
     |                         ~~~~~
help: consider importing one of these items
     |
13   + use core::task::Poll;
     |
13   + use futures::task::Poll;
     |
13   + use std::task::Poll;
     |
13   + use tokio::macros::support::Poll;
     |
help: if you import `Poll`, refer to it directly
     |
93   -         call: syscalls::Poll,
93   +         call: Poll,
     |

error[E0412]: cannot find type `EpollWait` in crate `syscalls`
    --> detcore/src/syscalls/io.rs:147:25
     |
147  |           call: syscalls::EpollWait,
     |                           ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
     |
2922 | / typed_syscall! {
2923 | |     pub struct EpollPwait {
2924 | |         epfd: i32,
2925 | |         events: Option<AddrMut<libc::epoll_event>>,
...    |
2930 | |     }
2931 | | }
     | |_- similarly named struct `EpollPwait` defined here

error[E0412]: cannot find type `EpollWait` in crate `syscalls`
    --> detcore/src/syscalls/io.rs:162:25
     |
162  |           call: syscalls::EpollWait,
     |                           ^^^^^^^^^ help: a struct with a similar name exists: `EpollPwait`
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:2922:1
     |
2922 | / typed_syscall! {
2923 | |     pub struct EpollPwait {
2924 | |         epfd: i32,
2925 | |         events: Option<AddrMut<libc::epoll_event>>,
...    |
2930 | |     }
2931 | | }
     | |_- similarly named struct `EpollPwait` defined here

error[E0412]: cannot find type `Alarm` in crate `syscalls`
  --> detcore/src/syscalls/signal.rs:46:25
   |
46 |         call: syscalls::Alarm,
   |                         ^^^^^ not found in `syscalls`

error[E0412]: cannot find type `Pause` in crate `syscalls`
  --> detcore/src/syscalls/signal.rs:64:25
   |
64 |         call: syscalls::Pause,
   |                         ^^^^^ not found in `syscalls`

error[E0412]: cannot find type `Time` in crate `syscalls`
    --> detcore/src/syscalls/time.rs:121:25
     |
121  |           call: syscalls::Time,
     |                           ^^^^
     |
    ::: /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:1406:1
     |
1406 | / typed_syscall! {
1407 | |     pub struct Times -> libc::clock_t {
1408 | |         buf: Option<AddrMut<libc::tms>>,
1409 | |     }
1410 | | }
     | |_- similarly named struct `Times` defined here
     |
help: there is an enum variant `crate::TimerSchedule::Time` and 1 other; try using the variant's enum
     |
121  |         call: crate::TimerSchedule,
     |               ~~~~~~~~~~~~~~~~~~~~
121  |         call: reverie::TimerSchedule,
     |               ~~~~~~~~~~~~~~~~~~~~~~
help: a struct with a similar name exists
     |
121  |         call: syscalls::Times,
     |                         ~~~~~

   Compiling matchers v0.1.0
   Compiling scroll_derive v0.11.1
   Compiling thread_local v1.1.7
error[E0609]: no field `rip` on type `user_regs_struct`
   --> detcore/src/syscalls/helpers.rs:760:42
    |
760 |     let end_rip = NonZeroUsize::new(regs.rip.try_into().unwrap()).unwrap();
    |                                          ^^^ unknown field
    |
    = note: available fields are: `regs`, `sp`, `pc`, `pstate`

error[E0609]: no field `rip` on type `user_regs_struct`
    --> detcore/src/tool_global.rs:1476:36
     |
1476 |             NonZeroUsize::new(regs.rip.try_into().unwrap()).unwrap()
     |                                    ^^^ unknown field
     |
     = note: available fields are: `regs`, `sp`, `pc`, `pstate`

   Compiling foreign-types-shared v0.3.1
   Compiling crossbeam-utils v0.8.16
   Compiling unwind v0.4.1
   Compiling foreign-types v0.5.0
   Compiling tracing-subscriber v0.3.17
error[E0599]: no variant or associated item named `Poll` found for enum `reverie::reverie_syscalls::Syscall` in the current scope
   --> detcore/src/syscalls/io.rs:105:60
    |
105 |                 .record_or_replay_blocking(guest, Syscall::Poll(call))
    |                                                            ^^^^
    |                                                            |
    |                                                            variant or associated item not found in `Syscall`
    |                                                            help: there is a variant with a similar name: `Ppoll`
    |
note: if you're trying to build a new `reverie::reverie_syscalls::Syscall`, consider using `reverie::reverie_syscalls::Syscall::from_raw` which returns `reverie::reverie_syscalls::Syscall`
   --> /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:68:1
    |
68  | / syscall_list! {
69  | |     /// Full list of type-safe syscalls.
70  | |     #[derive(Debug, Copy, Clone, Eq, PartialEq)]
71  | |     #[allow(missing_docs)]
...   |
494 | |     }
495 | | }
    | |_^
    = note: this error originates in the macro `syscall_list` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no variant or associated item named `EpollWait` found for enum `reverie::reverie_syscalls::Syscall` in the current scope
   --> detcore/src/syscalls/io.rs:151:60
    |
151 |                 .record_or_replay_blocking(guest, Syscall::EpollWait(call))
    |                                                            ^^^^^^^^^
    |                                                            |
    |                                                            variant or associated item not found in `Syscall`
    |                                                            help: there is a variant with a similar name: `EpollPwait`
    |
note: if you're trying to build a new `reverie::reverie_syscalls::Syscall`, consider using `reverie::reverie_syscalls::Syscall::from_raw` which returns `reverie::reverie_syscalls::Syscall`
   --> /usr/local/cargo/git/checkouts/reverie-9a587e40a0d7d3be/dd1490f/reverie-syscalls/src/syscalls/mod.rs:68:1
    |
68  | / syscall_list! {
69  | |     /// Full list of type-safe syscalls.
70  | |     #[derive(Debug, Copy, Clone, Eq, PartialEq)]
71  | |     #[allow(missing_docs)]
...   |
494 | |     }
495 | | }
    | |_^
    = note: this error originates in the macro `syscall_list` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> detcore/src/syscalls/misc.rs:52:31
   |
52 |                 un.nodename = from_str(DEFAULT_HOSTNAME);
   |                 -----------   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
   |                 |
   |                 expected due to the type of this binding
   |
   = note: expected array `[u8; 65]`
              found array `[i8; 65]`

error[E0308]: mismatched types
  --> detcore/src/syscalls/misc.rs:53:33
   |
53 |                 un.domainname = from_str(DEFAULT_HOSTNAME.split('.').last().unwrap_or(""));
   |                 -------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
   |                 |
   |                 expected due to the type of this binding
   |
   = note: expected array `[u8; 65]`
              found array `[i8; 65]`

error[E0308]: mismatched types
  --> detcore/src/syscalls/misc.rs:56:26
   |
56 |             un.release = from_str("5.2.0");
   |             ----------   ^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
   |             |
   |             expected due to the type of this binding
   |
   = note: expected array `[u8; 65]`
              found array `[i8; 65]`

error[E0308]: mismatched types
  --> detcore/src/syscalls/misc.rs:57:26
   |
57 |             un.version = from_str(&format!("#1 SMP {}", epoch.format("%a %b %d %T %Z %Y")));
   |             ----------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; 65]`, found `[i8; 65]`
   |             |
   |             expected due to the type of this binding
   |
   = note: expected array `[u8; 65]`
              found array `[i8; 65]`

   Compiling env_logger v0.8.4
   Compiling scroll v0.11.0
   Compiling tokio-util v0.7.10
warning: use of deprecated method `chrono::DateTime::<Tz>::timestamp_nanos`: use `timestamp_nanos_opt()` instead
   --> detcore/src/tool_global.rs:859:52
    |
859 |             LogicalTime::from_nanos(self.cfg.epoch.timestamp_nanos() as u64),
    |                                                    ^^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated method `chrono::DateTime::<Tz>::timestamp_nanos`: use `timestamp_nanos_opt()` instead
   --> detcore/src/tool_global.rs:883:40
    |
883 |             LogicalTime::from_nanos(dt.timestamp_nanos() as u64)
    |                                        ^^^^^^^^^^^^^^^

warning: use of deprecated method `chrono::DateTime::<Tz>::timestamp_nanos`: use `timestamp_nanos_opt()` instead
   --> detcore/src/tool_global.rs:899:56
    |
899 |                 LogicalTime::from_nanos(self.cfg.epoch.timestamp_nanos() as u64),
    |                                                        ^^^^^^^^^^^^^^^

   Compiling plain v0.2.3
   Compiling goblin v0.5.4
Some errors have detailed explanations: E0308, E0407, E0412, E0432, E0599, E0609.
For more information about an error, try `rustc --explain E0308`.
warning: `detcore` (lib) generated 3 warnings
error: could not compile `detcore` (lib) due to 32 previous errors; 3 warnings emitted
warning: build failed, waiting for other jobs to finish...

Feature purpose and use cases
I actually don't know how to build and use this repo. I'm currently trying to use it to see if I can make some Go race conditions we have in my app more reproducible.

error[E0599]: no method named `force_pretty` found for struct `reverie::Backtrace`

Build failure -- introduced in 299701f ?

$ cargo build --release && ./target/release/hermit run ls
warning: skipping duplicate package `main` found at `/local/mnt/workspace/install/rust/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/experimental/traceviz`
   Compiling detcore v0.0.0 (/local/mnt/workspace/vp/hermit/detcore)
warning: the feature `map_first_last` has been stable since 1.66.0 and no longer requires an attribute to enable
  --> detcore/src/lib.rs:12:12
   |
12 | #![feature(map_first_last)]
   |            ^^^^^^^^^^^^^^
   |
   = note: `#[warn(stable_features)]` on by default

error[E0599]: no method named `force_pretty` found for struct `reverie::Backtrace` in the current scope
    --> detcore/src/tool_global.rs:1466:48
     |
1466 |         serde_json::to_writer(file, &backtrace.force_pretty()).unwrap();
     |                                                ^^^^^^^^^^^^ help: there is a method with a similar name: `pretty`

For more information about this error, try `rustc --explain E0599`.
warning: `detcore` (lib) generated 1 warning
error: could not compile `detcore` due to previous error; 1 warning emitted

panic - 'vdso symbol __vdso_clock_getres's real size is 10 bytes, but trying to replace it with 16 bytes'

Describe the bug

I hit this panic using hermit built from 95b3ac7. The development node I'm allocated is a VM and has very limited PMU modeled. That may not be related to the vdso panic though.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic
$ cat /proc/version
Linux version 5.4.0-120-generic (buildd@lcy02-amd64-037) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #136~18.04.1-Ubuntu SMP Fri Jun 10 18:00:44 UTC 2022

2022-11-23T01:04:51.638065Z  WARN reverie_ptrace::perf: Pmu bugs detected: HardwareCountersNotWorking { actual_events: 0, expected_min_events: 500, config: 5308625 }
thread 'main' panicked at 'vdso symbol __vdso_clock_getres's real size is 10 bytes, but trying to replace it with 16 bytes', /local/mnt/workspace/install/rust/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/vdso.rs:162:17

Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Minimal input to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • Linux kernel version (uname -a):
  • CPU version (/proce/cpuinfo):
  • Linux distro flavor (/etc/issue, /etc/redhat-release):

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run.

Add any other context about the problem here.

hermit_trace.log

Cargo test failed for two cases on bare metal

Describe the bug
A clear and concise description of what the bug is.
I cloned hermit on the server and ran the cargo test. There are two failed tests.

test rdrand_rdseed_is_masked ... FAILED
test getrandom_intercepted ... FAILED

failures:

---- rdrand_rdseed_is_masked stdout ----
Expecting determinism:
Test Run 1:
thread 'rdrand_rdseed_is_masked' panicked at 'Unsupported processor with feature info: FeatureInfo { extended_family_id: 0, extended_model_id: 6, family_id: 6, model_id: 106, stepping_id: 6, brand_index: 0, cflush_cache_line_size: 8, initial_local_apic_id: 8, max_logical_processor_ids: 128, edx_ecx: SSE3 | PCLMULQDQ | DTES64 | MONITOR | DSCPL | VMX | SMX | EIST | TM2 | SSSE3 | FMA | CMPXCHG16B | PDCM | PCID | DCA | SSE41 | SSE42 | X2APIC | MOVBE | POPCNT | TSC_DEADLINE | AESNI | XSAVE | OSXSAVE | AVX | F16C | RDRAND | FPU | VME | DE | PSE | TSC | MSR | PAE | MCE | CX8 | APIC | SEP | MTRR | PGE | MCA | CMOV | PAT | PSE36 | CLFSH | DS | ACPI | MMX | FXSR | SSE | SSE2 | SS | HTT | TM | PBE | 0x4800 }
 Full family_model: (6, 106)', /home/yupan/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/0e08502/reverie-ptrace/src/timer.rs:75:16
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- getrandom_intercepted stdout ----
Expecting determinism:
Test Run 1:
thread 'getrandom_intercepted' panicked at 'Unsupported processor with feature info: FeatureInfo { extended_family_id: 0, extended_model_id: 6, family_id: 6, model_id: 106, stepping_id: 6, brand_index: 0, cflush_cache_line_size: 8, initial_local_apic_id: 4, max_logical_processor_ids: 128, edx_ecx: SSE3 | PCLMULQDQ | DTES64 | MONITOR | DSCPL | VMX | SMX | EIST | TM2 | SSSE3 | FMA | CMPXCHG16B | PDCM | PCID | DCA | SSE41 | SSE42 | X2APIC | MOVBE | POPCNT | TSC_DEADLINE | AESNI | XSAVE | OSXSAVE | AVX | F16C | RDRAND | FPU | VME | DE | PSE | TSC | MSR | PAE | MCE | CX8 | APIC | SEP | MTRR | PGE | MCA | CMOV | PAT | PSE36 | CLFSH | DS | ACPI | MMX | FXSR | SSE | SSE2 | SS | HTT | TM | PBE | 0x4800 }
 Full family_model: (6, 106)', /home/yupan/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/0e08502/reverie-ptrace/src/timer.rs:75:16


failures:
    getrandom_intercepted
    rdrand_rdseed_is_masked

Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Minimal input to reproduce the behavior.

cargo test

Expected behavior
A clear and concise description of what you expected to happen.

all tests passed

Environment

  • Linux kernel version (uname -a): Linux 5.14.0-rc5 #2 SMP Sat Jun 24 11:10:07 CEST 2023 x86_64 x86_64 x86_64 GNU/Linux
  • CPU version (/proce/cpuinfo): Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz
  • Linux distro flavor (/etc/issue, /etc/redhat-release): Ubuntu 20.04.4 LTS

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run.

Add any other context about the problem here.
I saw other people having a similar issue but he was running hermit inside a VM. That issue was because hermit cannot intercept CPUID instruction on VMs. Here I am running on a bare metal so I wonder what might be the reason here. Is it because of some CPU features? If that's the case, is there a list of supported CPUs by hermit.
If this is a bug, I would also like to help fix it.

DrRacket hangs under hermit

Describe the bug

Running Drracket (from https://racket-lang.org) hangs Hermit as follows:

[samth@huor:~/tmp/hermit (main) plt] ./target/debug/hermit run ~/sw/plt/racket/bin/drracket
2022-11-28T22:09:38.410475Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
thread 'main' panicked at 'Invariant violation, cannot retrieve handle on guest Stack when there is already a StackGuard still alive.', /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/stack.rs:49:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Indicate any of these common scenarios that apply:

  • a program hangs under hermit

To Reproduce
Minimal input to reproduce the behavior.

Install DrRacket. Run hermit on it.

Environment

  • Linux kernel version (uname -a): Linux huor 5.19.0-23-generic #24-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 14 15:39:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Linux distro flavor (/etc/issue, /etc/redhat-release): Ubuntu 22.10

Additional context

Full backtrace:

/home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/stack.rs:49:13
stack backtrace:
   0:     0x561d09be5230 - std::backtrace_rs::backtrace::libunwind::trace::h10d23c3af93c2280
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x561d09be5230 - std::backtrace_rs::backtrace::trace_unsynchronized::h906cda0856e755be
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x561d09be5230 - std::sys_common::backtrace::_print_fmt::hefc6523cb7ad8c91
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x561d09be5230 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h49a37e386978d813
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x561d09c0c90e - core::fmt::write::h8425617fb2d1025f
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/fmt/mod.rs:1208:17
   5:     0x561d09be0ff5 - std::io::Write::write_fmt::h15ede062d559dc3f
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/io/mod.rs:1682:15
   6:     0x561d09be4ff5 - std::sys_common::backtrace::_print::h2767a5294bfc4f78
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x561d09be4ff5 - std::sys_common::backtrace::print::h64070ee3b66f2452
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x561d09be67bf - std::panicking::default_hook::{{closure}}::h353e8837868bcb61
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panicking.rs:267:22
   9:     0x561d09be64fa - std::panicking::default_hook::h2b11c396c9cc8a06
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panicking.rs:286:9
  10:     0x561d09be6ebc - std::panicking::rust_panic_with_hook::h81d7ce2132c30f75
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panicking.rs:688:13
  11:     0x561d09be6c11 - std::panicking::begin_panic_handler::{{closure}}::h133b7f8abeb2011a
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panicking.rs:577:13
  12:     0x561d09be56dc - std::sys_common::backtrace::__rust_end_short_backtrace::h3ce415d531cb6e38
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x561d09be6972 - rust_begin_unwind
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panicking.rs:575:5
  14:     0x561d08795df3 - core::panicking::panic_fmt::h83ecf733a8799bff
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/panicking.rs:65:14
  15:     0x561d08f5887e - reverie_ptrace::stack::GuestStack::new::hf2c590f4769932a3
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/stack.rs:49:13
  16:     0x561d08d9ca30 - <reverie_ptrace::task::TracedTask<L> as reverie::guest::Guest<L>>::stack::{{closure}}::hf2c7543da7057fe2
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:2113:15
  17:     0x561d08a9dec8 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::he948a4cbc0e5c988
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  18:     0x561d08a12b62 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll{{reify.shim}}::hf27a91fd374016d4
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:86:9
  19:     0x561d08c2ad38 - <core::pin::Pin<P> as core::future::future::Future>::poll::he29622a90d6b2186
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
  20:     0x561d0894eb01 - detcore::syscalls::files::<impl detcore::tool_local::Detcore<T>>::inject_fstat::{{closure}}::he8e47b8a377268aa
                               at /home/samth/tmp/hermit/detcore/src/syscalls/files.rs:69:38
  21:     0x561d08a68e5c - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h0c0e4f05aac6647c
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  22:     0x561d0897109a - detcore::syscalls::files::<impl detcore::tool_local::Detcore<T>>::add_fd::{{closure}}::hfefa515a8324d8a2
                               at /home/samth/tmp/hermit/detcore/src/syscalls/files.rs:101:46
  23:     0x561d08a8af8d - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h9b5abe8afaeb4e37
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  24:     0x561d08954a69 - detcore::syscalls::files::<impl detcore::tool_local::Detcore<T>>::handle_socket::{{closure}}::h095eb3d47f8d5d9d
                               at /home/samth/tmp/hermit/detcore/src/syscalls/files.rs:660:13
  25:     0x561d08a8465f - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h819e487be3c4b081
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  26:     0x561d08dfacf3 - detcore::<impl reverie::tool::Tool for detcore::tool_local::Detcore<T>>::handle_syscall_event::{{closure}}::h7ecd0201194b6b08
                               at /home/samth/tmp/hermit/detcore/src/lib.rs:941:63
  27:     0x561d08a9bc0f - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::he0dc5fc101a71f88
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  28:     0x561d08a10b32 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll{{reify.shim}}::h38805c9171dcef19
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:86:9
  29:     0x561d08c2a4e8 - <core::pin::Pin<P> as core::future::future::Future>::poll::ha1be9dfbc23db730
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
  30:     0x561d08d2abfe - reverie_ptrace::task::TracedTask<L>::handle_seccomp::{{closure}}::{{closure}}::h376df5c69e4446b9
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:1071:17
  31:     0x561d08a7c2ff - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h602d4a746c39c2c8
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  32:     0x561d0891c042 - <futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll::hd68fa42b2d194eeb
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/fuse.rs:86:37
  33:     0x561d08c2a9a6 - <core::pin::Pin<P> as core::future::future::Future>::poll::hcb041347d74d6306
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
  34:     0x561d08c04fd0 - futures_util::future::future::FutureExt::poll_unpin::h2b2f4cb1276ea5f8
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/mod.rs:562:9
  35:     0x561d08d14a28 - reverie_ptrace::task::cancellable::{{closure}}::{{closure}}::{{closure}}::h5f878477426bca09
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:321:13
  36:     0x561d08a337a7 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::ha34ec5228e0cd506
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/ops/function.rs:617:13
  37:     0x561d08d1438f - reverie_ptrace::task::cancellable::{{closure}}::{{closure}}::hc346cc796a4823d1
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:321:13
  38:     0x561d08eecad5 - <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll::h9b68575c722f460d
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/poll_fn.rs:56:9
  39:     0x561d08d1378c - reverie_ptrace::task::cancellable::{{closure}}::hc49b8f0bfb076cb9
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:549:5
  40:     0x561d08a7926f - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h53f0e327676659f6
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  41:     0x561d08d27b37 - reverie_ptrace::task::TracedTask<L>::handle_seccomp::{{closure}}::h01b5b155e17096a6
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:1073:9
  42:     0x561d08a70cba - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h304f061cc4c17ce7
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  43:     0x561d08d61042 - reverie_ptrace::task::TracedTask<L>::handle_stop_event::{{closure}}::hc805624440b987a8
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:872:59
  44:     0x561d08a7bdda - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h5e361b954ff6cd8e
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  45:     0x561d0891bd4e - <futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll::hb725db08525ab749
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/fuse.rs:86:37
  46:     0x561d08c2a416 - <core::pin::Pin<P> as core::future::future::Future>::poll::h9b08f6a672bad144
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
  47:     0x561d08c2a846 - <core::pin::Pin<P> as core::future::future::Future>::poll::hb9f491d96859e7cf
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
  48:     0x561d08c051f0 - futures_util::future::future::FutureExt::poll_unpin::h73b744d83665e9ae
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/mod.rs:562:9
  49:     0x561d08d6a6f8 - reverie_ptrace::task::TracedTask<L>::run_loop_internal::{{closure}}::{{closure}}::{{closure}}::hfab170a95abea328
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  50:     0x561d08a33747 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h021e893a23705acc
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/ops/function.rs:617:13
  51:     0x561d08d697c5 - reverie_ptrace::task::TracedTask<L>::run_loop_internal::{{closure}}::{{closure}}::h57c90c8fa0a84a3b
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  52:     0x561d08eec9e5 - <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll::h8895812737c05336
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/poll_fn.rs:56:9
  53:     0x561d08d6652a - reverie_ptrace::task::TracedTask<L>::run_loop_internal::{{closure}}::h0d6288d6ffa47595
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:1430:34
  54:     0x561d08a724bf - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h377db28668b0c81e
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  55:     0x561d08d89ca4 - reverie_ptrace::task::TracedTask<L>::run_loop::{{closure}}::he799f4aa1b9d3a84
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:1374:43
  56:     0x561d08a986af - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hd1e0e9444bb8c739
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  57:     0x561d0891b208 - <futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll::ha59efcbac3406c93
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/fuse.rs:86:37
  58:     0x561d08c29ad6 - <core::pin::Pin<P> as core::future::future::Future>::poll::h5355162864120d39
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
  59:     0x561d08c2a6b6 - <core::pin::Pin<P> as core::future::future::Future>::poll::hb179adba3acb5390
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
  60:     0x561d08c04e10 - futures_util::future::future::FutureExt::poll_unpin::h0155c64dc97a5b32
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/future/mod.rs:562:9
  61:     0x561d08d81088 - reverie_ptrace::task::TracedTask<L>::run::{{closure}}::{{closure}}::{{closure}}::h0d232677a889f974
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  62:     0x561d08a33777 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h0c741f3122b8e86a
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/ops/function.rs:617:13
  63:     0x561d08d80f3f - reverie_ptrace::task::TracedTask<L>::run::{{closure}}::{{closure}}::ha925df7b5df4800c
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
  64:     0x561d08eecb25 - <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll::hb18ebfb984978949
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/future/poll_fn.rs:56:9
  65:     0x561d08d80094 - reverie_ptrace::task::TracedTask<L>::run::{{closure}}::h66287908cfdf8084
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:1458:13
  66:     0x561d08a7157f - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h31c403a5fecfc14c
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  67:     0x561d08d4a1b1 - reverie_ptrace::task::TracedTask<L>::handle_new_task::{{closure}}::{{closure}}::h6ba802189b9c0b91
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/task.rs:1162:40
  68:     0x561d08a92a17 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hb9c10e317da1ae4b
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  69:     0x561d08a1d15a - tokio::runtime::task::core::Core<T,S>::poll::{{closure}}::h1aeca48d8d20758d
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/core.rs:208:17
  70:     0x561d08ec1893 - tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut::h5d7c7f51a603e046
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/loom/std/unsafe_cell.rs:14:9
  71:     0x561d08a1cdfe - tokio::runtime::task::core::Core<T,S>::poll::ha7d8cdc40472d719
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/core.rs:197:13
  72:     0x561d08e29768 - tokio::runtime::task::harness::poll_future::{{closure}}::h184600b94b4ab9ce
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:483:19
  73:     0x561d08f0d3c4 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h691d604d245ad685
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/panic/unwind_safe.rs:271:9
  74:     0x561d08f0aa13 - std::panicking::try::do_call::h9ca0843f0bbef174
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panicking.rs:483:40
  75:     0x561d08f0d04b - __rust_try
  76:     0x561d08f08c75 - std::panicking::try::h9d0b193a1982487c
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panicking.rs:447:19
  77:     0x561d08f071bb - std::panic::catch_unwind::h20254fcb007495b5
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/panic.rs:137:14
  78:     0x561d08e28454 - tokio::runtime::task::harness::poll_future::h6f9d571c089a95d1
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:471:18
  79:     0x561d08e2a3c9 - tokio::runtime::task::harness::Harness<T,S>::poll_inner::h11a4062c2dd29a68
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:107:27
  80:     0x561d08e2de37 - tokio::runtime::task::harness::Harness<T,S>::poll::h4d29fd932fabc549
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/harness.rs:61:15
  81:     0x561d08ebda5d - tokio::runtime::task::raw::poll::h4319ea9e067afe07
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/raw.rs:194:5
  82:     0x561d09640017 - tokio::runtime::task::raw::RawTask::poll::h02abc402f70a34ce
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/raw.rs:134:18
  83:     0x561d09671602 - tokio::runtime::task::LocalNotified<S>::run::hfa2aec41813b7df6
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/task/mod.rs:430:9
  84:     0x561d0968da2b - tokio::task::local::LocalSet::tick::{{closure}}::h5f62d636078bc7f6
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:616:63
  85:     0x561d0968d95e - tokio::runtime::coop::with_budget::h7b40bd72ef0cd0c8
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:102:5
  86:     0x561d0968d95e - tokio::runtime::coop::budget::h2c821f86aaa47d68
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:68:5
  87:     0x561d0968d95e - tokio::task::local::LocalSet::tick::h75f004123041ca2e
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:616:31
  88:     0x561d08e25419 - <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll::{{closure}}::h40502f127a08f852
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:928:16
  89:     0x561d08e24ede - tokio::task::local::LocalSet::with::{{closure}}::h96c1607f9c348ab8
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:685:13
  90:     0x561d08efc780 - std::thread::local::LocalKey<T>::try_with::heceb90da7710968a
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/thread/local.rs:446:16
  91:     0x561d08ef95b5 - std::thread::local::LocalKey<T>::with::hcfbdc9ef4d2e5a49
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/std/src/thread/local.rs:422:9
  92:     0x561d08e24de7 - tokio::task::local::LocalSet::with::h8ac50832d93ac51d
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:668:9
  93:     0x561d08e252ae - <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll::hf448140e1273f2b9
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:914:9
  94:     0x561d08e25190 - tokio::task::local::LocalSet::run_until::{{closure}}::h8d0ce48e62f84b4f
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/task/local.rs:574:18
  95:     0x561d08a7eb1f - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h6bfe0523169051c3
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  96:     0x561d08cf3807 - reverie_ptrace::tracer::Tracer<G>::wait::{{closure}}::h4f5eefc390d1d880
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-ptrace/src/tracer.rs:136:59
  97:     0x561d08a88d6a - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h94f5222266f92d72
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
  98:     0x561d08e1c195 - hermit::run::{{closure}}::ha857b12a82679c5d
                               at /home/samth/tmp/hermit/hermit-cli/src/lib.rs:83:68
  99:     0x561d08a6c39e - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h1c634a8fff7e941e
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/mod.rs:92:19
 100:     0x561d08c298ad - <core::pin::Pin<P> as core::future::future::Future>::poll::h4380eac278bbde52
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/future/future.rs:124:9
 101:     0x561d08cd2605 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}::he24854748a7bd164
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:531:57
 102:     0x561d08cd2194 - tokio::runtime::coop::with_budget::h9fad552364031e0c
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:102:5
 103:     0x561d08cd2194 - tokio::runtime::coop::budget::h78018ab8b5e68a4e
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/coop.rs:68:5
 104:     0x561d08cd2194 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::hef0af0a12f297990
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:531:25
 105:     0x561d08cc7234 - tokio::runtime::scheduler::current_thread::Context::enter::h33233046e64220c9
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:340:19
 106:     0x561d08ccd07e - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::h4b79cf47016640c1
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:530:36
 107:     0x561d08ccc8a3 - tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}::hd41b8064167235ee
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:601:57
 108:     0x561d08dbaea4 - tokio::macros::scoped_tls::ScopedKey<T>::set::h7ad86506c875e536
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/macros/scoped_tls.rs:61:9
 109:     0x561d08ccb0b5 - tokio::runtime::scheduler::current_thread::CoreGuard::enter::h5ce8233911a56bca
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:601:27
 110:     0x561d08cccae4 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::h3f027abfc0d5c20d
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:520:19
 111:     0x561d08cc4a18 - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::h812a392725c583d9
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/scheduler/current_thread.rs:154:24
 112:     0x561d08e1b04b - tokio::runtime::runtime::Runtime::block_on::h5bb6b4488c4c3088
                               at /home/samth/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.22.0/src/runtime/runtime.rs:279:47
 113:     0x561d088c2a87 - hermit::run::h576707dce72b2b4b
                               at /home/samth/tmp/hermit/hermit-cli/src/lib.rs:85:5
 114:     0x561d087b037e - hermit::run::RunOpts::run_in_container::h00da008975595fc4
                               at /home/samth/tmp/hermit/hermit-cli/src/bin/hermit/run.rs:933:9
 115:     0x561d088820a0 - hermit::run::RunOpts::run::{{closure}}::hdb47ddb45f1297cf
                               at /home/samth/tmp/hermit/hermit-cli/src/bin/hermit/run.rs:737:43
 116:     0x561d0886212f - hermit::container::with_container::{{closure}}::he6fe7c108d54a719
                               at /home/samth/tmp/hermit/hermit-cli/src/bin/hermit/container.rs:44:17
 117:     0x561d087c81ca - reverie_process::container::Container::run::{{closure}}::{{closure}}::h8c8b8ad03e7d6032
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-process/src/container.rs:794:68
 118:     0x561d087cc9df - core::result::Result<T,E>::map::h5121a42bb86615bb
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/core/src/result.rs:775:25
 119:     0x561d087c804f - reverie_process::container::Container::run::{{closure}}::hf4f31cd842d75239
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-process/src/container.rs:794:29
 120:     0x561d095ace36 - <alloc::boxed::Box<F,A> as core::ops::function::FnMut<Args>>::call_mut::h45130065f054374a
                               at /rustc/b7bc90fea3b441234a84b49fdafeb75815eebbab/library/alloc/src/boxed.rs:2016:9
 121:     0x561d095ab1e4 - reverie_process::clone::clone_with_stack::callback::h22426b4f7e63dbba
                               at /home/samth/.cargo/git/checkouts/reverie-8ef5283cec164105/a7f6cae/reverie-process/src/clone.rs:29:9
 122:     0x7f754d91e744 - __GI___clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100

Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run.

drracket-log.gz

Cargo test failed on two cases

Describe the bug
A clear and concise description of what the bug is:

When I run cargo test two test case failed.

test getrandom_intercepted ... FAILED
test rdrand_rdseed_is_masked ... FAILED

failures:

---- getrandom_intercepted stdout ----
Expecting determinism:
Test Run 1:
thread 'getrandom_intercepted' panicked at 'vdso symbol __vdso_clock_gettime's real size is 5 bytes, but trying to replace it with 8 bytes', /home/tl/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/c448d10/reverie-ptrace/src/vdso.rs:148:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- rdrand_rdseed_is_masked stdout ----
Expecting determinism:
Test Run 1:
thread 'rdrand_rdseed_is_masked' panicked at 'Once instance has previously been poisoned', /home/tl/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30:16


failures:
    getrandom_intercepted
    rdrand_rdseed_is_masked

Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Minimal input to reproduce the behavior.

cargo test

Expected behavior
A clear and concise description of what you expected to happen.

all tests pass

Environment

  • Linux kernel version (uname -a): Linux tl 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • CPU version (/proce/cpuinfo): 12th Gen Intel(R) Core(TM) i9-12900KS
  • Linux distro flavor (/etc/issue, /etc/redhat-release): Ubuntu 22.04.1 LTS

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run.

Add any other context about the problem here.
I saw people have similar situation that would explain why I failed the first test. But I am not sure what caused the second test to fail. Is it because of some bug in lazy_static?

intercepted.cpuid(eax).unwrap() panics

Describe the bug

hermit panics while running a test case.

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /.../hermit/detcore/src/lib.rs:596:36
stack backtrace:
   0: rust_begin_unwind
             at /rustc/1eb62b1235fd77200e6bd967d70e83c0f2497233/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/1eb62b1235fd77200e6bd967d70e83c0f2497233/library/core/src/panicking.rs:65:14
   2: core::panicking::panic
             at /rustc/1eb62b1235fd77200e6bd967d70e83c0f2497233/library/core/src/panicking.rs:114:5
   3: detcore::<impl reverie::tool::Tool for detcore::tool_local::Detcore<T>>::handle_cpuid_event::{{closure}}
   4: reverie_ptrace::task::TracedTask<L>::handle_signal::{{closure}}
   5: reverie_ptrace::task::TracedTask<L>::handle_stop_event::{{closure}}
   6: <futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll
   7: reverie_ptrace::task::TracedTask<L>::run_loop_internal::{{closure}}::{{closure}}::{{closure}}
   8: <futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll
   9: reverie_ptrace::task::TracedTask<L>::run::{{closure}}::{{closure}}::{{closure}}
  10: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  11: tokio::runtime::task::core::Core<T,S>::poll
  12: tokio::runtime::task::harness::Harness<T,S>::poll
  13: tokio::task::local::LocalSet::tick
  14: <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll
  15: reverie_ptrace::tracer::Tracer<G>::wait::{{closure}}
  16: <core::pin::Pin<P> as core::future::future::Future>::poll
  17: tokio::runtime::scheduler::current_thread::Context::enter
  18: tokio::macros::scoped_tls::ScopedKey<T>::set
  19: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
  20: tokio::runtime::runtime::Runtime::block_on
  21: hermit::run
  22: hermit::run::RunOpts::run_in_container
  23: reverie_process::container::Container::run::{{closure}}
  24: clone
             at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

Environment

$ lsb_release -a ; uname -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal
Linux aus-qemu-lab-1 5.4.0-122-generic #138-Ubuntu SMP Wed Jun 22 15:00:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

/proc/cpuinfo excerpt Xeon Silver 4114:

...
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz
stepping        : 4
microcode       : 0x2006d05
cpu MHz         : 800.098
...

Additional context

Log file (renamed to .txt but it is really an .xz compressed log file) run.log.xz.txt

Add any other context about the problem here.

Characterize overhead

For example, I'd like to know the scalability of Hermit run. Is the time overhead linear with respect to the number of syscall invocations?

Is it possible to say a thing or two about hardware behavior and runs & replays? For example, how would things like energy consumption be impacted under Hermit?

Unsupported processor with feature info

Describe the bug
A clear and concise description of what the bug is.

Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Install https://github.com/gambit/gambit

Expected behavior
Application to run

Environment

  • Linux kernel version (uname -a):
    Linux fedora 6.0.12-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 8 17:15:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

  • CPU version (/proce/cpuinfo):
    processor : 0
    vendor_id : GenuineIntel
    cpu family : 6
    model : 140
    model name : 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    stepping : 1
    microcode : 0xa4
    cpu MHz : 3000.000
    cache size : 12288 KB
    physical id : 0
    siblings : 8
    core id : 0
    cpu cores : 4
    apicid : 0
    initial apicid : 0
    fpu : yes
    fpu_exception : yes
    cpuid level : 27
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 invpcid_single cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities
    vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs pml ept_mode_based_exec tsc_scaling
    bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb
    bogomips : 5990.40
    clflush size : 64
    cache_alignment : 64
    address sizes : 39 bits physical, 48 bits virtual
    power management:

  • Linux distro flavor (/etc/issue, /etc/redhat-release):
    Fedora release 36 (Thirty Six)

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run.
2022-12-22T19:17:27.703450Z TRACE mio::poll: registering event source with poller: token=Token(2147483649), interests=READABLE
2022-12-22T19:17:27.704077Z INFO detcore::scheduler::runqueue: DETLOG SCHEDRAND: seeding scheduler runqueue with seed 0
2022-12-22T19:17:27.705095Z INFO detcore::scheduler: [scheduler] daemon task starting up, waiting for guest thread start..
2022-12-22T19:17:27.706020Z TRACE detcore: [tid 3] detcore init new thread state
2022-12-22T19:17:27.706049Z INFO detcore::tool_local: DETLOG USER RAND: seeding PRNG for root thread with seed 0
2022-12-22T19:17:27.706055Z INFO detcore::tool_local: DETLOG CHAOSRAND: seeding chaos scheduler with seed 0

Output
-- mode: compilation; default-directory: "~/gambit/" --
Compilation started at Thu Dec 22 12:17:27

RUST_BACKTRACE=full hermit --log=trace --log-file=FOO run ~/opt/gambit/current/bin/gsi
thread 'main' panicked at 'Unsupported processor with feature info: FeatureInfo { extended_family_id: 0, extended_model_id: 8, family_id: 6, model_id: 140, stepping_id: 1, brand_index: 0, cflush_cache_line_size: 8, initial_local_apic_id: 4, max_logical_processor_ids: 16, edx_ecx: SSE3 | PCLMULQDQ | DTES64 | MONITOR | DSCPL | VMX | SMX | EIST | TM2 | SSSE3 | FMA | CMPXCHG16B | PDCM | PCID | SSE41 | SSE42 | X2APIC | MOVBE | POPCNT | TSC_DEADLINE | AESNI | XSAVE | OSXSAVE | AVX | F16C | RDRAND | FPU | VME | DE | PSE | TSC | MSR | PAE | MCE | CX8 | APIC | SEP | MTRR | PGE | MCA | CMOV | PAT | PSE36 | CLFSH | DS | ACPI | MMX | FXSR | SSE | SSE2 | SS | HTT | TM | PBE | 0x4800 }
Full family_model: (6, 140)', /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-ptrace/src/timer.rs:75:16
stack backtrace:
0: 0x55f974ef5a0a - std::backtrace_rs::backtrace::libunwind::trace::h99dd587050ba3e19
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x55f974ef5a0a - std::backtrace_rs::backtrace::trace_unsynchronized::h8b5df2b58b05da41
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x55f974ef5a0a - std::sys_common::backtrace::_print_fmt::h1d345cbbcda56598
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/sys_common/backtrace.rs:65:5
3: 0x55f974ef5a0a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd4402273fa33282a
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/sys_common/backtrace.rs:44:22
4: 0x55f974f1d22e - core::fmt::write::h6c95fd68e30f1c06
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/fmt/mod.rs:1208:17
5: 0x55f974ef1775 - std::io::Write::write_fmt::ha72b55fc69892a78
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/io/mod.rs:1682:15
6: 0x55f974ef57d5 - std::sys_common::backtrace::_print::hfacbef4ac726cf20
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/sys_common/backtrace.rs:47:5
7: 0x55f974ef57d5 - std::sys_common::backtrace::print::h249e5a7814647993
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/sys_common/backtrace.rs:34:9
8: 0x55f974ef6fbf - std::panicking::default_hook::{{closure}}::h1c72d3ce90cd0e69
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/panicking.rs:267:22
9: 0x55f974ef6cfb - std::panicking::default_hook::h5777cc883332a52f
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/panicking.rs:286:9
10: 0x55f974ef76cc - std::panicking::rust_panic_with_hook::hb3543478dcc6699f
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/panicking.rs:688:13
11: 0x55f974ef7469 - std::panicking::begin_panic_handler::{{closure}}::h8d087d6e3dd9013a
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/panicking.rs:579:13
12: 0x55f974ef5ebc - std::sys_common::backtrace::__rust_end_short_backtrace::h4401a1f654fdffad
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/sys_common/backtrace.rs:137:18
13: 0x55f974ef7172 - rust_begin_unwind
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/std/src/panicking.rs:575:5
14: 0x55f973abff93 - core::panicking::panic_fmt::h6751b1ba85e41064
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/panicking.rs:64:14
15: 0x55f974234875 - reverie_ptrace::timer::get_rcb_perf_config::he0c5dcc47a57ca35
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-ptrace/src/timer.rs:75:16
16: 0x55f9742358cc - reverie_ptrace::timer::TimerImpl::new::h785265fb6021495f
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-ptrace/src/timer.rs:478:30
17: 0x55f974234ee0 - reverie_ptrace::timer::Timer::new::h1fa9ca3d691a7bbd
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-ptrace/src/timer.rs:166:22
18: 0x55f974157904 - reverie_ptrace::task::TracedTask::new::h8980e2eb93a18a8c
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-ptrace/src/task.rs:376:20
19: 0x55f973e0cf8d - reverie_ptrace::tracer::postspawn::{{closure}}::hc86def5878a931aa
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-ptrace/src/tracer.rs:329:22
20: 0x55f973e09323 - reverie_ptrace::tracer::TracerBuilder::spawn::{{closure}}::ha4b4f09aa399ec3d
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-ptrace/src/tracer.rs:512:90
21: 0x55f973d29fef - hermit::run::{{closure}}::ha3f17ea44af7c044
at /home/ober/hermit/hermit-cli/src/lib.rs:84:54
22: 0x55f973c86c15 - <core::pin::Pin

as core::future::future::Future>::poll::hb7067ae300c8eba3
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/future/future.rs:124:9
23: 0x55f973f59195 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}::he9640a62eb01c38e
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:541:57
24: 0x55f973f58d34 - tokio::runtime::coop::with_budget::h7cec51fe53ef5beb
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/coop.rs:102:5
25: 0x55f973f58d34 - tokio::runtime::coop::budget::h6f2e843bfaf996ca
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/coop.rs:68:5
26: 0x55f973f58d34 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::hcf1f321a085d8295
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:541:25
27: 0x55f973f4e6a0 - tokio::runtime::scheduler::current_thread::Context::enter::h721d15a3fc6fa4aa
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:350:19
28: 0x55f973f5552e - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::h64441df5c5c7e3b2
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:540:36
29: 0x55f973f52b63 - tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}::h69cf5335c26ae0e8
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:615:57
30: 0x55f973fbc5f4 - tokio::macros::scoped_tls::ScopedKey::set::hc378d522f35920f3
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/macros/scoped_tls.rs:61:9
31: 0x55f973f50ff1 - tokio::runtime::scheduler::current_thread::CoreGuard::enter::h0959c2d79ab5d06c
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:615:27
32: 0x55f973f52f44 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::ha91b27a9c74c2afa
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:530:19
33: 0x55f973f499f8 - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::h226321f08d98f660
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:154:24
34: 0x55f9741b484a - tokio::runtime::runtime::Runtime::block_on::hc55f0d58ff5f0727
at /home/ober/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/runtime.rs:282:47
35: 0x55f973e450b7 - hermit::run::h75d5250ec8f53350
at /home/ober/hermit/hermit-cli/src/lib.rs:88:5
36: 0x55f973b7f42e - hermit::run::RunOpts::run_in_container::he130a8d16bc4583d
at /home/ober/hermit/hermit-cli/src/bin/hermit/run.rs:841:26
37: 0x55f973b13ceb - hermit::run::RunOpts::run::{{closure}}::h8182dc596fa1b86c
at /home/ober/hermit/hermit-cli/src/bin/hermit/run.rs:636:13
38: 0x55f973b4bc1f - hermit::container::with_container::{{closure}}::h5e7a23c4233df94d
at /home/ober/hermit/hermit-cli/src/bin/hermit/container.rs:44:17
39: 0x55f973bc154a - reverie_process::container::Container::run::{{closure}}::{{closure}}::h2d5f818fa8c52b4e
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-process/src/container.rs:794:68
40: 0x55f973b2fcc2 - core::result::Result<T,E>::map::h6a35da28a28a5e1f
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/core/src/result.rs:774:25
41: 0x55f973bc121f - reverie_process::container::Container::run::{{closure}}::hd5b6b8e41321bdb3
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-process/src/container.rs:794:29
42: 0x55f9748afbe6 - <alloc::boxed::Box<F,A> as core::ops::function::FnMut>::call_mut::hd72d8a61ca149bb2
at /rustc/b569c9dc57ee22b6ff94563af856909763dfa24b/library/alloc/src/boxed.rs:2016:9
43: 0x55f9748b1574 - reverie_process::clone::clone_with_stack::callback::haaa342ac61c5d002
at /home/ober/.cargo/git/checkouts/reverie-9a587e40a0d7d3be/dba0b5b/reverie-process/src/clone.rs:29:9
44: 0x7f86ac511524 - __clone
45: 0x0 -
fatal runtime error: failed to initiate panic, error 5
Error: Sandbox container exited unexpectedly
> Process exited with code: Signaled(SIGSEGV, true)

Support for rustc stable

Currently, Hermit and Reverie both require Rust nightly features. This can be easily seen with the following ripgrep calls (first reverie, second hermit):

austin@GANON:~/src/reverie$ rg -t rust '#!\[feature'

experimental/reverie-sabre/src/lib.rs
9:#![feature(ffi_returns_twice)]

reverie-ptrace/src/lib.rs
32:#![feature(internal_output_capture)]

tests/standalone/parallel_tasks.rs
9:#![feature(get_mut_unchecked)]
10:#![feature(thread_id_value)]
austin@GANON:~/src/hermit$ rg -t rust '#!\[feature'
tests/rust/mem_race.rs
9:#![feature(get_mut_unchecked)]
10:#![feature(thread_id_value)]
11:#![feature(atomic_mut_ptr)]

detcore/src/lib.rs
11:#![feature(async_closure)]
12:#![feature(map_first_last)]
13:#![feature(nonzero_ops)]

detcore/tests/parallelism/mod.rs
9:#![feature(get_mut_unchecked)]
10:#![feature(thread_id_value)]
11:#![feature(atomic_mut_ptr)]

detcore/tests/testutils/src/lib.rs
11:#![feature(trace_macros)]

Rust nightly generally requires extra contortions in order to support in most package managers; infamously, some people even trick the compiler into allowing these features on the stable branch using evil, dark magic. In fact, I have gotten a working build of Hermit inside Nixpkgs (NixOS/nixpkgs#212278), but I am uneasy about using such evil magic and people will probably get upset about it.

Therefore I am filing this bug as a general "meta issue" to keep track of the question: would it be possible to use Hermit with a stable Rust compiler? And if it can be done, what's needed to do so, and what's blocking it from happening? If there's no chance of supporting stable Rust, that should also be clarified, but in my experience a lot of Nightly features come down to "this is significantly easier than the workaround."

Some of these definitely look like conveniences e.g. map_first_last or atomic_mut_ptr (I believe these can be worked around with some copy/pasting or unsafe magic), while others come across as more fundamental such as ffi_returns_twice; but maybe it's nothing some good old fashioned assembly programming can't handle.

Please note this isn't a critical requirement or anything or something time sensitive; it's not like I'm literally stuck without this. But I figured it would be nice to get the conversation rolling.

warnings while running bash (or programs with line editing)

Describe the bug
hermit prints large amounts of debugging output about "Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.".

To Reproduce
First, fix reverie with samth/reverie@a7f6cae to run under current ubuntu.

Then, run hermit run /bin/bash. The output is below. Note the running /bin/bash -c ls produces no warnings, so I think the problem is with readline. Testing other programs that also support line editing suggests this as well.

[samth@huor:~/tmp/hermit (main) plt] ./target/debug/hermit run /bin/bash
2022-11-23T17:25:14.690407Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.692529Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.748850Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.750980Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.812312Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.814456Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.857796Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.859945Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.869533Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.871786Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.939757Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(19)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.968010Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.969855Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.978599Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.980856Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.989715Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:14.991932Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.000958Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.003443Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.012902Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.015336Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.025019Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.027279Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.057962Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.059981Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.093697Z ERROR detcore::syscalls::threads: sched_getaffinity: Not expecting request for more than 1024 byte cpu mask, actual was 8192 bytes
fatal error: sigaction failed

runtime stack:
runtime.throw(0x6fa2ca, 0x10)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/panic.go:1117 +0x72
runtime.sysSigaction.func1()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:488 +0x36
runtime.sysSigaction(0x10, 0x0, 0x7fffffffe1d8)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:487 +0x6c
runtime.sigaction(0x7fff00000010, 0x0, 0x7fffffffe1d8)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/cgo_sigaction.go:75 +0xd5
runtime.getsig(0x10, 0x44d2a0)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:456 +0x3a
runtime.initsig(0x7fff00000000)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/signal_unix.go:131 +0x68
runtime.mstartm0()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1330 +0x38
runtime.mstart1()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1302 +0xdb
runtime.mstart()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1272 +0x6e

goroutine 1 [runnable]:
runtime.main()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:115
runtime.goexit()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/asm_amd64.s:1371 +0x1
2022-11-23T17:25:15.137348Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.171460Z ERROR detcore::syscalls::threads: sched_getaffinity: Not expecting request for more than 1024 byte cpu mask, actual was 8192 bytes
fatal error: sigaction failed

runtime stack:
runtime.throw(0x6fa2ca, 0x10)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/panic.go:1117 +0x72
runtime.sysSigaction.func1()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:488 +0x36
runtime.sysSigaction(0x10, 0x0, 0x7fffffffe1d8)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:487 +0x6c
runtime.sigaction(0x7fff00000010, 0x0, 0x7fffffffe1d8)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/cgo_sigaction.go:75 +0xd5
runtime.getsig(0x10, 0x44d2a0)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:456 +0x3a
runtime.initsig(0x7fff00000000)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/signal_unix.go:131 +0x68
runtime.mstartm0()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1330 +0x38
runtime.mstart1()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1302 +0xdb
runtime.mstart()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1272 +0x6e

goroutine 1 [runnable]:
runtime.main()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:115
runtime.goexit()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/asm_amd64.s:1371 +0x1
2022-11-23T17:25:15.214560Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.366470Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.368761Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.432993Z ERROR detcore::syscalls::threads: sched_getaffinity: Not expecting request for more than 1024 byte cpu mask, actual was 8192 bytes
fatal error: sigaction failed

runtime stack:
runtime.throw(0x50ed23, 0x10)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/panic.go:1117 +0x72
2022-11-23T17:25:15.453879Z ERROR detcore::syscalls::threads: sched_getaffinity: Not expecting request for more than 1024 byte cpu mask, actual was 8192 bytes
runtime.sysSigaction.func1()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go2022-11-23T17:25:15.477802Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
:488 +0x36
runtime.sysSigaction(0x10, 0x0, 0x7fffffffe1e8)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:487 +0x6c
runtime.sigaction(0x7fff00000010, 0x0, 0x7fffffffe1e8)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/cgo_sigaction.go:75 +0xd5
runtime.getsig(0x10, 0x449c80)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/os_linux.go:456 +0x3a
runtime.initsig(0x7fff00000000)
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/signal_unix.go:131 +0x68
runtime.mstartm0()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1330 +0x38
runtime.mstart1()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1302 +0xdb
runtime.mstart()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:1272 +0x6e

goroutine 1 [runnable]:
runtime.main()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/proc.go:115
runtime.goexit()
	/opt/hostedtoolcache/go/1.16.10/x64/src/runtime/asm_amd64.s:1371 +0x1
2022-11-23T17:25:15.510119Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.547140Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (3 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.550521Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.663525Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.714734Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(65)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.715459Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(65)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.716437Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.719841Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.797015Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(71)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.826331Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.828562Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.859544Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.861853Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.915452Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.918893Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.976242Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (2 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.979484Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.989958Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:15.992247Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:16.066235Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(87)] jumped in the middle of runnable work (3 tasks). Need to record this for reproducibility.
2022-11-23T17:25:16.068727Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(87)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:16.113414Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(87)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:16.118293Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:16.120409Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:16.150599Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
2022-11-23T17:25:16.151543Z  WARN detcore::scheduler: Nondeterministic external actions [DetPid(3)] jumped in the middle of runnable work (1 tasks). Need to record this for reproducibility.
[root@hermetic-container:~/tmp/hermit (main) plt] 
exit

Environment

  • Linux kernel version (uname -a): Linux huor 5.19.0-23-generic #24-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 14 15:39:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Linux distro flavor (/etc/issue, /etc/redhat-release): Ubuntu 22.10

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=log.txt run.

Add any other context about the problem here.
log.txt.gz

Support go hello world at least

Describe the bug
When running a simply "Hello World" Go program, the program crashes before doing anything.

Indicate any of these common scenarios that apply:

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Minimal input to reproduce the behavior.
Build a hello world Go program (example: https://go.dev/play/).
Run that program with hermit.

Expected behavior
A clear and concise description of what you expected to happen.
It should run.

Environment

  • Linux kernel version (uname -a): Linux ip-172-31-4-73 5.15.0-1019-aws #23-Ubuntu SMP Wed Aug 17 18:33:13 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • CPU version (/proce/cpuinfo): t2.medium ec2 instance.
    processor : 0
    vendor_id : GenuineIntel
    cpu family : 6
    model : 79
    model name : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
    stepping : 1
    microcode : 0xb000040
    cpu MHz : 2300.092
    cache size : 46080 KB
    physical id : 0
    siblings : 2
    core id : 0
    cpu cores : 2
    apicid : 0
    initial apicid : 0
    fpu : yes
    fpu_exception : yes
    cpuid level : 13
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
    bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_stale_data
    bogomips : 4600.12
    clflush size : 64
    cache_alignment : 64
    address sizes : 46 bits physical, 48 bits virtual
    power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
stepping : 1
microcode : 0xb000040
cpu MHz : 2300.092
cache size : 46080 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_stale_data
bogomips : 4600.12
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

  • Linux distro flavor (/etc/issue, /etc/redhat-release): Ubuntu 22.04.1 LTS

Additional context
Attach the logs to this issue as a text file generated by hermit --log=trace --log-file=FOO run. https://gist.github.com/MarcoPolo/b58ddebb1655830a770fd29a651dec06

Also happens on NixOS.

Notes on triggering stack traces in different languages, externally

From the perspective of a native-code debugger, interpreting runtime states to extract a stack trace for arbitrary languages (interpreted, JIT-compiled, AOT-compiled...) is a hard problem. There are some attempts to teach debuggers how to access this runtime state, like py-bt via GDB Python extensions. But ultimately a language's interpreter/compiler/runtime is the source of truth for how to read that language's stack frames.

Fortunately, many languages an external trigger, typically a signal (e.g. SIGTRAP) can trigger the runtime to print its stacktrace from a signal handler. Therefore, especially if you are willing to throw away the current process (or have a fork/backup it), you can get out a language-specific stack trace. This issue is a place to accumulate notes on doing that, per-language.

Python

Setting the PYTHONFAULTHANDLER environment variable to 1 will put the runtime in a state where certain signals, including SIGABRT, will cause it to dump a traceback.

Java

The jcmd / jstack utilities provide a way to signal the JVM runtime to dump the current stacktraces to wherever its logging stdout is currently going.

.NET (CLR, mono)

Rust, C, C++

In these native languages, gdb or lldb can read the backtrace, or libunwind can be used to do it.

feat: Producing SLSA provenance for reproducible builds using Hermit

Feature Description

Hey! This is more of a request for a colaboration. Our team works on creating tools for SLSA provenance (SLSA is a project aimed at improving software supply chain integrity by producing verifiable provenance about the origin of the software and integrating it inside the software delivery pipeline).

We've been developing a container based provenance GitHub workflow that is able to produce verifiable and non-forgeable provenance for a build that uses a container base image and a specified script/command to run. This work is being done to support Project Oak's transparent release -- which aims to enhance remote attestations in TEEs with transparent, verifiable binary provenance.

The workflow creates provenance that is isolated from both the user and the build process, in order to produce provenance that could not have been manipulated (assuming trust in the workflow). The provenance record contains information needed for a verifier to reproduce the build -- and we have developed tools to support reproducibility.

Using Hermit inside a base image to create the build would hopefully provide a fully deterministic build.

Feature purpose and use cases
We'd like to demo or showcase the usage of Hermit inside a base image to produce a fully deterministic build output with verifiable build provenance.

We're wondering if (1) you have considered build provenance, and (2) if you would be interested in demonstrating usage of these tools together for demos and example.

cc @rbehjati @laurentsimon

RFC: A plan for open source integration tests

In the initial release, we have internal (buck, monorepo) integration testing of hermit, but don't yet have an OSS solution for full CI testing.

Our initial plan for building out OSS CI involves these steps:

  • Create a .nix expression for a build enivironment with buck[1]
  • Create a .buckconfig
  • Port tests/TARGETS and tests/helpers.bzl to either use a shims, possibly high-level wrappers for rust_binary,cpp_binary etc.
  • Have the tests depend use the cargo-built hermit (target/debug/hermit), rather than attempting to build hermit with buck externally.
  • Build a CI script that uses buck build and buck test for these integration tests.
  • Make sure it runs locally, and expose an easy validate script that people can call themselves.
  • Find or provision an external VM that is configured with perf counters and CPUID to be able to actually run these tests (CircleCI?)

thread 'main' panicked at 'prehook: Missed expected preemption!..'

Describe the bug

thread 'main' panicked at 'prehook: Missed expected preemption! Clock_value: 29407230. Stepped forward 27577123 RCBs, but should have trapped at 17690825'

  • a program hangs under hermit
  • hermit panics internally
  • hermit runs the program but divergence (nondeterminism) occurs

To Reproduce
Cannot share binary unfortunately. However it is linked against a basis library with quite some changes to standard glibc (lots of hooks). A simple program works. So I suspect that library to be the problem.

Expected behavior
Program executes successfully.

Environment

  • Linux kernel version (uname -a): Linux ld6216 4.12.14-197.45-default #1 SMP Thu Jun 4 11:06:04 UTC 2020 (2b6c749) x86_64 x86_64 x86_64 GNU/Linux
  • CPU version (/proce/cpuinfo): Intel(R) Xeon(R) Silver 4116 CPU @ 2.10GHz
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : 
stepping        : 4
microcode       : 0x200005a
cpu MHz         : 2100.000
cache size      : 16896 KB
physical id     : 0
siblings        : 24
core id         : 0
cpu cores       : 12
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke flush_l1d
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4200.00
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
  • Linux distro flavor (/etc/issue, /etc/redhat-release):
NAME="SLES"
VERSION="15-SP1"
VERSION_ID="15.1"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP1"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp1"

Additional context
Logs attached.
hermit.log

User docs reference internal FB Workplace instance

The following links are inaccessible to external users, could the talks and CLI examples please be posted elsewhere?

hermit/docs/Users.md

Lines 30 to 33 in 95b3ac7

* Find hermit [CLI examples here](https://fb.workplace.com/notes/hermetic-infra-fyi/hermit-tech-preview-a-linux-reproducibility-tool/244656753248444/)
* See demos in [this tech talk](https://fb.workplace.com/groups/591973351138875/permalink/1132872253715646/).
* [This talk](https://fb.workplace.com/groups/591973351138875/posts/1533285603674307) shows concurrency testing with hermit "chaos" mode.
* [This talk](https://fb.workplace.com/groups/hermit.fyi/post

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.