Conversation
|
stacked borrows violation with -Zmiri-tag-raw-pointers: MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-tag-raw-pointers" cargo miri test -p tokio --features full --lib -- runtime::tests::queue::overflowoutputIf run without -Zmiri-tag-raw-pointers, the test succeeds. |
|
Nah, it seems so complicated... |
.github/workflows/ci.yml
Outdated
| run: cargo miri test --features rt,rt-multi-thread,sync task | ||
| # Many of tests in tokio/tests and doctests use #[tokio::test] or | ||
| # #[tokio::main] that calls epoll_create1 that Miri does not support. | ||
| run: cargo miri test --features fs,io-util,io-std,net,parking_lot,rt,rt-multi-thread,sync --lib --no-fail-fast |
There was a problem hiding this comment.
This is opt-ing out of some things that use tokio::sync::Notified. Getting intrusive linked lists on the stack to pass with miri will probably be difficult.
There was a problem hiding this comment.
Or maybe not .. it seems like the problem was elsewhere entirely.
There was a problem hiding this comment.
Not sure how to fix the timer, but Notified works now.
There was a problem hiding this comment.
Haha, I figured it out: The issue for timers was futures::executor::block_on.
There was a problem hiding this comment.
The issue for timers was
futures::executor::block_on.
Ah, futures has a few unreleased fixes of stacked borrows violation with -Zmiri-tag-raw-pointers: rust-lang/futures-rs#2550
hawkw
left a comment
There was a problem hiding this comment.
as far as my understanding of stacked borrows goes, this looks legit. i didn't notice any serious issues with these changes.
i commented on a couple of minor style nits. also, i did notice that in some cases, some safety invariants seem to have changed, now that we access all linked list pointers via pointer casts. it would be nice if this was added to the existing safety documentation.
# 1.16.2 (February 15, 2022) This release updates the minimum supported Rust version (MSRV) to 1.49, the `mio` dependency to v0.8, and the (optional) `parking_lot` dependency to v0.12. Additionally, it contains several bug fixes, as well as internal refactoring and performance improvements. ### Fixed - time: prevent panicking in `sleep` with large durations ([#4495]) - time: eliminate potential panics in `Instant` arithmetic on platforms where `Instant::now` is not monotonic ([#4461]) - io: fix `DuplexStream` not participating in cooperative yielding ([#4478]) - rt: fix potential double panic when dropping a `JoinHandle` ([#4430]) ### Changed - update minimum supported Rust version to 1.49 ([#4457]) - update `parking_lot` dependency to v0.12.0 ([#4459]) - update `mio` dependency to v0.8 ([#4449]) - rt: remove an unnecessary lock in the blocking pool ([#4436]) - rt: remove an unnecessary enum in the basic scheduler ([#4462]) - time: use bit manipulation instead of modulo to improve performance ([#4480]) - net: use `std::future::Ready` instead of our own `Ready` future ([#4271]) - replace deprecated `atomic::spin_loop_hint` with `hint::spin_loop` ([#4491]) - fix miri failures in intrusive linked lists ([#4397]) ### Documented - io: add an example for `tokio::process::ChildStdin` ([#4479]) ### Unstable The following changes only apply when building with `--cfg tokio_unstable`: - task: fix missing location information in `tracing` spans generated by `spawn_local` ([#4483]) - task: add `JoinSet` for managing sets of tasks ([#4335]) - metrics: fix compilation error on MIPS ([#4475]) - metrics: fix compilation error on arm32v7 ([#4453]) [#4495]: #4495 [#4461]: #4461 [#4478]: #4478 [#4430]: #4430 [#4457]: #4457 [#4459]: #4459 [#4449]: #4449 [#4462]: #4462 [#4436]: #4436 [#4480]: #4480 [#4271]: #4271 [#4491]: #4491 [#4397]: #4397 [#4479]: #4479 [#4483]: #4483 [#4335]: #4335 [#4475]: #4475 [#4453]: #4453
# 1.17.0 (February 16, 2022) This release updates the minimum supported Rust version (MSRV) to 1.49, the `mio` dependency to v0.8, and the (optional) `parking_lot` dependency to v0.12. Additionally, it contains several bug fixes, as well as internal refactoring and performance improvements. ### Fixed - time: prevent panicking in `sleep` with large durations ([#4495]) - time: eliminate potential panics in `Instant` arithmetic on platforms where `Instant::now` is not monotonic ([#4461]) - io: fix `DuplexStream` not participating in cooperative yielding ([#4478]) - rt: fix potential double panic when dropping a `JoinHandle` ([#4430]) ### Changed - update minimum supported Rust version to 1.49 ([#4457]) - update `parking_lot` dependency to v0.12.0 ([#4459]) - update `mio` dependency to v0.8 ([#4449]) - rt: remove an unnecessary lock in the blocking pool ([#4436]) - rt: remove an unnecessary enum in the basic scheduler ([#4462]) - time: use bit manipulation instead of modulo to improve performance ([#4480]) - net: use `std::future::Ready` instead of our own `Ready` future ([#4271]) - replace deprecated `atomic::spin_loop_hint` with `hint::spin_loop` ([#4491]) - fix miri failures in intrusive linked lists ([#4397]) ### Documented - io: add an example for `tokio::process::ChildStdin` ([#4479]) ### Unstable The following changes only apply when building with `--cfg tokio_unstable`: - task: fix missing location information in `tracing` spans generated by `spawn_local` ([#4483]) - task: add `JoinSet` for managing sets of tasks ([#4335]) - metrics: fix compilation error on MIPS ([#4475]) - metrics: fix compilation error on arm32v7 ([#4453]) [#4495]: #4495 [#4461]: #4461 [#4478]: #4478 [#4430]: #4430 [#4457]: #4457 [#4459]: #4459 [#4449]: #4449 [#4462]: #4462 [#4436]: #4436 [#4480]: #4480 [#4271]: #4271 [#4491]: #4491 [#4397]: #4397 [#4479]: #4479 [#4483]: #4483 [#4335]: #4335 [#4475]: #4475 [#4453]: #4453
depend on #4396.Thanks to rust-lang/miri#1952, more tests can be run with Miri.
The following tests still do not work.
self,&self,&mut self(e.g.,Pin<&mut Self>). Implement arbitrary-self dynamic method receivers rust-lang/miri#1038