Skip to content

Commit 9198125

Browse files
committed
throw unsupported for epoll_wait
1 parent 78eafea commit 9198125

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

src/shims/unix/linux/fd.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
152152
let _maxevents = this.read_scalar(maxevents)?.to_i32()?;
153153
let _timeout = this.read_scalar(timeout)?.to_i32()?;
154154

155-
let numevents = 0;
156155
if let Some(epfd) = this.machine.file_handler.handles.get_mut(&epfd) {
157156
let _epfd = epfd
158157
.as_any_mut()
159158
.downcast_mut::<Epoll>()
160159
.ok_or_else(|| err_unsup_format!("non-epoll FD passed to `epoll_wait`"))?;
161160

162161
// FIXME return number of events ready when scheme for marking events ready exists
163-
Ok(Scalar::from_i32(numevents))
162+
throw_unsup_format!("returning ready events from epoll_wait is not yet implemented");
164163
} else {
165164
Ok(Scalar::from_i32(this.handle_not_found()?))
166165
}

tests/pass-dep/tokio/sleep.rs renamed to tests/fail/tokio/sleep.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@compile-flags: -Zmiri-permissive-provenance -Zmiri-backtrace=full
22
//@only-target-x86_64-unknown-linux: support for tokio only on linux and x86
3+
//@error-pattern: returning ready events from epoll_wait is not yet implemented
34

45
use tokio::time::{sleep, Duration, Instant};
56

tests/fail/tokio/sleep.stderr

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
error: unsupported operation: returning ready events from epoll_wait is not yet implemented
2+
--> CARGO_REGISTRY/.../epoll.rs:LL:CC
3+
|
4+
LL | / syscall!(epoll_wait(
5+
LL | | self.ep,
6+
LL | | events.as_mut_ptr(),
7+
LL | | events.capacity() as i32,
8+
LL | | timeout,
9+
LL | | ))
10+
| |__________^ returning ready events from epoll_wait is not yet implemented
11+
|
12+
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
13+
= note: BACKTRACE:
14+
= note: inside `mio::sys::PLATFORM::selector::epoll::Selector::select` at CARGO_REGISTRY/.../mod.rs:LL:CC
15+
= note: inside `mio::poll::Poll::poll` at CARGO_REGISTRY/.../poll.rs:LL:CC
16+
= note: inside `tokio::runtime::io::Driver::turn` at CARGO_REGISTRY/.../mod.rs:LL:CC
17+
= note: inside `tokio::runtime::io::Driver::park_timeout` at CARGO_REGISTRY/.../mod.rs:LL:CC
18+
= note: inside `tokio::runtime::signal::Driver::park_timeout` at CARGO_REGISTRY/.../mod.rs:LL:CC
19+
= note: inside `tokio::runtime::process::Driver::park_timeout` at CARGO_REGISTRY/.../process.rs:LL:CC
20+
= note: inside `tokio::runtime::driver::IoStack::park_timeout` at CARGO_REGISTRY/.../driver.rs:LL:CC
21+
= note: inside `tokio::runtime::time::Driver::park_thread_timeout` at CARGO_REGISTRY/.../mod.rs:LL:CC
22+
= note: inside `tokio::runtime::time::Driver::park_internal` at CARGO_REGISTRY/.../mod.rs:LL:CC
23+
= note: inside `tokio::runtime::time::Driver::park` at CARGO_REGISTRY/.../mod.rs:LL:CC
24+
= note: inside `tokio::runtime::driver::TimeDriver::park` at CARGO_REGISTRY/.../driver.rs:LL:CC
25+
= note: inside `tokio::runtime::driver::Driver::park` at CARGO_REGISTRY/.../driver.rs:LL:CC
26+
= note: inside `tokio::runtime::scheduler::multi_thread::park::Inner::park_driver` at CARGO_REGISTRY/.../park.rs:LL:CC
27+
= note: inside `tokio::runtime::scheduler::multi_thread::park::Inner::park` at CARGO_REGISTRY/.../park.rs:LL:CC
28+
= note: inside `tokio::runtime::scheduler::multi_thread::park::Parker::park` at CARGO_REGISTRY/.../park.rs:LL:CC
29+
= note: inside `tokio::runtime::scheduler::multi_thread::worker::Context::park_timeout` at CARGO_REGISTRY/.../worker.rs:LL:CC
30+
= note: inside `tokio::runtime::scheduler::multi_thread::worker::Context::park` at CARGO_REGISTRY/.../worker.rs:LL:CC
31+
= note: inside `tokio::runtime::scheduler::multi_thread::worker::Context::run` at CARGO_REGISTRY/.../worker.rs:LL:CC
32+
= note: inside closure at CARGO_REGISTRY/.../worker.rs:LL:CC
33+
= note: inside `tokio::macros::scoped_tls::ScopedKey::<tokio::runtime::scheduler::multi_thread::worker::Context>::set::<[closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}], ()>` at CARGO_REGISTRY/.../scoped_tls.rs:LL:CC
34+
= note: inside `tokio::runtime::scheduler::multi_thread::worker::run` at CARGO_REGISTRY/.../worker.rs:LL:CC
35+
= note: inside closure at CARGO_REGISTRY/.../worker.rs:LL:CC
36+
= note: inside `<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]> as std::future::Future>::poll` at CARGO_REGISTRY/.../task.rs:LL:CC
37+
= note: inside closure at CARGO_REGISTRY/.../core.rs:LL:CC
38+
= note: inside `tokio::loom::std::unsafe_cell::UnsafeCell::<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>>>::with_mut::<std::task::Poll<()>, [closure@tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll::{closure#0}]>` at CARGO_REGISTRY/.../unsafe_cell.rs:LL:CC
39+
= note: inside `tokio::runtime::task::core::Core::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll` at CARGO_REGISTRY/.../core.rs:LL:CC
40+
= note: inside closure at CARGO_REGISTRY/.../harness.rs:LL:CC
41+
= note: inside `<std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]> as std::ops::FnOnce<()>>::call_once` at RUSTLIB/core/src/panic/unwind_safe.rs:LL:CC
42+
= note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]>, std::task::Poll<()>>` at RUSTLIB/std/src/panicking.rs:LL:CC
43+
= note: inside `std::panicking::r#try::<std::task::Poll<()>, std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]>>` at RUSTLIB/std/src/panicking.rs:LL:CC
44+
= note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]>, std::task::Poll<()>>` at RUSTLIB/std/src/panic.rs:LL:CC
45+
= note: inside `tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>` at CARGO_REGISTRY/.../harness.rs:LL:CC
46+
= note: inside `tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll_inner` at CARGO_REGISTRY/.../harness.rs:LL:CC
47+
= note: inside `tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll` at CARGO_REGISTRY/.../harness.rs:LL:CC
48+
= note: inside `tokio::runtime::task::raw::poll::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>` at CARGO_REGISTRY/.../raw.rs:LL:CC
49+
= note: inside `tokio::runtime::task::raw::RawTask::poll` at CARGO_REGISTRY/.../raw.rs:LL:CC
50+
= note: inside `tokio::runtime::task::UnownedTask::<tokio::runtime::blocking::schedule::BlockingSchedule>::run` at CARGO_REGISTRY/.../mod.rs:LL:CC
51+
= note: inside `tokio::runtime::blocking::pool::Task::run` at CARGO_REGISTRY/.../pool.rs:LL:CC
52+
= note: inside `tokio::runtime::blocking::pool::Inner::run` at CARGO_REGISTRY/.../pool.rs:LL:CC
53+
= note: inside closure at CARGO_REGISTRY/.../pool.rs:LL:CC
54+
= note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
55+
= note: inside closure at RUSTLIB/std/src/thread/mod.rs:LL:CC
56+
= note: inside `<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]> as std::ops::FnOnce<()>>::call_once` at RUSTLIB/core/src/panic/unwind_safe.rs:LL:CC
57+
= note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC
58+
= note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]>>` at RUSTLIB/std/src/panicking.rs:LL:CC
59+
= note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()>` at RUSTLIB/std/src/panic.rs:LL:CC
60+
= note: inside closure at RUSTLIB/std/src/thread/mod.rs:LL:CC
61+
= note: inside `<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}] as std::ops::FnOnce<()>>::call_once - shim(vtable)` at RUSTLIB/core/src/ops/function.rs:LL:CC
62+
= note: inside `<std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC
63+
= note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC
64+
= note: inside `std::sys::PLATFORM::thread::Thread::new::thread_start` at RUSTLIB/std/src/sys/PLATFORM/thread.rs:LL:CC
65+
= note: this error originates in the macro `syscall` (in Nightly builds, run with -Z macro-backtrace for more info)
66+
67+
error: aborting due to previous error
68+

0 commit comments

Comments
 (0)