You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://github.com/RalfJung/cargo-careful triggers a panic attempted to leave type `libc::unix::linux_like::linux::gnu::b64::x86_64::stat` uninitialized, which is invalid from within ipc-channel.
Easily reproduced by sending an IpcReceiver over an IpcOneShotServer. For instance:
use ipc_channel::ipc::{self,IpcOneShotServer,IpcReceiver,IpcSender};fnmain() -> Result<(),Box<dyn::std::error::Error>>{let(server, name) = IpcOneShotServer::new()?;let(tx, rx) = ipc::channel::<i32>()?;IpcSender::connect(name.clone())?.send(rx)?;
tx.send(1)?;let rx2:IpcReceiver<i32> = server.accept()?.1;let x = rx2.recv()?;println!("connected via {} and got {}", name, x);Ok(())}
Then:
$ RUST_BACKTRACE=1 cargo +nightly careful run
Preparing a careful sysroot (target: x86_64-unknown-linux-gnu)... done
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/bug`
thread 'main' panicked at 'attempted to leave type `libc::unix::linux_like::linux::gnu::b64::x86_64::stat` uninitialized, which is invalid', /.../.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.16.0/src/platform/unix/mod.rs:1118:22
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::mem::uninitialized
at /.../.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:691:9
4: ipc_channel::platform::unix::is_socket
at /.../.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.16.0/src/platform/unix/mod.rs:1118:22
5: ipc_channel::platform::unix::recv
at /.../.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.16.0/src/platform/unix/mod.rs:947:16
6: ipc_channel::platform::unix::OsIpcReceiver::recv
at /.../.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.16.0/src/platform/unix/mod.rs:145:9
7: ipc_channel::platform::unix::OsIpcOneShotServer::accept
at /.../.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.16.0/src/platform/unix/mod.rs:650:59
8: ipc_channel::ipc::IpcOneShotServer<T>::accept
at /.../.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.16.0/src/ipc.rs:782:13
9: bug::main
at ./src/main.rs:7:33
10: core::ops::function::FnOnce::call_once
at /.../.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:251:5
Whereas without cargo-careful there is no problem:
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/bug`
connected via /tmp/.tmpaoO7IE/socket and got 1
I suppose this would be fixed by #280 replacing that mem::uninitialized() with MaybeUninit. Still, I figured I'd report this for visibility in case anybody else runs into it.
The text was updated successfully, but these errors were encountered:
https://github.com/RalfJung/cargo-careful triggers a panic
attempted to leave type `libc::unix::linux_like::linux::gnu::b64::x86_64::stat` uninitialized, which is invalid
from withinipc-channel
.Easily reproduced by sending an
IpcReceiver
over anIpcOneShotServer
. For instance:Then:
Whereas without cargo-careful there is no problem:
I suppose this would be fixed by #280 replacing that
mem::uninitialized()
withMaybeUninit
. Still, I figured I'd report this for visibility in case anybody else runs into it.The text was updated successfully, but these errors were encountered: