facebookexperimental / facebookexperimental/hermit
Panic on hello world java program
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
**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
- [X] 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::unwrap
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/option.rs:778:21
4: detcore::>::handle_cpuid_event::{{closure}}
at ./hermit/detcore/src/lib.rs:592:13
5: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
6: as core::future::future::Future>::poll{{reify.shim}}
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:86:9
7: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
8: reverie_ptrace::task::TracedTask::handle_cpuid::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:802:13
9: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
10: reverie_ptrace::task::TracedTask::handle_sigsegv::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:952:51
11: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
12: reverie_ptrace::task::TracedTask::handle_signal::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:974:57
13: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
14: reverie_ptrace::task::TracedTask::handle_stop_event::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:867:67
15: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
16: 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: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
18: 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::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:: for &mut F>::call_mut
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/ops/function.rs:617:13
22: reverie_ptrace::task::TracedTask::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: 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::run_loop_internal::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1430:34
25: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
26: reverie_ptrace::task::TracedTask::run_loop::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1374:43
27: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
28: 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: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/future.rs:124:9
30: 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::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:: for &mut F>::call_mut
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/ops/function.rs:617:13
34: reverie_ptrace::task::TracedTask::run::{{closure}}::{{closure}}
at ./.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.25/src/async_await/select_mod.rs:331:13
35: 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::run::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1458:13
37: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
38: reverie_ptrace::task::TracedTask::handle_new_task::{{closure}}::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/task.rs:1162:40
39: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
40: tokio::runtime::task::core::Core::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::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::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: 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::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::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::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: 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::try_with
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/std/src/thread/local.rs:446:16
62: std::thread::local::LocalKey::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: 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: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
67: reverie_ptrace::tracer::Tracer::wait::{{closure}}
at ./.cargo/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/reverie-ptrace/src/tracer.rs:136:59
68: 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: as core::future::future::Future>::poll
at /rustc/ff8c8dfbe66701531e3e5e335c28c544d0fbc945/library/core/src/future/mod.rs:92:19
71: 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::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::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: as core::ops::function::FnMut>::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**
- [X] 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
- [X] CPU version (`/proce/cpuinfo`): 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
- [X] 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](https://github.com/facebookexperimental/hermit/files/10079264/log.txt)
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.