-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: test more features with Miri #5317
Conversation
7594124
to
957ef81
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
3d8ceba
to
cd3fac9
Compare
This SB violation can be suppressed by calling poll_elapsed after the box move in that test, but I'm not sure what the correct fix is. diff --git a/tokio/src/runtime/time/tests/mod.rs b/tokio/src/runtime/time/tests/mod.rs
index 88c7d768..ddd5c03d 100644
--- a/tokio/src/runtime/time/tests/mod.rs
+++ b/tokio/src/runtime/time/tests/mod.rs
@@ -215,16 +215,18 @@ fn poll_process_levels() {
let mut entries = vec![];
for i in 0..normal_or_miri(1024, 64) {
- let mut entry = Box::pin(TimerEntry::new(
+ let entry = Box::pin(TimerEntry::new(
&handle.inner,
handle.inner.driver().clock().now() + Duration::from_millis(i),
));
- let _ = entry
+ entries.push(entry);
+
+ let _ = entries
+ .last_mut()
+ .unwrap()
.as_mut()
.poll_elapsed(&mut Context::from_waker(noop_waker_ref()));
-
- entries.push(entry);
}
for t in 1..normal_or_miri(1024, 64) { |
``` error: unsupported operation: non-default mode 0o600 is not supported ```
``` error: unsupported operation: can't call foreign function: sigaction --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/signal-hook-registry-1.4.0/src/lib.rs:214:21 | 214 | if unsafe { libc::sigaction(signal, ptr::null(), &mut old) } != 0 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: sigaction | ```
``` error: unsupported operation: can't call foreign function: socket --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.8.5/src/sys/unix/net.rs:29:18 | 29 | let socket = syscall!(socket(domain, socket_type, 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: socket | ```
``` error: unsupported operation: can't call foreign function: epoll_wait --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.8.5/src/sys/unix/selector/epoll.rs:106:9 | 106 | / syscall!(epoll_wait( 107 | | self.ep, 108 | | events.as_mut_ptr(), 109 | | events.capacity() as i32, 110 | | timeout, 111 | | )) | |__________^ can't call foreign function: epoll_wait | ```
``` error: unsupported operation: can't call foreign function: socket --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.8.5/src/sys/unix/net.rs:29:18 | 29 | let socket = syscall!(socket(domain, socket_type, 0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: socket | ```
``` error: unsupported operation: can't call foreign function: sigaction --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/signal-hook-registry-1.4.0/src/lib.rs:214:21 | 214 | if unsafe { libc::sigaction(signal, ptr::null(), &mut old) } != 0 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: sigaction | ```
``` error: unsupported operation: cannot write to event --> /home/runner/.rustup/toolchains/nightly-2022-12-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/fd.rs:152:13 | 152 | / libc::write( 153 | | self.as_raw_fd(), 154 | | buf.as_ptr() as *const libc::c_void, 155 | | cmp::min(buf.len(), READ_LIMIT), 156 | | ) | |_____________^ cannot write to event | ```
``` error: unsupported operation: can't call foreign function: epoll_wait --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.8.5/src/sys/unix/selector/epoll.rs:106:9 | 106 | / syscall!(epoll_wait( 107 | | self.ep, 108 | | events.as_mut_ptr(), 109 | | events.capacity() as i32, 110 | | timeout, 111 | | )) | |__________^ can't call foreign function: epoll_wait | ```
``` error: unsupported operation: can't call foreign function: getsockopt --> /home/runner/work/tokio/tokio/tokio/src/net/unix/ucred.rs:81:23 | 81 | let ret = getsockopt( | _______________________^ 82 | | raw_fd, 83 | | SOL_SOCKET, 84 | | SO_PEERCRED, 85 | | &mut ucred as *mut ucred as *mut c_void, 86 | | &mut ucred_size, 87 | | ); | |_____________^ can't call foreign function: getsockopt | ```
``` error: unsupported operation: cannot write to event --> /home/runner/.rustup/toolchains/nightly-2022-12-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/fd.rs:152:13 | 152 | / libc::write( 153 | | self.as_raw_fd(), 154 | | buf.as_ptr() as *const libc::c_void, 155 | | cmp::min(buf.len(), READ_LIMIT), 156 | | ) | |_____________^ cannot write to event | ```
``` error: unsupported operation: can't call foreign function: gnu_get_libc_version --> /home/runner/.rustup/toolchains/nightly-2022-12-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/os.rs:660:48 | 660 | let version_cstr = unsafe { CStr::from_ptr(gnu_get_libc_version()) }; | ^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: gnu_get_libc_version | ```
``` error: unsupported operation: can't call foreign function: pipe2 --> /home/runner/.rustup/toolchains/nightly-2022-12-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/pipe.rs:30:21 | 30 | cvt(libc::pipe2(fds.as_mut_ptr(), libc::O_CLOEXEC))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: pipe2 | ```
``` error: unsupported operation: can't call foreign function: getaddrinfo --> /home/runner/.rustup/toolchains/nightly-2022-12-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/net.rs:206:25 | 206 | cvt_gai(c::getaddrinfo(c_host.as_ptr(), ptr::null(), &hints, &mut res)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: getaddrinfo | ```
``` error: unsupported operation: the 0x3 command is not supported for `fcntl`) --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.3/src/fcntl.rs:471:24 | 471 | F_GETFL => libc::fcntl(fd, libc::F_GETFL), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the 0x3 command is not supported for `fcntl`) | ```
``` error: unsupported operation: integer-to-pointer casts and `ptr::from_exposed_addr` are not supported with `-Zmiri-strict-provenance` --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.9.5/src/word_lock.rs:320:9 | 320 | (self & QUEUE_MASK) as *const ThreadData | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer casts and `ptr::from_exposed_addr` are not supported with `-Zmiri-strict-provenance` | ```
cd3fac9
to
1ce2822
Compare
These new SB violations seem like a miri bug. Moving a box shouldn't assert uniqueness if the contents are !Unpin. |
(blocked on rust-lang/rust#106180 that fixes a bug Darksonn mentioned) |
Motivation
It seems Miri recently added support for epoll_create1: rust-lang/miri#2357
Reported errors
SB violations
--lib -- runtime::time::tests::poll_process_levels (tokio/src/runtime/time/tests/mod.rs:211:26, SB violation)
--test sync_barrier -- lots (tokio/tests/sync_barrier.rs:73:11, SB violation)
--test sync_mpsc_weak -- actor_weak_sender (tokio/tests/sync_mpsc_weak.rs:59:30, SB violation)
--test io_read -- read_buf_bad_async_read (tokio/tests/io_read.rs:72:36, SB violation in test helper); addressed in #5322Unsupported errors
click to show
all code calling
wake()
(inside mio::waker::Waker::wake):fs/io/time etc.: (fixed in unreleased rust-lang/miri#2764)
net related:
process related:
signal related:
tokio/tests/net_lookup_host.rs:
tokio/tests/uds_cred.rs:
tempfile related (will be fixed in rust-lang/miri#2720):