cargo run error: Error: No such device or address

Hello,

When I use Clion to run the rust project, it prompts an error: No such device or address, but when the cargo run command is executed in the terminal, the project runs normally.

Use Cargo run in terminal

$ /home/lizhihong/.cargo/bin/cargo run --color=always --package gitui

Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/gitui`

Use Cargo run in Clion

/home/lizhihong/.cargo/bin/cargo run --color=always --package gitui
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
Running `target/debug/gitui`
Error: No such device or address (os error 6)

Process finished with exit code 1
0
2 comments

Hello!

Is the Emulate terminal in output console option enabled in your run/debug configuration?

0

In fact, I saw this configuration later and got a new error after enabling it.

/home/lizhihong/.cargo/bin/cargo run --color=always --package gitui --bin gitui
Finished dev [unoptimized + debuginfo] target(s) in 1.38s
Running `target/debug/gitui`
panic: PanicInfo { payload: Any { .. }, message: Some(attempt to multiply with overflow), location: Location { file: "/home/lizhihong/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/layout.rs", line: 253, col: 67 } }
trace:
0: gitui::set_panic_handlers::{{closure}}
at src/main.rs:294:19
1: std::panicking::rust_panic_with_hook
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:626:17
2: std::panicking::begin_panic_handler::{{closure}}
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:517:13
3: std::sys_common::backtrace::__rust_end_short_backtrace
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18
4: rust_begin_unwind
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
5: core::panicking::panic_fmt
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
6: core::panicking::panic
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:50:5
7: tui::layout::split
at /home/lizhihong/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/layout.rs:253:67
8: tui::layout::Layout::split::{{closure}}::{{closure}}
at /home/lizhihong/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/layout.rs:191:36
std::collections::hash::map::Entry<K,V>::or_insert_with
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/collections/hash/map.rs:2304:43
tui::layout::Layout::split::{{closure}}
at /home/lizhihong/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/layout.rs:189:13
std::thread::local::LocalKey<T>::try_with
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/local.rs:399:16
std::thread::local::LocalKey<T>::with
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/thread/local.rs:375:9
9: tui::layout::Layout::split
at /home/lizhihong/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/layout.rs:188:9
10: <gitui::tabs::status::Status as gitui::components::DrawableComponent>::draw
at src/tabs/status.rs:95:16
11: gitui::app::App::draw
at src/app.rs:271:9
12: gitui::draw::{{closure}}
at src/main.rs:233:19
13: tui::terminal::Terminal<B>::draw
at /home/lizhihong/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/terminal.rs:267:9
14: gitui::draw
at src/main.rs:232:2
15: gitui::main
at src/main.rs:189:4
16: core::ops::function::FnOnce::call_once
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:227:5
17: std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:125:18
18: std::rt::lang_start::{{closure}}
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:63:18
19: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:259:13
std::panicking::try::do_call
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
std::panicking::try
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
std::panic::catch_unwind
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
std::rt::lang_start_internal::{{closure}}
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:48
std::panicking::try::do_call
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
std::panicking::try
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
std::panic::catch_unwind
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
std::rt::lang_start_internal
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:20
20: std::rt::lang_start
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:62:5
21: main
22: __libc_start_main
23: _start

Process finished with exit code 101



0

Please sign in to leave a comment.