Skip to content

Will panic on newer rust due to outdated tokio dependency #10

Open
@5225225

Description

@5225225

Hello!

I'm coming to this repo from rust-lang/rust#99389 where we're making the checks for uninitialized data stricter. This crate runs into them. Here's a backtrace, it looks like the tokio dep needs upgrading?

---- protocol::test::test_invalid_async stdout ----
thread 'protocol::test::test_invalid_async' panicked at 'attempted to leave type `[tokio_sync::loom::sync::CausalCell<core::mem::manually_drop::ManuallyDrop<core::result::Result<protocol::Message, error::Error>>>; 32]` uninitialized, which is invalid', /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/block.rs:366:24
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::mem::uninitialized
             at /home/jess/src/rust/library/core/src/mem/mod.rs:685:9
   4: tokio_sync::mpsc::block::Values<T>::uninitialized
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/block.rs:366:24
   5: tokio_sync::mpsc::block::Block<T>::new
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/block.rs:91:30
   6: tokio_sync::mpsc::list::channel
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/list.rs:38:34
   7: tokio_sync::mpsc::chan::channel
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/chan.rs:138:20
   8: tokio_sync::mpsc::bounded::channel
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/bounded.rs:118:20
   9: tt::protocol::test::test_invalid_async
             at ./src/protocol.rs:953:32
  10: tt::protocol::test::test_invalid_async::{{closure}}
             at ./src/protocol.rs:951:5
  11: core::ops::function::FnOnce::call_once
             at /home/jess/src/rust/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- protocol::test::test_read_write_async stdout ----
thread 'protocol::test::test_read_write_async' panicked at 'attempted to leave type `[tokio_sync::loom::sync::CausalCell<core::mem::manually_drop::ManuallyDrop<core::result::Result<protocol::Message, error::Error>>>; 32]` uninitialized, which is invalid', /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/block.rs:366:24
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::mem::uninitialized
             at /home/jess/src/rust/library/core/src/mem/mod.rs:685:9
   4: tokio_sync::mpsc::block::Values<T>::uninitialized
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/block.rs:366:24
   5: tokio_sync::mpsc::block::Block<T>::new
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/block.rs:91:30
   6: tokio_sync::mpsc::list::channel
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/list.rs:38:34
   7: tokio_sync::mpsc::chan::channel
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/chan.rs:138:20
   8: tokio_sync::mpsc::bounded::channel
             at /home/jess/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-sync-0.1.7/src/mpsc/bounded.rs:118:20
   9: tt::protocol::test::test_read_write_async
             at ./src/protocol.rs:916:32
  10: tt::protocol::test::test_read_write_async::{{closure}}
             at ./src/protocol.rs:914:5
  11: core::ops::function::FnOnce::call_once
             at /home/jess/src/rust/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    protocol::test::test_invalid_async
    protocol::test::test_read_write_async

It's unclear if this is only an issue in the tests, or if it will also run into the issues in usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions