facebookexperimental / hermit

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.
Other
1.16k stars 32 forks source link

intercepted.cpuid(eax).unwrap() panics #32

Open androm3da opened 1 year ago

androm3da commented 1 year ago

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:

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.

androm3da commented 1 year ago

I see frequent cases of reverie_ptrace::task: [5] handle_signal: received signal SIGSEGV in the log -- I'm guessing it's not normal? But it seems to be so often, it's surprising that it wasn't fatal.