Skip to content
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

TcpStream::connect fails with InvalidInput while running tcp_uring example #97

Closed
LizardWizzard opened this issue Aug 9, 2022 · 2 comments

Comments

@LizardWizzard
Copy link

Version
I use current master at 2f151f2

Platform
The output of uname -a and ulimit -l.

uname -a
Linux 5.17.14-300.fc36.x86_64+debug #1 SMP PREEMPT Thu Jun 9 13:21:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

ulimit -l
8192

Description

TcpStream::connect fails with InvalidInput while running tcp_uring example

Running cargo run --example tcp_uring yields

Will run with IoUringDriver(you must be on linux and enable iouring feature)
[Client] Waiting for server ready
[Server] Bind ready
[Client] Server is ready, will connect and send data
thread '<unnamed>' panicked at '[Client] Unable to connect to server: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }', examples/tcp_uring.rs:34:18
Full backrace
stack backtrace:
 0:     0x5613d465c810 - std::backtrace_rs::backtrace::libunwind::trace::h60bf900414c5dcf2
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 1:     0x5613d465c810 - std::backtrace_rs::backtrace::trace_unsynchronized::habfc3ef92583c158
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x5613d465c810 - std::sys_common::backtrace::_print_fmt::hae196fe4153d0b63
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:66:5
 3:     0x5613d465c810 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h08f9c50f850514f5
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:45:22
 4:     0x5613d4678a0c - core::fmt::write::hcd15d2c673b5a9c1
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/fmt/mod.rs:1198:17
 5:     0x5613d4658ed5 - std::io::Write::write_fmt::h417be4d25b915a22
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/io/mod.rs:1672:15
 6:     0x5613d465e071 - std::sys_common::backtrace::_print::h95ab226f37d571aa
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:48:5
 7:     0x5613d465e071 - std::sys_common::backtrace::print::hc77fb9ed6b2eeb3d
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:35:9
 8:     0x5613d465e071 - std::panicking::default_hook::{{closure}}::hca418bd67097eb22
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:295:22
 9:     0x5613d465dd3e - std::panicking::default_hook::h1df4f10c6ed28c53
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:314:9
10:     0x5613d465e713 - std::panicking::rust_panic_with_hook::hf1e7a1cb721a9823
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:698:17
11:     0x5613d465e607 - std::panicking::begin_panic_handler::{{closure}}::h573a00e95ce9340d
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:588:13
12:     0x5613d465cd34 - std::sys_common::backtrace::__rust_end_short_backtrace::h597b7803117e52fd
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:138:18
13:     0x5613d465e332 - rust_begin_unwind
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:584:5
14:     0x5613d45d49b3 - core::panicking::panic_fmt::h62ccf03c8a8a51b5
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/panicking.rs:142:14
15:     0x5613d45d4a43 - core::result::unwrap_failed::hff48f82f03d418ae
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/result.rs:1814:5
16:     0x5613d45e4eec - core::result::Result<T,E>::expect::h06b932c75fc0619f
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/result.rs:1064:23
17:     0x5613d45ed061 - tcp_uring::run::{{closure}}::{{closure}}::h798ebb573da54447
                             at /home/dr/checkout/monoio/examples/tcp_uring.rs:32:28
18:     0x5613d45e2dfc - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h1d329dafc8cb7ef7
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/future/mod.rs:91:19
19:     0x5613d45e4596 - monoio::task::core::CoreStage<T>::poll::{{closure}}::hdf835fe76cf14c85
                             at /home/dr/checkout/monoio/monoio/src/task/core.rs:116:17
20:     0x5613d45d8480 - <core::cell::UnsafeCell<T> as monoio::task::utils::UnsafeCellExt<T>>::with_mut::h7635711df777ce23
                             at /home/dr/checkout/monoio/monoio/src/task/utils.rs:14:9
21:     0x5613d45e4663 - monoio::task::core::CoreStage<T>::with_mut::h56a469e0a03b69cb
                             at /home/dr/checkout/monoio/monoio/src/task/core.rs:101:9
22:     0x5613d45e4277 - monoio::task::core::CoreStage<T>::poll::h5af03ee54b8b3bb1
                             at /home/dr/checkout/monoio/monoio/src/task/core.rs:106:13
23:     0x5613d45df5f8 - monoio::task::harness::poll_future::hf77210d8be4f08a2
                             at /home/dr/checkout/monoio/monoio/src/task/harness.rs:376:18
24:     0x5613d45df6c7 - monoio::task::harness::Harness<T,S>::poll_inner::h9b1c2d534ff09919
                             at /home/dr/checkout/monoio/monoio/src/task/harness.rs:76:19
25:     0x5613d45e0973 - monoio::task::harness::Harness<T,S>::poll::h221813ad72ba1651
                             at /home/dr/checkout/monoio/monoio/src/task/harness.rs:52:15
26:     0x5613d45daa30 - monoio::task::raw::poll::hcf302bf61c74505b
                             at /home/dr/checkout/monoio/monoio/src/task/raw.rs:105:5
27:     0x5613d46172af - monoio::task::raw::RawTask::poll::h6674ecdee16f6556
                             at /home/dr/checkout/monoio/monoio/src/task/raw.rs:80:18
28:     0x5613d45f4365 - monoio::task::Task<S>::run::h85fa75e0221e7f99
                             at /home/dr/checkout/monoio/monoio/src/task/mod.rs:47:9
29:     0x5613d45e7ff3 - monoio::runtime::Runtime<D>::block_on::{{closure}}::{{closure}}::he6183734a8543936
                             at /home/dr/checkout/monoio/monoio/src/runtime.rs:143:29
30:     0x5613d45d4e63 - scoped_tls::ScopedKey<T>::set::ha00816e2f74cf61c
                             at /home/dr/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
31:     0x5613d45e7a22 - monoio::runtime::Runtime<D>::block_on::{{closure}}::h5d57811c8d0fbcc9
                             at /home/dr/checkout/monoio/monoio/src/runtime.rs:130:13
32:     0x5613d45d50c3 - scoped_tls::ScopedKey<T>::set::hdc18c92f0ae942b1
                             at /home/dr/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
33:     0x5613d45ea1db - <monoio::driver::uring::IoUringDriver as monoio::driver::Driver>::with::hd2978ab165e731a3
                             at /home/dr/checkout/monoio/monoio/src/driver/uring/mod.rs:259:9
34:     0x5613d45e7790 - monoio::runtime::Runtime<D>::block_on::h0470bf77d9dca20f
                             at /home/dr/checkout/monoio/monoio/src/runtime.rs:129:9
35:     0x5613d45df293 - monoio::start::h8fbcb4bfaa65ffce
                             at /home/dr/checkout/monoio/monoio/src/lib.rs:94:5
36:     0x5613d45ecbe7 - tcp_uring::run::{{closure}}::h34b374f24a920d28
                             at /home/dr/checkout/monoio/examples/tcp_uring.rs:27:9
37:     0x5613d45f371e - std::sys_common::backtrace::__rust_begin_short_backtrace::h7a904a254d5f590b
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys_common/backtrace.rs:122:18
38:     0x5613d45dcd9a - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::hd149554c9dcdfa01
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/thread/mod.rs:505:17
39:     0x5613d45e0f7e - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h3815bd578e1d88bc
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/panic/unwind_safe.rs:271:9
40:     0x5613d45d8da3 - std::panicking::try::do_call::h6df9a0604e18405a
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:492:40
41:     0x5613d45d926b - __rust_try
42:     0x5613d45d898a - std::panicking::try::h7d27a3888d9bc7c1
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:456:19
43:     0x5613d45e498e - std::panic::catch_unwind::h9eb5f3a8371e0827
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panic.rs:137:14
44:     0x5613d45dcbe5 - std::thread::Builder::spawn_unchecked_::{{closure}}::h8819e20da09f5953
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/thread/mod.rs:504:30
45:     0x5613d45efb2e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h947bc7d58899b370
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/ops/function.rs:248:5
46:     0x5613d4660b13 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hede4885ee64a1fac
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/alloc/src/boxed.rs:1935:9
47:     0x5613d4660b13 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h06c745de9f474954
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/alloc/src/boxed.rs:1935:9
48:     0x5613d4660b13 - std::sys::unix::thread::Thread::new::thread_start::h529a493f2fb191b6
                             at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/sys/unix/thread.rs:108:17
49:     0x7fb81032ce2d - start_thread
50:     0x7fb8103b21b0 - __clone3
51:                0x0 - <unknown>

Let me know if I can add more details. Thanks!

@ihciah
Copy link
Member

ihciah commented Aug 10, 2022

Thanks for reporting.
Fixed in #98.

@LizardWizzard
Copy link
Author

Thank you for a quick fix! It works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants